@codingame/monaco-vscode-keybindings-service-override 9.0.3 → 10.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/keybindings.js +8 -2
- package/package.json +3 -3
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardConfig.js +11 -16
- package/vscode/src/vs/workbench/browser/contextkeys.js +16 -16
- package/vscode/src/vs/workbench/contrib/commands/common/commands.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/preferences/common/smartSnippetInserter.js +11 -11
- package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +134 -188
- package/vscode/src/vs/workbench/services/commands/common/commandService.js +0 -1
- package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +73 -75
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.js +6 -7
- package/vscode/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.js +178 -175
- package/vscode/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.js +68 -70
package/keybindings.js
CHANGED
|
@@ -30,7 +30,10 @@ import './vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorC
|
|
|
30
30
|
import './vscode/src/vs/workbench/contrib/commands/common/commands.contribution.js';
|
|
31
31
|
import { getService } from 'vscode/services';
|
|
32
32
|
|
|
33
|
-
const defaultUserKeybindindsFile = ( URI.from({
|
|
33
|
+
const defaultUserKeybindindsFile = ( URI.from({
|
|
34
|
+
scheme: Schemas.vscodeUserData,
|
|
35
|
+
path: '/User/keybindings.json'
|
|
36
|
+
}));
|
|
34
37
|
async function initUserKeybindings(configurationJson, options, file = defaultUserKeybindindsFile) {
|
|
35
38
|
await initFile(file, configurationJson, options);
|
|
36
39
|
}
|
|
@@ -71,7 +74,10 @@ let DynamicWorkbenchKeybindingService = class DynamicWorkbenchKeybindingService
|
|
|
71
74
|
return super._dispatch(e, target);
|
|
72
75
|
}
|
|
73
76
|
getUserKeybindingItems() {
|
|
74
|
-
return [
|
|
77
|
+
return [
|
|
78
|
+
...super.getUserKeybindingItems(),
|
|
79
|
+
...this.keybindingProviders.flatMap((provider) => provider.provideKeybindings())
|
|
80
|
+
];
|
|
75
81
|
}
|
|
76
82
|
};
|
|
77
83
|
DynamicWorkbenchKeybindingService = __decorate([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-keybindings-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
30
|
-
"@codingame/monaco-vscode-files-service-override": "
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@10.0.0",
|
|
30
|
+
"@codingame/monaco-vscode-files-service-override": "10.0.0"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import { localize } from 'vscode/vscode/vs/nls';
|
|
2
|
-
import { OS
|
|
3
|
-
import { Extensions
|
|
2
|
+
import { OS } from 'vscode/vscode/vs/base/common/platform';
|
|
3
|
+
import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
4
4
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
5
5
|
|
|
6
|
-
var DispatchConfig;
|
|
7
|
-
( ((function(DispatchConfig) {
|
|
8
|
-
DispatchConfig[DispatchConfig["Code"] = 0] = "Code";
|
|
9
|
-
DispatchConfig[DispatchConfig["KeyCode"] = 1] = "KeyCode";
|
|
10
|
-
})(DispatchConfig || (DispatchConfig = {}))));
|
|
11
6
|
function readKeyboardConfig(configurationService) {
|
|
12
7
|
const keyboard = configurationService.getValue('keyboard');
|
|
13
|
-
const dispatch = (keyboard?.dispatch === 'keyCode' ?
|
|
8
|
+
const dispatch = ((keyboard?.dispatch === 'keyCode' ? 1 : 0) );
|
|
14
9
|
const mapAltGrToCtrlAlt = Boolean(keyboard?.mapAltGrToCtrlAlt);
|
|
15
10
|
return { dispatch, mapAltGrToCtrlAlt };
|
|
16
11
|
}
|
|
@@ -19,28 +14,28 @@ const keyboardConfiguration = {
|
|
|
19
14
|
'id': 'keyboard',
|
|
20
15
|
'order': 15,
|
|
21
16
|
'type': 'object',
|
|
22
|
-
'title': ( localize(
|
|
17
|
+
'title': ( localize(8782, "Keyboard")),
|
|
23
18
|
'properties': {
|
|
24
19
|
'keyboard.dispatch': {
|
|
25
|
-
scope:
|
|
20
|
+
scope: 1 ,
|
|
26
21
|
type: 'string',
|
|
27
22
|
enum: ['code', 'keyCode'],
|
|
28
23
|
default: 'code',
|
|
29
24
|
markdownDescription: ( localize(
|
|
30
|
-
|
|
25
|
+
8783,
|
|
31
26
|
"Controls the dispatching logic for key presses to use either `code` (recommended) or `keyCode`."
|
|
32
27
|
)),
|
|
33
|
-
included: OS ===
|
|
28
|
+
included: OS === 2 || OS === 3
|
|
34
29
|
},
|
|
35
30
|
'keyboard.mapAltGrToCtrlAlt': {
|
|
36
|
-
scope:
|
|
31
|
+
scope: 1 ,
|
|
37
32
|
type: 'boolean',
|
|
38
33
|
default: false,
|
|
39
|
-
markdownDescription: ( localize(
|
|
40
|
-
included: OS ===
|
|
34
|
+
markdownDescription: ( localize(8784, "Controls if the AltGraph+ modifier should be treated as Ctrl+Alt+.")),
|
|
35
|
+
included: OS === 1
|
|
41
36
|
}
|
|
42
37
|
}
|
|
43
38
|
};
|
|
44
39
|
configurationRegistry.registerConfiguration(keyboardConfiguration);
|
|
45
40
|
|
|
46
|
-
export {
|
|
41
|
+
export { readKeyboardConfig };
|
|
@@ -5,14 +5,14 @@ import { setConstant } from 'vscode/vscode/vs/platform/contextkey/common/context
|
|
|
5
5
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
6
6
|
import { IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsIOSContext, IsMobileContext, IsDevelopmentContext, ProductQualityContext, InputFocusedContext } from 'vscode/vscode/vs/platform/contextkey/common/contextkeys';
|
|
7
7
|
import { RemoteNameContext, VirtualWorkspaceContext, TemporaryWorkspaceContext, HasWebFileSystemAccess, EmbedderIdentifierContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, DirtyWorkingCopiesContext, WorkbenchStateContext, WorkspaceFolderCountContext, OpenFolderWorkspaceSupportContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, SplitEditorsVertically, IsMainWindowFullscreenContext, IsAuxiliaryWindowFocusedContext, InEditorZenModeContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, EditorTabsVisibleContext, SideBarVisibleContext, TitleBarVisibleContext, TitleBarStyleContext, PanelPositionContext, PanelVisibleContext, PanelMaximizedContext, PanelAlignmentContext, AuxiliaryBarVisibleContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
8
|
-
import { onDidRegisterWindow, addDisposableListener, EventType, trackFocus, getActiveWindow } from 'vscode/vscode/vs/base/browser/dom';
|
|
9
|
-
import { preferredSideBySideGroupDirection
|
|
8
|
+
import { onDidRegisterWindow, addDisposableListener, EventType, isEditableElement, trackFocus, getActiveWindow } from 'vscode/vscode/vs/base/browser/dom';
|
|
9
|
+
import { preferredSideBySideGroupDirection } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
10
10
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
11
11
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
12
12
|
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
13
|
-
import {
|
|
13
|
+
import { isTemporaryWorkspace } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
14
14
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
15
|
-
import { positionToString
|
|
15
|
+
import { positionToString } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
16
16
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
17
17
|
import { getRemoteName } from 'vscode/vscode/vs/platform/remote/common/remoteHosts';
|
|
18
18
|
import { getVirtualWorkspaceScheme } from 'vscode/vscode/vs/platform/workspace/common/virtualWorkspace';
|
|
@@ -90,13 +90,13 @@ let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disp
|
|
|
90
90
|
this.panelPositionContext = PanelPositionContext.bindTo(this.contextKeyService);
|
|
91
91
|
this.panelPositionContext.set(positionToString(this.layoutService.getPanelPosition()));
|
|
92
92
|
this.panelVisibleContext = PanelVisibleContext.bindTo(this.contextKeyService);
|
|
93
|
-
this.panelVisibleContext.set(this.layoutService.isVisible(
|
|
93
|
+
this.panelVisibleContext.set(this.layoutService.isVisible("workbench.parts.panel" ));
|
|
94
94
|
this.panelMaximizedContext = PanelMaximizedContext.bindTo(this.contextKeyService);
|
|
95
95
|
this.panelMaximizedContext.set(this.layoutService.isPanelMaximized());
|
|
96
96
|
this.panelAlignmentContext = PanelAlignmentContext.bindTo(this.contextKeyService);
|
|
97
97
|
this.panelAlignmentContext.set(this.layoutService.getPanelAlignment());
|
|
98
98
|
this.auxiliaryBarVisibleContext = AuxiliaryBarVisibleContext.bindTo(this.contextKeyService);
|
|
99
|
-
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(
|
|
99
|
+
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible("workbench.parts.auxiliarybar" ));
|
|
100
100
|
this.registerListeners();
|
|
101
101
|
}
|
|
102
102
|
registerListeners() {
|
|
@@ -136,10 +136,10 @@ let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disp
|
|
|
136
136
|
this._register(this.paneCompositeService.onDidPaneCompositeClose(() => this.updateSideBarContextKeys()));
|
|
137
137
|
this._register(this.paneCompositeService.onDidPaneCompositeOpen(() => this.updateSideBarContextKeys()));
|
|
138
138
|
this._register(this.layoutService.onDidChangePartVisibility(() => {
|
|
139
|
-
this.mainEditorAreaVisibleContext.set(this.layoutService.isVisible(
|
|
140
|
-
this.panelVisibleContext.set(this.layoutService.isVisible(
|
|
139
|
+
this.mainEditorAreaVisibleContext.set(this.layoutService.isVisible("workbench.parts.editor" , mainWindow));
|
|
140
|
+
this.panelVisibleContext.set(this.layoutService.isVisible("workbench.parts.panel" ));
|
|
141
141
|
this.panelMaximizedContext.set(this.layoutService.isPanelMaximized());
|
|
142
|
-
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(
|
|
142
|
+
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible("workbench.parts.auxiliarybar" ));
|
|
143
143
|
this.updateTitleBarContextKeys();
|
|
144
144
|
}));
|
|
145
145
|
this._register(this.workingCopyService.onDidChangeDirty(workingCopy => this.dirtyWorkingCopiesContext.set(workingCopy.isDirty() || this.workingCopyService.hasDirty)));
|
|
@@ -181,7 +181,7 @@ let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disp
|
|
|
181
181
|
}
|
|
182
182
|
updateInputContextKeys(ownerDocument) {
|
|
183
183
|
function activeElementIsInput() {
|
|
184
|
-
return !!ownerDocument.activeElement && (ownerDocument.activeElement
|
|
184
|
+
return !!ownerDocument.activeElement && isEditableElement(ownerDocument.activeElement);
|
|
185
185
|
}
|
|
186
186
|
const isInputFocused = activeElementIsInput();
|
|
187
187
|
this.inputFocusedContext.set(isInputFocused);
|
|
@@ -203,20 +203,20 @@ let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disp
|
|
|
203
203
|
}
|
|
204
204
|
updateSplitEditorsVerticallyContext() {
|
|
205
205
|
const direction = preferredSideBySideGroupDirection(this.configurationService);
|
|
206
|
-
this.splitEditorsVerticallyContext.set(direction ===
|
|
206
|
+
this.splitEditorsVerticallyContext.set(direction === 1 );
|
|
207
207
|
}
|
|
208
208
|
getWorkbenchStateString() {
|
|
209
209
|
switch (this.contextService.getWorkbenchState()) {
|
|
210
|
-
case
|
|
211
|
-
case
|
|
212
|
-
case
|
|
210
|
+
case 1 : return 'empty';
|
|
211
|
+
case 2 : return 'folder';
|
|
212
|
+
case 3 : return 'workspace';
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
updateSideBarContextKeys() {
|
|
216
|
-
this.sideBarVisibleContext.set(this.layoutService.isVisible(
|
|
216
|
+
this.sideBarVisibleContext.set(this.layoutService.isVisible("workbench.parts.sidebar" ));
|
|
217
217
|
}
|
|
218
218
|
updateTitleBarContextKeys() {
|
|
219
|
-
this.titleAreaVisibleContext.set(this.layoutService.isVisible(
|
|
219
|
+
this.titleAreaVisibleContext.set(this.layoutService.isVisible("workbench.parts.titlebar" , mainWindow));
|
|
220
220
|
this.titleBarStyleContext.set(getTitleBarStyle(this.configurationService));
|
|
221
221
|
}
|
|
222
222
|
updateWorkspaceContextKeys() {
|
|
@@ -9,10 +9,10 @@ class RunCommands extends Action2 {
|
|
|
9
9
|
constructor() {
|
|
10
10
|
super({
|
|
11
11
|
id: 'runCommands',
|
|
12
|
-
title: ( localize2(
|
|
12
|
+
title: ( localize2(3563, "Run Commands")),
|
|
13
13
|
f1: false,
|
|
14
14
|
metadata: {
|
|
15
|
-
description: ( localize(
|
|
15
|
+
description: ( localize(3564, "Run several commands")),
|
|
16
16
|
args: [
|
|
17
17
|
{
|
|
18
18
|
name: 'args',
|
|
@@ -22,7 +22,7 @@ class RunCommands extends Action2 {
|
|
|
22
22
|
properties: {
|
|
23
23
|
commands: {
|
|
24
24
|
type: 'array',
|
|
25
|
-
description: ( localize(
|
|
25
|
+
description: ( localize(3565, "Commands to run")),
|
|
26
26
|
items: {
|
|
27
27
|
anyOf: [
|
|
28
28
|
{
|
|
@@ -62,14 +62,14 @@ class RunCommands extends Action2 {
|
|
|
62
62
|
const notificationService = accessor.get(INotificationService);
|
|
63
63
|
if (!this._isCommandArgs(args)) {
|
|
64
64
|
notificationService.error(( localize(
|
|
65
|
-
|
|
65
|
+
3566,
|
|
66
66
|
"'runCommands' has received an argument with incorrect type. Please, review the argument passed to the command."
|
|
67
67
|
)));
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
70
|
if (args.commands.length === 0) {
|
|
71
71
|
notificationService.warn(( localize(
|
|
72
|
-
|
|
72
|
+
3567,
|
|
73
73
|
"'runCommands' has not received commands to run. Did you forget to pass commands in the 'runCommands' argument?"
|
|
74
74
|
)));
|
|
75
75
|
return;
|
|
@@ -9,7 +9,7 @@ class ToggleKeybindingsLogAction extends Action2 {
|
|
|
9
9
|
constructor() {
|
|
10
10
|
super({
|
|
11
11
|
id: 'workbench.action.toggleKeybindingsLog',
|
|
12
|
-
title: ( localize2(
|
|
12
|
+
title: ( localize2(3559, "Toggle Keyboard Shortcuts Troubleshooting")),
|
|
13
13
|
category: Categories.Developer,
|
|
14
14
|
f1: true
|
|
15
15
|
});
|
package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/life
|
|
|
6
6
|
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
7
7
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
8
|
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
9
|
-
import { registerEditorContribution
|
|
9
|
+
import { registerEditorContribution } from 'vscode/vscode/vs/editor/browser/editorExtensions';
|
|
10
10
|
import { SnippetController2 } from 'vscode/vscode/vs/editor/contrib/snippet/browser/snippetController2';
|
|
11
11
|
import { SmartSnippetInserter } from '../common/smartSnippetInserter.js';
|
|
12
12
|
import { DefineKeybindingOverlayWidget } from 'vscode/vscode/vs/workbench/contrib/preferences/browser/keybindingWidgets';
|
|
@@ -14,7 +14,7 @@ import { parseTree } from 'vscode/vscode/vs/base/common/json';
|
|
|
14
14
|
import { WindowsNativeResolvedKeybinding } from '../../../services/keybinding/common/windowsKeyboardMapper.js';
|
|
15
15
|
import { themeColorFromId } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
16
16
|
import { overviewRulerError, overviewRulerInfo } from 'vscode/vscode/vs/editor/common/core/editorColorRegistry';
|
|
17
|
-
import {
|
|
17
|
+
import { OverviewRulerLane } from 'vscode/vscode/vs/editor/common/model';
|
|
18
18
|
import { KeybindingParser } from 'vscode/vscode/vs/base/common/keybindingParser';
|
|
19
19
|
import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
|
|
20
20
|
import { isEqual } from 'vscode/vscode/vs/base/common/resources';
|
|
@@ -23,7 +23,7 @@ import { DEFINE_KEYBINDING_EDITOR_CONTRIB_ID } from 'vscode/vscode/vs/workbench/
|
|
|
23
23
|
|
|
24
24
|
var KeybindingEditorDecorationsRenderer_1;
|
|
25
25
|
const NLS_KB_LAYOUT_ERROR_MESSAGE = ( localize(
|
|
26
|
-
|
|
26
|
+
3560,
|
|
27
27
|
"You won't be able to produce this key combination under your current keyboard layout."
|
|
28
28
|
));
|
|
29
29
|
let DefineKeybindingEditorContribution = class DefineKeybindingEditorContribution extends Disposable {
|
|
@@ -181,14 +181,14 @@ let KeybindingEditorDecorationsRenderer = KeybindingEditorDecorationsRenderer_1
|
|
|
181
181
|
else {
|
|
182
182
|
if (usLabel && uiLabel !== usLabel) {
|
|
183
183
|
msg = ( (new MarkdownString(( localize(
|
|
184
|
-
|
|
184
|
+
3561,
|
|
185
185
|
"**{0}** for your current keyboard layout (**{1}** for US standard).",
|
|
186
186
|
uiLabel,
|
|
187
187
|
usLabel
|
|
188
188
|
)))));
|
|
189
189
|
}
|
|
190
190
|
else {
|
|
191
|
-
msg = ( (new MarkdownString(( localize(
|
|
191
|
+
msg = ( (new MarkdownString(( localize(3562, "**{0}** for your current keyboard layout.", uiLabel)))));
|
|
192
192
|
}
|
|
193
193
|
className = 'keybindingInfo';
|
|
194
194
|
overviewRulerColor = themeColorFromId(overviewRulerInfo);
|
|
@@ -205,7 +205,7 @@ let KeybindingEditorDecorationsRenderer = KeybindingEditorDecorationsRenderer_1
|
|
|
205
205
|
range: range,
|
|
206
206
|
options: {
|
|
207
207
|
description: 'keybindings-widget',
|
|
208
|
-
stickiness:
|
|
208
|
+
stickiness: 1 ,
|
|
209
209
|
className: className,
|
|
210
210
|
hoverMessage: msg,
|
|
211
211
|
overviewRuler: {
|
|
@@ -226,6 +226,6 @@ function isInterestingEditorModel(editor, userDataProfileService) {
|
|
|
226
226
|
}
|
|
227
227
|
return isEqual(model.uri, userDataProfileService.currentProfile.keybindingsResource);
|
|
228
228
|
}
|
|
229
|
-
registerEditorContribution(DEFINE_KEYBINDING_EDITOR_CONTRIB_ID, DefineKeybindingEditorContribution,
|
|
229
|
+
registerEditorContribution(DEFINE_KEYBINDING_EDITOR_CONTRIB_ID, DefineKeybindingEditorContribution, 1 );
|
|
230
230
|
|
|
231
231
|
export { KeybindingEditorDecorationsRenderer };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createScanner } from 'vscode/vscode/vs/base/common/json';
|
|
2
2
|
import { Position } from 'vscode/vscode/vs/editor/common/core/position';
|
|
3
3
|
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
4
4
|
|
|
5
5
|
class SmartSnippetInserter {
|
|
6
6
|
static hasOpenBrace(scanner) {
|
|
7
|
-
while (scanner.scan() !==
|
|
7
|
+
while (scanner.scan() !== 17 ) {
|
|
8
8
|
const kind = scanner.getToken();
|
|
9
|
-
if (kind ===
|
|
9
|
+
if (kind === 1 ) {
|
|
10
10
|
return true;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -53,37 +53,37 @@ class SmartSnippetInserter {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
while (scanner.scan() !==
|
|
56
|
+
while (scanner.scan() !== 17 ) {
|
|
57
57
|
const currentPos = scanner.getPosition();
|
|
58
58
|
const kind = scanner.getToken();
|
|
59
59
|
let goodKind = false;
|
|
60
60
|
switch (kind) {
|
|
61
|
-
case
|
|
61
|
+
case 3 :
|
|
62
62
|
goodKind = true;
|
|
63
63
|
arrayLevel++;
|
|
64
64
|
checkRangeStatus(currentPos, State.BEFORE_OBJECT);
|
|
65
65
|
break;
|
|
66
|
-
case
|
|
66
|
+
case 4 :
|
|
67
67
|
goodKind = true;
|
|
68
68
|
arrayLevel--;
|
|
69
69
|
checkRangeStatus(currentPos, State.INVALID);
|
|
70
70
|
break;
|
|
71
|
-
case
|
|
71
|
+
case 5 :
|
|
72
72
|
goodKind = true;
|
|
73
73
|
checkRangeStatus(currentPos, State.BEFORE_OBJECT);
|
|
74
74
|
break;
|
|
75
|
-
case
|
|
75
|
+
case 1 :
|
|
76
76
|
goodKind = true;
|
|
77
77
|
objLevel++;
|
|
78
78
|
checkRangeStatus(currentPos, State.INVALID);
|
|
79
79
|
break;
|
|
80
|
-
case
|
|
80
|
+
case 2 :
|
|
81
81
|
goodKind = true;
|
|
82
82
|
objLevel--;
|
|
83
83
|
checkRangeStatus(currentPos, State.AFTER_OBJECT);
|
|
84
84
|
break;
|
|
85
|
-
case
|
|
86
|
-
case
|
|
85
|
+
case 15 :
|
|
86
|
+
case 14 :
|
|
87
87
|
goodKind = true;
|
|
88
88
|
}
|
|
89
89
|
if (currentPos >= desiredPosition && (currentState !== State.INVALID || lastValidPos !== -1)) {
|