abstractKeybindingService.ts ×7

Frontier kind: Code frontier

unlabeled · c_5d4a9cb038af

5 tests · 12046 LOC · 57 files · introduces 0 tests · 46 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges46 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1779 ranges12046 lines · 57 files · Browse complete extent
All tests (intent)
5 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 46 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/keybinding/common/abstractKeybindingService.ts 38 introduced LOC · 7 ranges

Open complete file

158
159 private _scheduleLeaveChordMode(): void {
160 > const chordLastInteractedTime = Date.now(); abstractKeybindingService.ts
161 > this._currentChordChecker.cancelAndSet(() => {
162
163 if (!this._documentHasFocus()) {
172 }
173
175 > }
176
177 private _expectAnotherChord(firstChord: string, keypressLabel: string | null): void {
179 > this._currentChords.push({ keypress: firstChord, label: keypressLabel });
180 >
181 > switch (this._currentChords.length) {
182 > case 0:
183 throw illegalState('impossible');
185 > // TODO@ulugbekna: revise this message and the one below (at least, fix terminology)
186 > this._currentChordStatusMessage = this._notificationService.status(nls.localize('first.chord', "({0}) was pressed. Waiting for second key of chord...", keypressLabel));
187 > break;
188 > default: {
189 const fullKeypressLabel = this._currentChords.map(({ label }) => label).join(', ');
190 this._currentChordStatusMessage = this._notificationService.status(nls.localize('next.chord', "({0}) was pressed. Waiting for next key of chord...", fullKeypressLabel));
191 }
193 >
194 > this._scheduleLeaveChordMode();
195 >
196 > if (IME.enabled) {
197 > IME.disable();
198 > }
199 > }
200
201 private _leaveChordMode(): void {
202 > if (this._currentChordStatusMessage) { abstractKeybindingService.ts
203 > this._currentChordStatusMessage.close();
204 > this._currentChordStatusMessage = null;
205 > }
206 > this._currentChordChecker.cancel();
207 > this._currentChords = [];
208 > IME.enable();
209 > }
210
211 public dispatchByUserSettingsLabel(userSettingsLabel: string, target: IContextKeyServiceTarget): void {
329
330 case ResultKind.MoreChordsNeeded: {
332 > this._logService.trace('KeybindingService#dispatch', keypressLabel, `[ Several keybindings match - more chords needed ]`);
333 >
334 > shouldPreventDefault = true;
335 > this._expectAnotherChord(userPressedChord, keypressLabel);
336 > this._log(this._currentChords.length === 1 ? `+ Entering multi-chord mode...` : `+ Continuing multi-chord mode...`);
337 > return shouldPreventDefault;
338 > }
339
340 case ResultKind.KbFound: {
src/vs/base/common/ime.ts 8 introduced LOC · 3 ranges

Open complete file

14
15 public get enabled() {
16 > return this._enabled; ime.ts
17 > }
18
19 /**
21 */
22 public enable(): void {
23 > this._enabled = true; ime.ts
24 > this._onDidChange.fire();
25 > }
26
27 /**
29 */
30 public disable(): void {
31 > this._enabled = false; ime.ts
32 > this._onDidChange.fire();
33 > }
34 }
35