@codingame/monaco-vscode-api 1.80.0-next.6 → 1.80.1-next.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/README.md +3 -1
- package/dist/api.js +6 -6
- package/dist/default-extensions/npm/npmBrowserMain.js.map +1 -1
- package/dist/default-extensions/typescript-language-features/tsserver.web.js.map +1 -1
- package/dist/monaco.js +4 -0
- package/dist/service-override/keybindings.js +1 -0
- package/dist/service-override/snippets.js +1 -0
- package/dist/service-override/views.js +1 -0
- package/dist/vscode/vs/platform/audioCues/browser/media/all.mp3.js +17 -17
- package/dist/vscode/vs/workbench/common/theme.js +5 -5
- package/dist/vscode/vs/workbench/contrib/codeActions/browser/codeActions.contribution.js +25 -0
- package/dist/vscode/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +138 -0
- package/dist/vscode/vs/workbench/contrib/codeActions/browser/documentationContribution.js +59 -0
- package/dist/vscode/vs/workbench/contrib/codeActions/common/codeActionsExtensionPoint.js +61 -0
- package/dist/vscode/vs/workbench/contrib/codeActions/common/documentationExtensionPoint.js +58 -0
- package/dist/vscode/vs/workbench/contrib/folding/browser/folding.contribution.js +84 -0
- package/dist/vscode/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js +172 -0
- package/dist/vscode/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js +24 -0
- package/dist/vscode/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +360 -0
- package/dist/vscode/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/list/browser/list.contribution.js +15 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js +20 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/commands/configureSnippets.js +264 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +87 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/commands/insertSnippet.js +126 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/commands/surroundWithSnippet.js +56 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/snippetCodeActionProvider.js +133 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/snippetPicker.js +83 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/snippets.contribution.js +113 -0
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalService.js +3 -2
- package/monaco-editor-treemending.patch +551 -551
- package/package.json +1 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
2
|
+
import { ISnippetsService } from './snippets.js';
|
|
3
|
+
import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
|
|
4
|
+
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
5
|
+
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
6
|
+
import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
7
|
+
async function pickSnippet(accessor, languageIdOrSnippets) {
|
|
8
|
+
const snippetService = accessor.get(ISnippetsService);
|
|
9
|
+
const quickInputService = accessor.get(IQuickInputService);
|
|
10
|
+
let snippets;
|
|
11
|
+
if (Array.isArray(languageIdOrSnippets)) {
|
|
12
|
+
snippets = languageIdOrSnippets;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
snippets = (await snippetService.getSnippets(languageIdOrSnippets, { includeDisabledSnippets: true, includeNoPrefixSnippets: true }));
|
|
16
|
+
}
|
|
17
|
+
snippets.sort((a, b) => a.snippetSource - b.snippetSource);
|
|
18
|
+
const makeSnippetPicks = () => {
|
|
19
|
+
const result = [];
|
|
20
|
+
let prevSnippet;
|
|
21
|
+
for (const snippet of snippets) {
|
|
22
|
+
const pick = {
|
|
23
|
+
label: snippet.prefix || snippet.name,
|
|
24
|
+
detail: snippet.description || snippet.body,
|
|
25
|
+
snippet
|
|
26
|
+
};
|
|
27
|
+
if (!prevSnippet || prevSnippet.snippetSource !== snippet.snippetSource || prevSnippet.source !== snippet.source) {
|
|
28
|
+
let label = '';
|
|
29
|
+
switch (snippet.snippetSource) {
|
|
30
|
+
case 1 :
|
|
31
|
+
label = ( nls.localize('sep.userSnippet', "User Snippets"));
|
|
32
|
+
break;
|
|
33
|
+
case 3 :
|
|
34
|
+
label = snippet.source;
|
|
35
|
+
break;
|
|
36
|
+
case 2 :
|
|
37
|
+
label = ( nls.localize('sep.workspaceSnippet', "Workspace Snippets"));
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
result.push({ type: 'separator', label });
|
|
41
|
+
}
|
|
42
|
+
if (snippet.snippetSource === 3 ) {
|
|
43
|
+
const isEnabled = snippetService.isEnabled(snippet);
|
|
44
|
+
if (isEnabled) {
|
|
45
|
+
pick.buttons = [{
|
|
46
|
+
iconClass: ThemeIcon.asClassName(Codicon.eyeClosed),
|
|
47
|
+
tooltip: ( nls.localize('disableSnippet', 'Hide from IntelliSense'))
|
|
48
|
+
}];
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
pick.description = ( nls.localize('isDisabled', "(hidden from IntelliSense)"));
|
|
52
|
+
pick.buttons = [{
|
|
53
|
+
iconClass: ThemeIcon.asClassName(Codicon.eye),
|
|
54
|
+
tooltip: ( nls.localize('enable.snippet', 'Show in IntelliSense'))
|
|
55
|
+
}];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
result.push(pick);
|
|
59
|
+
prevSnippet = snippet;
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
63
|
+
const picker = quickInputService.createQuickPick();
|
|
64
|
+
picker.placeholder = ( nls.localize('pick.placeholder', "Select a snippet"));
|
|
65
|
+
picker.matchOnDetail = true;
|
|
66
|
+
picker.ignoreFocusOut = false;
|
|
67
|
+
picker.keepScrollPosition = true;
|
|
68
|
+
picker.onDidTriggerItemButton(ctx => {
|
|
69
|
+
const isEnabled = snippetService.isEnabled(ctx.item.snippet);
|
|
70
|
+
snippetService.updateEnablement(ctx.item.snippet, !isEnabled);
|
|
71
|
+
picker.items = makeSnippetPicks();
|
|
72
|
+
});
|
|
73
|
+
picker.items = makeSnippetPicks();
|
|
74
|
+
if (!picker.items.length) {
|
|
75
|
+
picker.validationMessage = ( nls.localize('pick.noSnippetAvailable', "No snippet available"));
|
|
76
|
+
}
|
|
77
|
+
picker.show();
|
|
78
|
+
await Promise.race([Event.toPromise(picker.onDidAccept), Event.toPromise(picker.onDidHide)]);
|
|
79
|
+
const result = picker.selectedItems[0]?.snippet;
|
|
80
|
+
picker.dispose();
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
export { pickSnippet };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
2
|
+
import { registerAction2 } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
3
|
+
import { CommandsRegistry } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
4
|
+
import * as JSONContributionRegistry from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
|
|
5
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
6
|
+
import { Extensions } from '../../../common/contributions.js';
|
|
7
|
+
import { ConfigureSnippets } from './commands/configureSnippets.js';
|
|
8
|
+
import { ApplyFileSnippetAction } from './commands/fileTemplateSnippets.js';
|
|
9
|
+
import { InsertSnippetAction } from './commands/insertSnippet.js';
|
|
10
|
+
import { SurroundWithSnippetEditorAction } from './commands/surroundWithSnippet.js';
|
|
11
|
+
import { SnippetCodeActions } from './snippetCodeActionProvider.js';
|
|
12
|
+
import { Extensions as Extensions$1 } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
13
|
+
import { editorConfigurationBaseNode } from 'monaco-editor/esm/vs/editor/common/config/editorConfigurationSchema.js';
|
|
14
|
+
registerAction2(InsertSnippetAction);
|
|
15
|
+
CommandsRegistry.registerCommandAlias('editor.action.showSnippets', 'editor.action.insertSnippet');
|
|
16
|
+
registerAction2(SurroundWithSnippetEditorAction);
|
|
17
|
+
registerAction2(ConfigureSnippets);
|
|
18
|
+
registerAction2(ApplyFileSnippetAction);
|
|
19
|
+
( Registry.as(Extensions.Workbench))
|
|
20
|
+
.registerWorkbenchContribution(SnippetCodeActions, 3 );
|
|
21
|
+
( Registry
|
|
22
|
+
.as(Extensions$1.Configuration))
|
|
23
|
+
.registerConfiguration({
|
|
24
|
+
...editorConfigurationBaseNode,
|
|
25
|
+
'properties': {
|
|
26
|
+
'editor.snippets.codeActions.enabled': {
|
|
27
|
+
'description': ( nls.localize(
|
|
28
|
+
'editor.snippets.codeActions.enabled',
|
|
29
|
+
'Controls if surround-with-snippets or file template snippets show as Code Actions.'
|
|
30
|
+
)),
|
|
31
|
+
'type': 'boolean',
|
|
32
|
+
'default': true
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const languageScopeSchemaId = 'vscode://schemas/snippets';
|
|
37
|
+
const snippetSchemaProperties = {
|
|
38
|
+
prefix: {
|
|
39
|
+
description: ( nls.localize(
|
|
40
|
+
'snippetSchema.json.prefix',
|
|
41
|
+
'The prefix to use when selecting the snippet in intellisense'
|
|
42
|
+
)),
|
|
43
|
+
type: ['string', 'array']
|
|
44
|
+
},
|
|
45
|
+
isFileTemplate: {
|
|
46
|
+
description: ( nls.localize(
|
|
47
|
+
'snippetSchema.json.isFileTemplate',
|
|
48
|
+
'The snippet is meant to populate or replace a whole file'
|
|
49
|
+
)),
|
|
50
|
+
type: 'boolean'
|
|
51
|
+
},
|
|
52
|
+
body: {
|
|
53
|
+
markdownDescription: ( nls.localize(
|
|
54
|
+
'snippetSchema.json.body',
|
|
55
|
+
'The snippet content. Use `$1`, `${1:defaultText}` to define cursor positions, use `$0` for the final cursor position. Insert variable values with `${varName}` and `${varName:defaultText}`, e.g. `This is file: $TM_FILENAME`.'
|
|
56
|
+
)),
|
|
57
|
+
type: ['string', 'array'],
|
|
58
|
+
items: {
|
|
59
|
+
type: 'string'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
description: {
|
|
63
|
+
description: ( nls.localize('snippetSchema.json.description', 'The snippet description.')),
|
|
64
|
+
type: ['string', 'array']
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const languageScopeSchema = {
|
|
68
|
+
id: languageScopeSchemaId,
|
|
69
|
+
allowComments: true,
|
|
70
|
+
allowTrailingCommas: true,
|
|
71
|
+
defaultSnippets: [{
|
|
72
|
+
label: ( nls.localize('snippetSchema.json.default', "Empty snippet")),
|
|
73
|
+
body: { '${1:snippetName}': { 'prefix': '${2:prefix}', 'body': '${3:snippet}', 'description': '${4:description}' } }
|
|
74
|
+
}],
|
|
75
|
+
type: 'object',
|
|
76
|
+
description: ( nls.localize('snippetSchema.json', 'User snippet configuration')),
|
|
77
|
+
additionalProperties: {
|
|
78
|
+
type: 'object',
|
|
79
|
+
required: ['body'],
|
|
80
|
+
properties: snippetSchemaProperties,
|
|
81
|
+
additionalProperties: false
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const globalSchemaId = 'vscode://schemas/global-snippets';
|
|
85
|
+
const globalSchema = {
|
|
86
|
+
id: globalSchemaId,
|
|
87
|
+
allowComments: true,
|
|
88
|
+
allowTrailingCommas: true,
|
|
89
|
+
defaultSnippets: [{
|
|
90
|
+
label: ( nls.localize('snippetSchema.json.default', "Empty snippet")),
|
|
91
|
+
body: { '${1:snippetName}': { 'scope': '${2:scope}', 'prefix': '${3:prefix}', 'body': '${4:snippet}', 'description': '${5:description}' } }
|
|
92
|
+
}],
|
|
93
|
+
type: 'object',
|
|
94
|
+
description: ( nls.localize('snippetSchema.json', 'User snippet configuration')),
|
|
95
|
+
additionalProperties: {
|
|
96
|
+
type: 'object',
|
|
97
|
+
required: ['body'],
|
|
98
|
+
properties: {
|
|
99
|
+
...snippetSchemaProperties,
|
|
100
|
+
scope: {
|
|
101
|
+
description: ( nls.localize(
|
|
102
|
+
'snippetSchema.json.scope',
|
|
103
|
+
"A list of language names to which this snippet applies, e.g. 'typescript,javascript'."
|
|
104
|
+
)),
|
|
105
|
+
type: 'string'
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
additionalProperties: false
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
const reg = ( Registry.as(JSONContributionRegistry.Extensions.JSONContribution));
|
|
112
|
+
reg.registerSchema(languageScopeSchemaId, languageScopeSchema);
|
|
113
|
+
reg.registerSchema(globalSchemaId, globalSchema);
|
|
@@ -14,7 +14,7 @@ import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/com
|
|
|
14
14
|
import '../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
15
15
|
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
16
16
|
import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
17
|
-
import { TerminalLocation, TerminalExitReason, TitleEventSource, ITerminalLogService } from '../../../../platform/terminal/common/terminal.js';
|
|
17
|
+
import { TerminalLocation, TerminalExtensions, TerminalExitReason, TitleEventSource, ITerminalLogService } from '../../../../platform/terminal/common/terminal.js';
|
|
18
18
|
import { formatMessageForTerminal } from '../../../../platform/terminal/common/terminalStrings.js';
|
|
19
19
|
import { iconForeground } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
20
20
|
import { getIconRegistry } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
|
|
@@ -46,6 +46,7 @@ import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/com
|
|
|
46
46
|
import { TerminalCapabilityStore } from '../../../../platform/terminal/common/capabilities/terminalCapabilityStore.js';
|
|
47
47
|
import { ITimerService } from '../../../services/timer/browser/timerService.js';
|
|
48
48
|
import { mark } from 'monaco-editor/esm/vs/base/common/performance.js';
|
|
49
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
49
50
|
import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js';
|
|
50
51
|
let TerminalService = class TerminalService {
|
|
51
52
|
get isProcessSupportRegistered() { return !!this._processSupportContextKey.get(); }
|
|
@@ -164,7 +165,7 @@ let TerminalService = class TerminalService {
|
|
|
164
165
|
this._handleInstanceContextKeys();
|
|
165
166
|
this._terminalShellTypeContextKey = TerminalContextKeys.shellType.bindTo(this._contextKeyService);
|
|
166
167
|
this._processSupportContextKey = TerminalContextKeys.processSupported.bindTo(this._contextKeyService);
|
|
167
|
-
this._processSupportContextKey.set(!isWeb || this._remoteAgentService.getConnection() !== null);
|
|
168
|
+
this._processSupportContextKey.set(!isWeb || this._remoteAgentService.getConnection() !== null || ( Registry.as(TerminalExtensions.Backend)).getTerminalBackend() !== undefined);
|
|
168
169
|
this._terminalHasBeenCreated = TerminalContextKeys.terminalHasBeenCreated.bindTo(this._contextKeyService);
|
|
169
170
|
this._terminalCountContextKey = TerminalContextKeys.count.bindTo(this._contextKeyService);
|
|
170
171
|
this._terminalEditorActive = TerminalContextKeys.terminalEditorActive.bindTo(this._contextKeyService);
|