@codingame/monaco-vscode-keybindings-service-override 11.1.1 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +19 -2
- package/index.js +110 -1
- package/package.json +21 -8
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardConfig.d.ts +10 -0
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardConfig.js +18 -12
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardMapper.d.ts +15 -0
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardMapper.js +2 -0
- package/vscode/src/vs/workbench/browser/contextkeys.d.ts +67 -0
- package/vscode/src/vs/workbench/browser/contextkeys.js +17 -16
- package/vscode/src/vs/workbench/contrib/commands/common/commands.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/commands/common/commands.contribution.js +6 -5
- package/vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js +2 -1
- package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.js +27 -26
- package/vscode/src/vs/workbench/contrib/preferences/common/smartSnippetInserter.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/preferences/common/smartSnippetInserter.js +14 -13
- package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.d.ts +44 -0
- package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +183 -159
- package/vscode/src/vs/workbench/services/commands/common/commandService.d.ts +23 -0
- package/vscode/src/vs/workbench/services/commands/common/commandService.js +3 -1
- package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.d.ts +58 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +130 -129
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.d.ts +69 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.js +37 -45
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/_.contribution.d.ts +8 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/_.contribution.js +2 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/cz.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/cz.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de-swiss.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de-swiss.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.linux.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.linux.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/dk.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/dk.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/dvorak.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/dvorak.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-belgian.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-belgian.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-ext.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-ext.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-in.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-in.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.linux.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.linux.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es-latin.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es-latin.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.linux.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.linux.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.linux.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.linux.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/hu.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/hu.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/it.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/it.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/it.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/it.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/jp-roman.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/jp-roman.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/jp.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/jp.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ko.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ko.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.linux.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.linux.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/no.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/no.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt-br.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt-br.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.linux.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.linux.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/sv.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/sv.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/thai.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/thai.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/tr.win.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/tr.win.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/zh-hans.darwin.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/zh-hans.darwin.js +1 -0
- package/vscode/src/vs/workbench/services/keybinding/common/keybindingIO.d.ts +21 -0
- package/vscode/src/vs/workbench/services/keybinding/common/keybindingIO.js +2 -1
- package/vscode/src/vs/workbench/services/keybinding/common/keymapInfo.d.ts +35 -0
- package/vscode/src/vs/workbench/services/keybinding/common/keymapInfo.js +2 -1
- package/vscode/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.d.ts +43 -0
- package/vscode/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.js +176 -178
- package/vscode/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.d.ts +49 -0
- package/vscode/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.js +71 -68
- package/keybindings.js +0 -108
package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { localize } from 'vscode/vscode/vs/nls';
|
|
3
4
|
import { RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
|
|
4
5
|
import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
|
|
@@ -6,24 +7,24 @@ import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/life
|
|
|
6
7
|
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
7
8
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
9
|
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
9
|
-
import { registerEditorContribution } from 'vscode/vscode/vs/editor/browser/editorExtensions';
|
|
10
|
+
import { registerEditorContribution, EditorContributionInstantiation } from 'vscode/vscode/vs/editor/browser/editorExtensions';
|
|
10
11
|
import { SnippetController2 } from 'vscode/vscode/vs/editor/contrib/snippet/browser/snippetController2';
|
|
11
12
|
import { SmartSnippetInserter } from '../common/smartSnippetInserter.js';
|
|
12
|
-
import { DefineKeybindingOverlayWidget } from 'vscode/vscode/vs/workbench/contrib/preferences/browser/keybindingWidgets';
|
|
13
|
+
import { DefineKeybindingOverlayWidget } from '@codingame/monaco-vscode-d609a7d3-bf87-551a-884f-550a8b327ec5-common/vscode/vs/workbench/contrib/preferences/browser/keybindingWidgets';
|
|
13
14
|
import { parseTree } from 'vscode/vscode/vs/base/common/json';
|
|
14
15
|
import { WindowsNativeResolvedKeybinding } from '../../../services/keybinding/common/windowsKeyboardMapper.js';
|
|
15
16
|
import { themeColorFromId } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
16
17
|
import { overviewRulerError, overviewRulerInfo } from 'vscode/vscode/vs/editor/common/core/editorColorRegistry';
|
|
17
|
-
import { OverviewRulerLane } from 'vscode/vscode/vs/editor/common/model';
|
|
18
|
-
import { KeybindingParser } from 'vscode/vscode/vs/base/common/keybindingParser';
|
|
18
|
+
import { TrackedRangeStickiness, OverviewRulerLane } from 'vscode/vscode/vs/editor/common/model';
|
|
19
|
+
import { KeybindingParser } from '@codingame/monaco-vscode-2a22c7b4-b906-5914-8cd1-3ed912fb738f-common/vscode/vs/base/common/keybindingParser';
|
|
19
20
|
import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
|
|
20
21
|
import { isEqual } from 'vscode/vscode/vs/base/common/resources';
|
|
21
22
|
import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
22
|
-
import { DEFINE_KEYBINDING_EDITOR_CONTRIB_ID } from 'vscode/vscode/vs/workbench/services/preferences/common/preferences';
|
|
23
|
+
import { DEFINE_KEYBINDING_EDITOR_CONTRIB_ID } from '@codingame/monaco-vscode-4a36e358-d94d-55e0-86ee-3bcd543d9d3f-common/vscode/vs/workbench/services/preferences/common/preferences';
|
|
23
24
|
|
|
24
25
|
var KeybindingEditorDecorationsRenderer_1;
|
|
25
26
|
const NLS_KB_LAYOUT_ERROR_MESSAGE = ( localize(
|
|
26
|
-
|
|
27
|
+
7912,
|
|
27
28
|
"You won't be able to produce this key combination under your current keyboard layout."
|
|
28
29
|
));
|
|
29
30
|
let DefineKeybindingEditorContribution = class DefineKeybindingEditorContribution extends Disposable {
|
|
@@ -32,7 +33,7 @@ let DefineKeybindingEditorContribution = class DefineKeybindingEditorContributio
|
|
|
32
33
|
this._editor = _editor;
|
|
33
34
|
this._instantiationService = _instantiationService;
|
|
34
35
|
this._userDataProfileService = _userDataProfileService;
|
|
35
|
-
this._keybindingDecorationRenderer = this._register((
|
|
36
|
+
this._keybindingDecorationRenderer = this._register(( new MutableDisposable()));
|
|
36
37
|
this._defineWidget = this._register(this._instantiationService.createInstance(DefineKeybindingOverlayWidget, this._editor));
|
|
37
38
|
this._register(this._editor.onDidChangeModel(e => this._update()));
|
|
38
39
|
this._update();
|
|
@@ -50,7 +51,7 @@ let DefineKeybindingEditorContribution = class DefineKeybindingEditorContributio
|
|
|
50
51
|
_onAccepted(keybinding) {
|
|
51
52
|
this._editor.focus();
|
|
52
53
|
if (keybinding && this._editor.hasModel()) {
|
|
53
|
-
const regexp = (
|
|
54
|
+
const regexp = ( new RegExp(/\\/g));
|
|
54
55
|
const backslash = regexp.test(keybinding);
|
|
55
56
|
if (backslash) {
|
|
56
57
|
keybinding = keybinding.slice(0, -1) + '\\\\';
|
|
@@ -69,17 +70,17 @@ let DefineKeybindingEditorContribution = class DefineKeybindingEditorContributio
|
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
};
|
|
72
|
-
DefineKeybindingEditorContribution = (
|
|
73
|
-
(
|
|
74
|
-
(
|
|
75
|
-
], DefineKeybindingEditorContribution))
|
|
73
|
+
DefineKeybindingEditorContribution = ( __decorate([
|
|
74
|
+
( __param(1, IInstantiationService)),
|
|
75
|
+
( __param(2, IUserDataProfileService))
|
|
76
|
+
], DefineKeybindingEditorContribution));
|
|
76
77
|
let KeybindingEditorDecorationsRenderer = KeybindingEditorDecorationsRenderer_1 = class KeybindingEditorDecorationsRenderer extends Disposable {
|
|
77
78
|
constructor(_editor, _keybindingService) {
|
|
78
79
|
super();
|
|
79
80
|
this._editor = _editor;
|
|
80
81
|
this._keybindingService = _keybindingService;
|
|
81
82
|
this._dec = this._editor.createDecorationsCollection();
|
|
82
|
-
this._updateDecorations = this._register((
|
|
83
|
+
this._updateDecorations = this._register(( new RunOnceScheduler(() => this._updateDecorationsNow(), 500)));
|
|
83
84
|
const model = assertIsDefined(this._editor.getModel());
|
|
84
85
|
this._register(model.onDidChangeContent(() => this._updateDecorations.schedule()));
|
|
85
86
|
this._register(this._keybindingService.onDidUpdateKeybindings(() => this._updateDecorations.schedule()));
|
|
@@ -174,38 +175,38 @@ let KeybindingEditorDecorationsRenderer = KeybindingEditorDecorationsRenderer_1
|
|
|
174
175
|
let className;
|
|
175
176
|
let overviewRulerColor;
|
|
176
177
|
if (isError) {
|
|
177
|
-
msg = (
|
|
178
|
+
msg = ( new MarkdownString()).appendText(NLS_KB_LAYOUT_ERROR_MESSAGE);
|
|
178
179
|
className = 'keybindingError';
|
|
179
180
|
overviewRulerColor = themeColorFromId(overviewRulerError);
|
|
180
181
|
}
|
|
181
182
|
else {
|
|
182
183
|
if (usLabel && uiLabel !== usLabel) {
|
|
183
|
-
msg = (
|
|
184
|
-
|
|
184
|
+
msg = ( new MarkdownString(( localize(
|
|
185
|
+
7913,
|
|
185
186
|
"**{0}** for your current keyboard layout (**{1}** for US standard).",
|
|
186
187
|
uiLabel,
|
|
187
188
|
usLabel
|
|
188
|
-
))))
|
|
189
|
+
))));
|
|
189
190
|
}
|
|
190
191
|
else {
|
|
191
|
-
msg = (
|
|
192
|
+
msg = ( new MarkdownString(( localize(7914, "**{0}** for your current keyboard layout.", uiLabel))));
|
|
192
193
|
}
|
|
193
194
|
className = 'keybindingInfo';
|
|
194
195
|
overviewRulerColor = themeColorFromId(overviewRulerInfo);
|
|
195
196
|
}
|
|
196
197
|
const startPosition = model.getPositionAt(keyNode.offset);
|
|
197
198
|
const endPosition = model.getPositionAt(keyNode.offset + keyNode.length);
|
|
198
|
-
const range = (
|
|
199
|
+
const range = ( new Range(
|
|
199
200
|
startPosition.lineNumber,
|
|
200
201
|
startPosition.column,
|
|
201
202
|
endPosition.lineNumber,
|
|
202
203
|
endPosition.column
|
|
203
|
-
))
|
|
204
|
+
));
|
|
204
205
|
return {
|
|
205
206
|
range: range,
|
|
206
207
|
options: {
|
|
207
208
|
description: 'keybindings-widget',
|
|
208
|
-
stickiness:
|
|
209
|
+
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
|
209
210
|
className: className,
|
|
210
211
|
hoverMessage: msg,
|
|
211
212
|
overviewRuler: {
|
|
@@ -216,9 +217,9 @@ let KeybindingEditorDecorationsRenderer = KeybindingEditorDecorationsRenderer_1
|
|
|
216
217
|
};
|
|
217
218
|
}
|
|
218
219
|
};
|
|
219
|
-
KeybindingEditorDecorationsRenderer = KeybindingEditorDecorationsRenderer_1 = (
|
|
220
|
-
(
|
|
221
|
-
], KeybindingEditorDecorationsRenderer))
|
|
220
|
+
KeybindingEditorDecorationsRenderer = KeybindingEditorDecorationsRenderer_1 = ( __decorate([
|
|
221
|
+
( __param(1, IKeybindingService))
|
|
222
|
+
], KeybindingEditorDecorationsRenderer));
|
|
222
223
|
function isInterestingEditorModel(editor, userDataProfileService) {
|
|
223
224
|
const model = editor.getModel();
|
|
224
225
|
if (!model) {
|
|
@@ -226,6 +227,6 @@ function isInterestingEditorModel(editor, userDataProfileService) {
|
|
|
226
227
|
}
|
|
227
228
|
return isEqual(model.uri, userDataProfileService.currentProfile.keybindingsResource);
|
|
228
229
|
}
|
|
229
|
-
registerEditorContribution(DEFINE_KEYBINDING_EDITOR_CONTRIB_ID, DefineKeybindingEditorContribution,
|
|
230
|
+
registerEditorContribution(DEFINE_KEYBINDING_EDITOR_CONTRIB_ID, DefineKeybindingEditorContribution, EditorContributionInstantiation.AfterFirstRender);
|
|
230
231
|
|
|
231
232
|
export { KeybindingEditorDecorationsRenderer };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Position } from "vscode/vscode/vs/editor/common/core/position";
|
|
2
|
+
import { ITextModel } from "vscode/vscode/vs/editor/common/model";
|
|
3
|
+
export interface InsertSnippetResult {
|
|
4
|
+
position: Position;
|
|
5
|
+
prepend: string;
|
|
6
|
+
append: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class SmartSnippetInserter {
|
|
9
|
+
private static hasOpenBrace;
|
|
10
|
+
private static offsetToPosition;
|
|
11
|
+
static insertSnippet(model: ITextModel, _position: Position): InsertSnippetResult;
|
|
12
|
+
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { SyntaxKind, createScanner } from 'vscode/vscode/vs/base/common/json';
|
|
2
3
|
import { Position } from 'vscode/vscode/vs/editor/common/core/position';
|
|
3
4
|
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
4
5
|
|
|
5
6
|
class SmartSnippetInserter {
|
|
6
7
|
static hasOpenBrace(scanner) {
|
|
7
|
-
while (scanner.scan() !==
|
|
8
|
+
while (scanner.scan() !== SyntaxKind.EOF) {
|
|
8
9
|
const kind = scanner.getToken();
|
|
9
|
-
if (kind ===
|
|
10
|
+
if (kind === SyntaxKind.OpenBraceToken) {
|
|
10
11
|
return true;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
@@ -29,11 +30,11 @@ class SmartSnippetInserter {
|
|
|
29
30
|
static insertSnippet(model, _position) {
|
|
30
31
|
const desiredPosition = model.getValueLengthInRange(( new Range(1, 1, _position.lineNumber, _position.column)));
|
|
31
32
|
let State;
|
|
32
|
-
( (
|
|
33
|
+
(function (State) {
|
|
33
34
|
State[State["INVALID"] = 0] = "INVALID";
|
|
34
35
|
State[State["AFTER_OBJECT"] = 1] = "AFTER_OBJECT";
|
|
35
36
|
State[State["BEFORE_OBJECT"] = 2] = "BEFORE_OBJECT";
|
|
36
|
-
})(State || (State = {}))
|
|
37
|
+
})(State || (State = {}));
|
|
37
38
|
let currentState = State.INVALID;
|
|
38
39
|
let lastValidPos = -1;
|
|
39
40
|
let lastValidState = State.INVALID;
|
|
@@ -53,37 +54,37 @@ class SmartSnippetInserter {
|
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
};
|
|
56
|
-
while (scanner.scan() !==
|
|
57
|
+
while (scanner.scan() !== SyntaxKind.EOF) {
|
|
57
58
|
const currentPos = scanner.getPosition();
|
|
58
59
|
const kind = scanner.getToken();
|
|
59
60
|
let goodKind = false;
|
|
60
61
|
switch (kind) {
|
|
61
|
-
case
|
|
62
|
+
case SyntaxKind.OpenBracketToken:
|
|
62
63
|
goodKind = true;
|
|
63
64
|
arrayLevel++;
|
|
64
65
|
checkRangeStatus(currentPos, State.BEFORE_OBJECT);
|
|
65
66
|
break;
|
|
66
|
-
case
|
|
67
|
+
case SyntaxKind.CloseBracketToken:
|
|
67
68
|
goodKind = true;
|
|
68
69
|
arrayLevel--;
|
|
69
70
|
checkRangeStatus(currentPos, State.INVALID);
|
|
70
71
|
break;
|
|
71
|
-
case
|
|
72
|
+
case SyntaxKind.CommaToken:
|
|
72
73
|
goodKind = true;
|
|
73
74
|
checkRangeStatus(currentPos, State.BEFORE_OBJECT);
|
|
74
75
|
break;
|
|
75
|
-
case
|
|
76
|
+
case SyntaxKind.OpenBraceToken:
|
|
76
77
|
goodKind = true;
|
|
77
78
|
objLevel++;
|
|
78
79
|
checkRangeStatus(currentPos, State.INVALID);
|
|
79
80
|
break;
|
|
80
|
-
case
|
|
81
|
+
case SyntaxKind.CloseBraceToken:
|
|
81
82
|
goodKind = true;
|
|
82
83
|
objLevel--;
|
|
83
84
|
checkRangeStatus(currentPos, State.AFTER_OBJECT);
|
|
84
85
|
break;
|
|
85
|
-
case
|
|
86
|
-
case
|
|
86
|
+
case SyntaxKind.Trivia:
|
|
87
|
+
case SyntaxKind.LineBreakTrivia:
|
|
87
88
|
goodKind = true;
|
|
88
89
|
}
|
|
89
90
|
if (currentPos >= desiredPosition && (currentState !== State.INVALID || lastValidPos !== -1)) {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IJSONSchema } from "vscode/vscode/vs/base/common/jsonSchema";
|
|
2
|
+
import { ExtensionMessageCollector } from "vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry";
|
|
3
|
+
import { ILocalizedString } from "vscode/vscode/vs/platform/action/common/action";
|
|
4
|
+
declare namespace schema {
|
|
5
|
+
interface IUserFriendlyMenuItem {
|
|
6
|
+
command: string;
|
|
7
|
+
alt?: string;
|
|
8
|
+
when?: string;
|
|
9
|
+
group?: string;
|
|
10
|
+
}
|
|
11
|
+
interface IUserFriendlySubmenuItem {
|
|
12
|
+
submenu: string;
|
|
13
|
+
when?: string;
|
|
14
|
+
group?: string;
|
|
15
|
+
}
|
|
16
|
+
interface IUserFriendlySubmenu {
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
icon?: IUserFriendlyIcon;
|
|
20
|
+
}
|
|
21
|
+
function isMenuItem(item: IUserFriendlyMenuItem | IUserFriendlySubmenuItem): item is IUserFriendlyMenuItem;
|
|
22
|
+
function isValidMenuItem(item: IUserFriendlyMenuItem, collector: ExtensionMessageCollector): boolean;
|
|
23
|
+
function isValidSubmenuItem(item: IUserFriendlySubmenuItem, collector: ExtensionMessageCollector): boolean;
|
|
24
|
+
function isValidItems(items: (IUserFriendlyMenuItem | IUserFriendlySubmenuItem)[], collector: ExtensionMessageCollector): boolean;
|
|
25
|
+
function isValidSubmenu(submenu: IUserFriendlySubmenu, collector: ExtensionMessageCollector): boolean;
|
|
26
|
+
const menusContribution: IJSONSchema;
|
|
27
|
+
const submenusContribution: IJSONSchema;
|
|
28
|
+
interface IUserFriendlyCommand {
|
|
29
|
+
command: string;
|
|
30
|
+
title: string | ILocalizedString;
|
|
31
|
+
shortTitle?: string | ILocalizedString;
|
|
32
|
+
enablement?: string;
|
|
33
|
+
category?: string | ILocalizedString;
|
|
34
|
+
icon?: IUserFriendlyIcon;
|
|
35
|
+
}
|
|
36
|
+
type IUserFriendlyIcon = string | {
|
|
37
|
+
light: string;
|
|
38
|
+
dark: string;
|
|
39
|
+
};
|
|
40
|
+
function isValidCommand(command: IUserFriendlyCommand, collector: ExtensionMessageCollector): boolean;
|
|
41
|
+
const commandsContribution: IJSONSchema;
|
|
42
|
+
}
|
|
43
|
+
export declare const commandsExtensionPoint: import("vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry").IExtensionPoint<schema.IUserFriendlyCommand | schema.IUserFriendlyCommand[]>;
|
|
44
|
+
export {};
|