@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.
Files changed (32) hide show
  1. package/README.md +3 -1
  2. package/dist/api.js +6 -6
  3. package/dist/default-extensions/npm/npmBrowserMain.js.map +1 -1
  4. package/dist/default-extensions/typescript-language-features/tsserver.web.js.map +1 -1
  5. package/dist/monaco.js +4 -0
  6. package/dist/service-override/keybindings.js +1 -0
  7. package/dist/service-override/snippets.js +1 -0
  8. package/dist/service-override/views.js +1 -0
  9. package/dist/vscode/vs/platform/audioCues/browser/media/all.mp3.js +17 -17
  10. package/dist/vscode/vs/workbench/common/theme.js +5 -5
  11. package/dist/vscode/vs/workbench/contrib/codeActions/browser/codeActions.contribution.js +25 -0
  12. package/dist/vscode/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +138 -0
  13. package/dist/vscode/vs/workbench/contrib/codeActions/browser/documentationContribution.js +59 -0
  14. package/dist/vscode/vs/workbench/contrib/codeActions/common/codeActionsExtensionPoint.js +61 -0
  15. package/dist/vscode/vs/workbench/contrib/codeActions/common/documentationExtensionPoint.js +58 -0
  16. package/dist/vscode/vs/workbench/contrib/folding/browser/folding.contribution.js +84 -0
  17. package/dist/vscode/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js +172 -0
  18. package/dist/vscode/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js +24 -0
  19. package/dist/vscode/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +360 -0
  20. package/dist/vscode/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +4 -0
  21. package/dist/vscode/vs/workbench/contrib/list/browser/list.contribution.js +15 -0
  22. package/dist/vscode/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js +20 -0
  23. package/dist/vscode/vs/workbench/contrib/snippets/browser/commands/configureSnippets.js +264 -0
  24. package/dist/vscode/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +87 -0
  25. package/dist/vscode/vs/workbench/contrib/snippets/browser/commands/insertSnippet.js +126 -0
  26. package/dist/vscode/vs/workbench/contrib/snippets/browser/commands/surroundWithSnippet.js +56 -0
  27. package/dist/vscode/vs/workbench/contrib/snippets/browser/snippetCodeActionProvider.js +133 -0
  28. package/dist/vscode/vs/workbench/contrib/snippets/browser/snippetPicker.js +83 -0
  29. package/dist/vscode/vs/workbench/contrib/snippets/browser/snippets.contribution.js +113 -0
  30. package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalService.js +3 -2
  31. package/monaco-editor-treemending.patch +551 -551
  32. package/package.json +1 -1
package/dist/monaco.js CHANGED
@@ -48,6 +48,10 @@ import './vscode/vs/workbench/contrib/codeEditor/browser/toggleRenderControlChar
48
48
  import './vscode/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js';
49
49
  import './vscode/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.js';
50
50
  import './vscode/vs/workbench/contrib/codeEditor/browser/editorLineNumberMenu.js';
51
+ import './vscode/vs/workbench/contrib/folding/browser/folding.contribution.js';
52
+ import './vscode/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js';
53
+ import './vscode/vs/workbench/contrib/codeActions/browser/codeActions.contribution.js';
54
+ import './vscode/vs/workbench/contrib/list/browser/list.contribution.js';
51
55
  let ExtensionPoints = class ExtensionPoints {
52
56
  constructor(instantiationService) {
53
57
  this.instantiationService = instantiationService;
@@ -12,6 +12,7 @@ import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/c
12
12
  import { CommandService } from '../vscode/vs/workbench/services/commands/common/commandService.js';
13
13
  import getServiceOverride$1 from './files.js';
14
14
  import '../vscode/vs/workbench/browser/workbench.contribution.js';
15
+ import '../vscode/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js';
15
16
  async function updateUserKeybindings(keybindingsJson) {
16
17
  const userDataProfilesService = StandaloneServices.get(IUserDataProfilesService);
17
18
  await StandaloneServices.get(IFileService).writeFile(userDataProfilesService.defaultProfile.keybindingsResource, VSBuffer.fromString(keybindingsJson));
@@ -6,6 +6,7 @@ import { SnippetsService } from '../vscode/vs/workbench/contrib/snippets/browser
6
6
  import { ILifecycleService } from '../vscode/vs/workbench/services/lifecycle/common/lifecycle.js';
7
7
  import getServiceOverride$1 from './files.js';
8
8
  import { registerServiceInitializeParticipant } from '../services.js';
9
+ import '../vscode/vs/workbench/contrib/snippets/browser/snippets.contribution.js';
9
10
  registerServiceInitializeParticipant(async (accessor) => {
10
11
  void accessor.get(ILifecycleService).when(2 ).then(() => {
11
12
  StandaloneServices.get(ISnippetsService);
@@ -39,6 +39,7 @@ import '../vscode/vs/workbench/browser/workbench.contribution.js';
39
39
  import '../vscode/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js';
40
40
  import '../vscode/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js';
41
41
  import '../vscode/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js';
42
+ import '../vscode/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js';
42
43
  import '../vscode/vs/workbench/contrib/languageDetection/browser/languageDetection.contribution.js';
43
44
  import '../vscode/vs/workbench/contrib/files/browser/files.contribution.js';
44
45
  import '../vscode/vs/workbench/contrib/files/browser/files.contribution2.js';
@@ -1,20 +1,20 @@
1
1
  var audioAssets = {
2
- 'vs/platform/audioCues/browser/media/break.mp3': '../../../../../../assets/break.mp3',
3
- 'vs/platform/audioCues/browser/media/chatRequestSent.mp3': '../../../../../../assets/chatRequestSent.mp3',
4
- 'vs/platform/audioCues/browser/media/chatResponsePending.mp3': '../../../../../../assets/chatResponsePending.mp3',
5
- 'vs/platform/audioCues/browser/media/chatResponseReceived1.mp3': '../../../../../../assets/chatResponseReceived1.mp3',
6
- 'vs/platform/audioCues/browser/media/chatResponseReceived2.mp3': '../../../../../../assets/chatResponseReceived2.mp3',
7
- 'vs/platform/audioCues/browser/media/chatResponseReceived3.mp3': '../../../../../../assets/chatResponseReceived3.mp3',
8
- 'vs/platform/audioCues/browser/media/chatResponseReceived4.mp3': '../../../../../../assets/chatResponseReceived4.mp3',
9
- 'vs/platform/audioCues/browser/media/diffLineDeleted.mp3': '../../../../../../assets/diffLineDeleted.mp3',
10
- 'vs/platform/audioCues/browser/media/diffLineInserted.mp3': '../../../../../../assets/diffLineInserted.mp3',
11
- 'vs/platform/audioCues/browser/media/diffLineModified.mp3': '../../../../../../assets/diffLineModified.mp3',
12
- 'vs/platform/audioCues/browser/media/error.mp3': '../../../../../../assets/error.mp3',
13
- 'vs/platform/audioCues/browser/media/foldedAreas.mp3': '../../../../../../assets/foldedAreas.mp3',
14
- 'vs/platform/audioCues/browser/media/quickFixes.mp3': '../../../../../../assets/quickFixes.mp3',
15
- 'vs/platform/audioCues/browser/media/taskCompleted.mp3': '../../../../../../assets/taskCompleted.mp3',
16
- 'vs/platform/audioCues/browser/media/taskFailed.mp3': '../../../../../../assets/taskFailed.mp3',
17
- 'vs/platform/audioCues/browser/media/terminalBell.mp3': '../../../../../../assets/terminalBell.mp3',
18
- 'vs/platform/audioCues/browser/media/warning.mp3': '../../../../../../assets/warning.mp3'
2
+ 'vs/platform/audioCues/browser/media/break.mp3': new URL('../../../../../../assets/break.mp3', import.meta.url).href,
3
+ 'vs/platform/audioCues/browser/media/chatRequestSent.mp3': new URL('../../../../../../assets/chatRequestSent.mp3', import.meta.url).href,
4
+ 'vs/platform/audioCues/browser/media/chatResponsePending.mp3': new URL('../../../../../../assets/chatResponsePending.mp3', import.meta.url).href,
5
+ 'vs/platform/audioCues/browser/media/chatResponseReceived1.mp3': new URL('../../../../../../assets/chatResponseReceived1.mp3', import.meta.url).href,
6
+ 'vs/platform/audioCues/browser/media/chatResponseReceived2.mp3': new URL('../../../../../../assets/chatResponseReceived2.mp3', import.meta.url).href,
7
+ 'vs/platform/audioCues/browser/media/chatResponseReceived3.mp3': new URL('../../../../../../assets/chatResponseReceived3.mp3', import.meta.url).href,
8
+ 'vs/platform/audioCues/browser/media/chatResponseReceived4.mp3': new URL('../../../../../../assets/chatResponseReceived4.mp3', import.meta.url).href,
9
+ 'vs/platform/audioCues/browser/media/diffLineDeleted.mp3': new URL('../../../../../../assets/diffLineDeleted.mp3', import.meta.url).href,
10
+ 'vs/platform/audioCues/browser/media/diffLineInserted.mp3': new URL('../../../../../../assets/diffLineInserted.mp3', import.meta.url).href,
11
+ 'vs/platform/audioCues/browser/media/diffLineModified.mp3': new URL('../../../../../../assets/diffLineModified.mp3', import.meta.url).href,
12
+ 'vs/platform/audioCues/browser/media/error.mp3': new URL('../../../../../../assets/error.mp3', import.meta.url).href,
13
+ 'vs/platform/audioCues/browser/media/foldedAreas.mp3': new URL('../../../../../../assets/foldedAreas.mp3', import.meta.url).href,
14
+ 'vs/platform/audioCues/browser/media/quickFixes.mp3': new URL('../../../../../../assets/quickFixes.mp3', import.meta.url).href,
15
+ 'vs/platform/audioCues/browser/media/taskCompleted.mp3': new URL('../../../../../../assets/taskCompleted.mp3', import.meta.url).href,
16
+ 'vs/platform/audioCues/browser/media/taskFailed.mp3': new URL('../../../../../../assets/taskFailed.mp3', import.meta.url).href,
17
+ 'vs/platform/audioCues/browser/media/terminalBell.mp3': new URL('../../../../../../assets/terminalBell.mp3', import.meta.url).href,
18
+ 'vs/platform/audioCues/browser/media/warning.mp3': new URL('../../../../../../assets/warning.mp3', import.meta.url).href
19
19
  };
20
20
  export { audioAssets as default };
@@ -614,7 +614,7 @@ registerColor('statusBarItem.prominentHoverBackground', {
614
614
  'statusBarProminentItemHoverBackground',
615
615
  "Status bar prominent items background color when hovering. Prominent items stand out from other status bar entries to indicate importance. Change mode `Toggle Tab Key Moves Focus` from command palette to see an example. The status bar is shown in the bottom of the window."
616
616
  )));
617
- registerColor('statusBarItem.errorBackground', {
617
+ const STATUS_BAR_ERROR_ITEM_BACKGROUND = registerColor('statusBarItem.errorBackground', {
618
618
  dark: ( darken(errorForeground, .4)),
619
619
  light: ( darken(errorForeground, .4)),
620
620
  hcDark: null,
@@ -623,7 +623,7 @@ registerColor('statusBarItem.errorBackground', {
623
623
  'statusBarErrorItemBackground',
624
624
  "Status bar error items background color. Error items stand out from other status bar entries to indicate error conditions. The status bar is shown in the bottom of the window."
625
625
  )));
626
- registerColor('statusBarItem.errorForeground', {
626
+ const STATUS_BAR_ERROR_ITEM_FOREGROUND = registerColor('statusBarItem.errorForeground', {
627
627
  dark: Color.white,
628
628
  light: Color.white,
629
629
  hcDark: Color.white,
@@ -632,7 +632,7 @@ registerColor('statusBarItem.errorForeground', {
632
632
  'statusBarErrorItemForeground',
633
633
  "Status bar error items foreground color. Error items stand out from other status bar entries to indicate error conditions. The status bar is shown in the bottom of the window."
634
634
  )));
635
- registerColor('statusBarItem.warningBackground', {
635
+ const STATUS_BAR_WARNING_ITEM_BACKGROUND = registerColor('statusBarItem.warningBackground', {
636
636
  dark: ( darken(editorWarningForeground, .4)),
637
637
  light: ( darken(editorWarningForeground, .4)),
638
638
  hcDark: null,
@@ -641,7 +641,7 @@ registerColor('statusBarItem.warningBackground', {
641
641
  'statusBarWarningItemBackground',
642
642
  "Status bar warning items background color. Warning items stand out from other status bar entries to indicate warning conditions. The status bar is shown in the bottom of the window."
643
643
  )));
644
- registerColor('statusBarItem.warningForeground', {
644
+ const STATUS_BAR_WARNING_ITEM_FOREGROUND = registerColor('statusBarItem.warningForeground', {
645
645
  dark: Color.white,
646
646
  light: Color.white,
647
647
  hcDark: Color.white,
@@ -1052,4 +1052,4 @@ registerColor('window.inactiveBorder', {
1052
1052
  'windowInactiveBorder',
1053
1053
  "The color used for the border of the window when it is inactive. Only supported in the macOS and Linux desktop client when using the custom title bar."
1054
1054
  )));
1055
- export { ACTIVITY_BAR_ACTIVE_BACKGROUND, ACTIVITY_BAR_ACTIVE_BORDER, ACTIVITY_BAR_ACTIVE_FOCUS_BORDER, ACTIVITY_BAR_BACKGROUND, ACTIVITY_BAR_BADGE_BACKGROUND, ACTIVITY_BAR_BADGE_FOREGROUND, ACTIVITY_BAR_BORDER, ACTIVITY_BAR_DRAG_AND_DROP_BORDER, ACTIVITY_BAR_FOREGROUND, ACTIVITY_BAR_INACTIVE_FOREGROUND, EDITOR_DRAG_AND_DROP_BACKGROUND, EDITOR_DROP_INTO_PROMPT_BACKGROUND, EDITOR_DROP_INTO_PROMPT_BORDER, EDITOR_DROP_INTO_PROMPT_FOREGROUND, EDITOR_GROUP_BORDER, EDITOR_GROUP_EMPTY_BACKGROUND, EDITOR_GROUP_HEADER_BORDER, EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND, EDITOR_GROUP_HEADER_TABS_BACKGROUND, EDITOR_GROUP_HEADER_TABS_BORDER, EDITOR_PANE_BACKGROUND, NOTIFICATIONS_BACKGROUND, NOTIFICATIONS_CENTER_BORDER, NOTIFICATIONS_CENTER_HEADER_BACKGROUND, NOTIFICATIONS_CENTER_HEADER_FOREGROUND, NOTIFICATIONS_TOAST_BORDER, PANEL_ACTIVE_TITLE_BORDER, PANEL_ACTIVE_TITLE_FOREGROUND, PANEL_BACKGROUND, PANEL_BORDER, PANEL_DRAG_AND_DROP_BORDER, PANEL_INACTIVE_TITLE_FOREGROUND, PANEL_SECTION_BORDER, PANEL_SECTION_DRAG_AND_DROP_BACKGROUND, PANEL_SECTION_HEADER_BACKGROUND, PANEL_SECTION_HEADER_BORDER, PANEL_SECTION_HEADER_FOREGROUND, SIDE_BAR_BACKGROUND, SIDE_BAR_BORDER, SIDE_BAR_DRAG_AND_DROP_BACKGROUND, SIDE_BAR_FOREGROUND, SIDE_BAR_SECTION_HEADER_BACKGROUND, SIDE_BAR_SECTION_HEADER_BORDER, SIDE_BAR_SECTION_HEADER_FOREGROUND, SIDE_BAR_TITLE_FOREGROUND, SIDE_BY_SIDE_EDITOR_HORIZONTAL_BORDER, SIDE_BY_SIDE_EDITOR_VERTICAL_BORDER, STATUS_BAR_BACKGROUND, STATUS_BAR_BORDER, STATUS_BAR_FOCUS_BORDER, STATUS_BAR_FOREGROUND, STATUS_BAR_ITEM_COMPACT_HOVER_BACKGROUND, STATUS_BAR_ITEM_FOCUS_BORDER, STATUS_BAR_ITEM_HOVER_BACKGROUND, STATUS_BAR_NO_FOLDER_BACKGROUND, STATUS_BAR_NO_FOLDER_BORDER, STATUS_BAR_NO_FOLDER_FOREGROUND, STATUS_BAR_PROMINENT_ITEM_BACKGROUND, STATUS_BAR_PROMINENT_ITEM_FOREGROUND, TAB_ACTIVE_BACKGROUND, TAB_ACTIVE_BORDER, TAB_ACTIVE_BORDER_TOP, TAB_ACTIVE_FOREGROUND, TAB_ACTIVE_MODIFIED_BORDER, TAB_BORDER, TAB_HOVER_BACKGROUND, TAB_HOVER_BORDER, TAB_HOVER_FOREGROUND, TAB_INACTIVE_BACKGROUND, TAB_INACTIVE_FOREGROUND, TAB_INACTIVE_MODIFIED_BORDER, TAB_LAST_PINNED_BORDER, TAB_UNFOCUSED_ACTIVE_BACKGROUND, TAB_UNFOCUSED_ACTIVE_BORDER, TAB_UNFOCUSED_ACTIVE_BORDER_TOP, TAB_UNFOCUSED_ACTIVE_FOREGROUND, TAB_UNFOCUSED_ACTIVE_MODIFIED_BORDER, TAB_UNFOCUSED_HOVER_BACKGROUND, TAB_UNFOCUSED_HOVER_BORDER, TAB_UNFOCUSED_HOVER_FOREGROUND, TAB_UNFOCUSED_INACTIVE_BACKGROUND, TAB_UNFOCUSED_INACTIVE_FOREGROUND, TAB_UNFOCUSED_INACTIVE_MODIFIED_BORDER, TITLE_BAR_ACTIVE_BACKGROUND, TITLE_BAR_ACTIVE_FOREGROUND, WORKBENCH_BACKGROUND };
1055
+ export { ACTIVITY_BAR_ACTIVE_BACKGROUND, ACTIVITY_BAR_ACTIVE_BORDER, ACTIVITY_BAR_ACTIVE_FOCUS_BORDER, ACTIVITY_BAR_BACKGROUND, ACTIVITY_BAR_BADGE_BACKGROUND, ACTIVITY_BAR_BADGE_FOREGROUND, ACTIVITY_BAR_BORDER, ACTIVITY_BAR_DRAG_AND_DROP_BORDER, ACTIVITY_BAR_FOREGROUND, ACTIVITY_BAR_INACTIVE_FOREGROUND, EDITOR_DRAG_AND_DROP_BACKGROUND, EDITOR_DROP_INTO_PROMPT_BACKGROUND, EDITOR_DROP_INTO_PROMPT_BORDER, EDITOR_DROP_INTO_PROMPT_FOREGROUND, EDITOR_GROUP_BORDER, EDITOR_GROUP_EMPTY_BACKGROUND, EDITOR_GROUP_HEADER_BORDER, EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND, EDITOR_GROUP_HEADER_TABS_BACKGROUND, EDITOR_GROUP_HEADER_TABS_BORDER, EDITOR_PANE_BACKGROUND, NOTIFICATIONS_BACKGROUND, NOTIFICATIONS_CENTER_BORDER, NOTIFICATIONS_CENTER_HEADER_BACKGROUND, NOTIFICATIONS_CENTER_HEADER_FOREGROUND, NOTIFICATIONS_TOAST_BORDER, PANEL_ACTIVE_TITLE_BORDER, PANEL_ACTIVE_TITLE_FOREGROUND, PANEL_BACKGROUND, PANEL_BORDER, PANEL_DRAG_AND_DROP_BORDER, PANEL_INACTIVE_TITLE_FOREGROUND, PANEL_SECTION_BORDER, PANEL_SECTION_DRAG_AND_DROP_BACKGROUND, PANEL_SECTION_HEADER_BACKGROUND, PANEL_SECTION_HEADER_BORDER, PANEL_SECTION_HEADER_FOREGROUND, SIDE_BAR_BACKGROUND, SIDE_BAR_BORDER, SIDE_BAR_DRAG_AND_DROP_BACKGROUND, SIDE_BAR_FOREGROUND, SIDE_BAR_SECTION_HEADER_BACKGROUND, SIDE_BAR_SECTION_HEADER_BORDER, SIDE_BAR_SECTION_HEADER_FOREGROUND, SIDE_BAR_TITLE_FOREGROUND, SIDE_BY_SIDE_EDITOR_HORIZONTAL_BORDER, SIDE_BY_SIDE_EDITOR_VERTICAL_BORDER, STATUS_BAR_BACKGROUND, STATUS_BAR_BORDER, STATUS_BAR_ERROR_ITEM_BACKGROUND, STATUS_BAR_ERROR_ITEM_FOREGROUND, STATUS_BAR_FOCUS_BORDER, STATUS_BAR_FOREGROUND, STATUS_BAR_ITEM_COMPACT_HOVER_BACKGROUND, STATUS_BAR_ITEM_FOCUS_BORDER, STATUS_BAR_ITEM_HOVER_BACKGROUND, STATUS_BAR_NO_FOLDER_BACKGROUND, STATUS_BAR_NO_FOLDER_BORDER, STATUS_BAR_NO_FOLDER_FOREGROUND, STATUS_BAR_PROMINENT_ITEM_BACKGROUND, STATUS_BAR_PROMINENT_ITEM_FOREGROUND, STATUS_BAR_WARNING_ITEM_BACKGROUND, STATUS_BAR_WARNING_ITEM_FOREGROUND, TAB_ACTIVE_BACKGROUND, TAB_ACTIVE_BORDER, TAB_ACTIVE_BORDER_TOP, TAB_ACTIVE_FOREGROUND, TAB_ACTIVE_MODIFIED_BORDER, TAB_BORDER, TAB_HOVER_BACKGROUND, TAB_HOVER_BORDER, TAB_HOVER_FOREGROUND, TAB_INACTIVE_BACKGROUND, TAB_INACTIVE_FOREGROUND, TAB_INACTIVE_MODIFIED_BORDER, TAB_LAST_PINNED_BORDER, TAB_UNFOCUSED_ACTIVE_BACKGROUND, TAB_UNFOCUSED_ACTIVE_BORDER, TAB_UNFOCUSED_ACTIVE_BORDER_TOP, TAB_UNFOCUSED_ACTIVE_FOREGROUND, TAB_UNFOCUSED_ACTIVE_MODIFIED_BORDER, TAB_UNFOCUSED_HOVER_BACKGROUND, TAB_UNFOCUSED_HOVER_BORDER, TAB_UNFOCUSED_HOVER_FOREGROUND, TAB_UNFOCUSED_INACTIVE_BACKGROUND, TAB_UNFOCUSED_INACTIVE_FOREGROUND, TAB_UNFOCUSED_INACTIVE_MODIFIED_BORDER, TITLE_BAR_ACTIVE_BACKGROUND, TITLE_BAR_ACTIVE_FOREGROUND, WORKBENCH_BACKGROUND };
@@ -0,0 +1,25 @@
1
+ import { __decorate, __param } from '../../../../../../node_modules/tslib/tslib.es6.js';
2
+ import { Extensions } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
3
+ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
4
+ import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
5
+ import { Extensions as Extensions$1 } from '../../../common/contributions.js';
6
+ import { codeActionsExtensionPointDescriptor } from '../common/codeActionsExtensionPoint.js';
7
+ import { documentationExtensionPointDescriptor } from '../common/documentationExtensionPoint.js';
8
+ import { ExtensionsRegistry } from '../../../services/extensions/common/extensionsRegistry.js';
9
+ import { editorConfiguration, CodeActionsContribution } from './codeActionsContribution.js';
10
+ import { CodeActionDocumentationContribution } from './documentationContribution.js';
11
+ const codeActionsExtensionPoint = ( ExtensionsRegistry.registerExtensionPoint(codeActionsExtensionPointDescriptor));
12
+ const documentationExtensionPoint = ( ExtensionsRegistry.registerExtensionPoint(documentationExtensionPointDescriptor));
13
+ ( Registry.as(Extensions.Configuration))
14
+ .registerConfiguration(editorConfiguration);
15
+ let WorkbenchConfigurationContribution = class WorkbenchConfigurationContribution {
16
+ constructor(instantiationService) {
17
+ instantiationService.createInstance(CodeActionsContribution, codeActionsExtensionPoint);
18
+ instantiationService.createInstance(CodeActionDocumentationContribution, documentationExtensionPoint);
19
+ }
20
+ };
21
+ WorkbenchConfigurationContribution = ( __decorate([
22
+ ( __param(0, IInstantiationService))
23
+ ], WorkbenchConfigurationContribution));
24
+ ( Registry.as(Extensions$1.Workbench))
25
+ .registerWorkbenchContribution(WorkbenchConfigurationContribution, 4 );
@@ -0,0 +1,138 @@
1
+ import { __decorate, __param } from '../../../../../../node_modules/tslib/tslib.es6.js';
2
+ import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
3
+ import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
4
+ import { editorConfigurationBaseNode } from 'monaco-editor/esm/vs/editor/common/config/editorConfigurationSchema.js';
5
+ import { codeActionCommandId, refactorCommandId, sourceActionCommandId } from 'monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeAction.js';
6
+ import { CodeActionKind } from 'monaco-editor/esm/vs/editor/contrib/codeAction/common/types.js';
7
+ import * as nls from 'monaco-editor/esm/vs/nls.js';
8
+ import { Extensions } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
9
+ import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
10
+ import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
11
+ const codeActionsOnSaveDefaultProperties = ( Object.freeze({
12
+ 'source.fixAll': {
13
+ type: 'boolean',
14
+ description: ( nls.localize(
15
+ 'codeActionsOnSave.fixAll',
16
+ "Controls whether auto fix action should be run on file save."
17
+ ))
18
+ }
19
+ }));
20
+ const codeActionsOnSaveSchema = {
21
+ oneOf: [
22
+ {
23
+ type: 'object',
24
+ properties: codeActionsOnSaveDefaultProperties,
25
+ additionalProperties: {
26
+ type: 'boolean'
27
+ },
28
+ },
29
+ {
30
+ type: 'array',
31
+ items: { type: 'string' }
32
+ }
33
+ ],
34
+ default: {},
35
+ description: ( nls.localize('codeActionsOnSave', "Code Action kinds to be run on save.")),
36
+ scope: 5 ,
37
+ };
38
+ const editorConfiguration = ( Object.freeze({
39
+ ...editorConfigurationBaseNode,
40
+ properties: {
41
+ 'editor.codeActionsOnSave': codeActionsOnSaveSchema
42
+ }
43
+ }));
44
+ let CodeActionsContribution = class CodeActionsContribution extends Disposable {
45
+ constructor(codeActionsExtensionPoint, keybindingService) {
46
+ super();
47
+ this._contributedCodeActions = [];
48
+ this._onDidChangeContributions = this._register(( new Emitter()));
49
+ codeActionsExtensionPoint.setHandler(extensionPoints => {
50
+ this._contributedCodeActions = ( extensionPoints.map(x => x.value)).flat();
51
+ this.updateConfigurationSchema(this._contributedCodeActions);
52
+ this._onDidChangeContributions.fire();
53
+ });
54
+ keybindingService.registerSchemaContribution({
55
+ getSchemaAdditions: () => this.getSchemaAdditions(),
56
+ onDidChange: this._onDidChangeContributions.event,
57
+ });
58
+ }
59
+ updateConfigurationSchema(codeActionContributions) {
60
+ const newProperties = { ...codeActionsOnSaveDefaultProperties };
61
+ for (const [sourceAction, props] of this.getSourceActions(codeActionContributions)) {
62
+ newProperties[sourceAction] = {
63
+ type: 'boolean',
64
+ description: ( nls.localize(
65
+ 'codeActionsOnSave.generic',
66
+ "Controls whether '{0}' actions should be run on file save.",
67
+ props.title
68
+ ))
69
+ };
70
+ }
71
+ codeActionsOnSaveSchema.properties = newProperties;
72
+ ( Registry.as(Extensions.Configuration))
73
+ .notifyConfigurationSchemaUpdated(editorConfiguration);
74
+ }
75
+ getSourceActions(contributions) {
76
+ const defaultKinds = ( ( Object.keys(codeActionsOnSaveDefaultProperties)).map(value => ( new CodeActionKind(value))));
77
+ const sourceActions = ( new Map());
78
+ for (const contribution of contributions) {
79
+ for (const action of contribution.actions) {
80
+ const kind = ( new CodeActionKind(action.kind));
81
+ if (CodeActionKind.Source.contains(kind)
82
+ && !( defaultKinds.some(defaultKind => defaultKind.contains(kind)))) {
83
+ sourceActions.set(kind.value, action);
84
+ }
85
+ }
86
+ }
87
+ return sourceActions;
88
+ }
89
+ getSchemaAdditions() {
90
+ const conditionalSchema = (command, actions) => {
91
+ return {
92
+ if: {
93
+ required: ['command'],
94
+ properties: {
95
+ 'command': { const: command }
96
+ }
97
+ },
98
+ then: {
99
+ properties: {
100
+ 'args': {
101
+ required: ['kind'],
102
+ properties: {
103
+ 'kind': {
104
+ anyOf: [
105
+ {
106
+ enum: ( actions.map(action => action.kind)),
107
+ enumDescriptions: ( actions.map(action => action.description ?? action.title)),
108
+ },
109
+ { type: 'string' },
110
+ ]
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
116
+ };
117
+ };
118
+ const getActions = (ofKind) => {
119
+ const allActions = ( this._contributedCodeActions.map(desc => desc.actions)).flat();
120
+ const out = ( new Map());
121
+ for (const action of allActions) {
122
+ if (!( out.has(action.kind)) && ofKind.contains(( new CodeActionKind(action.kind)))) {
123
+ out.set(action.kind, action);
124
+ }
125
+ }
126
+ return Array.from(( out.values()));
127
+ };
128
+ return [
129
+ conditionalSchema(codeActionCommandId, getActions(CodeActionKind.Empty)),
130
+ conditionalSchema(refactorCommandId, getActions(CodeActionKind.Refactor)),
131
+ conditionalSchema(sourceActionCommandId, getActions(CodeActionKind.Source)),
132
+ ];
133
+ }
134
+ };
135
+ CodeActionsContribution = ( __decorate([
136
+ ( __param(1, IKeybindingService))
137
+ ], CodeActionsContribution));
138
+ export { CodeActionsContribution, editorConfiguration };
@@ -0,0 +1,59 @@
1
+ import { __decorate, __param } from '../../../../../../node_modules/tslib/tslib.es6.js';
2
+ import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
+ import { ILanguageFeaturesService } from 'monaco-editor/esm/vs/editor/common/services/languageFeatures.js';
4
+ import { CodeActionKind } from 'monaco-editor/esm/vs/editor/contrib/codeAction/common/types.js';
5
+ import { ContextKeyExpr, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
6
+ let CodeActionDocumentationContribution = class CodeActionDocumentationContribution extends Disposable {
7
+ constructor(extensionPoint, contextKeyService, languageFeaturesService) {
8
+ super();
9
+ this.contextKeyService = contextKeyService;
10
+ this.contributions = [];
11
+ this.emptyCodeActionsList = {
12
+ actions: [],
13
+ dispose: () => { }
14
+ };
15
+ this._register(languageFeaturesService.codeActionProvider.register('*', this));
16
+ extensionPoint.setHandler(points => {
17
+ this.contributions = [];
18
+ for (const documentation of points) {
19
+ if (!documentation.value.refactoring) {
20
+ continue;
21
+ }
22
+ for (const contribution of documentation.value.refactoring) {
23
+ const precondition = ContextKeyExpr.deserialize(contribution.when);
24
+ if (!precondition) {
25
+ continue;
26
+ }
27
+ this.contributions.push({
28
+ title: contribution.title,
29
+ when: precondition,
30
+ command: contribution.command
31
+ });
32
+ }
33
+ }
34
+ });
35
+ }
36
+ async provideCodeActions(_model, _range, context, _token) {
37
+ return this.emptyCodeActionsList;
38
+ }
39
+ _getAdditionalMenuItems(context, actions) {
40
+ if (context.only !== CodeActionKind.Refactor.value) {
41
+ if (!( actions.some(action => action.kind && CodeActionKind.Refactor.contains(( new CodeActionKind(action.kind)))))) {
42
+ return [];
43
+ }
44
+ }
45
+ return ( this.contributions
46
+ .filter(contribution => this.contextKeyService.contextMatchesRules(contribution.when))
47
+ .map(contribution => {
48
+ return {
49
+ id: contribution.command,
50
+ title: contribution.title
51
+ };
52
+ }));
53
+ }
54
+ };
55
+ CodeActionDocumentationContribution = ( __decorate([
56
+ ( __param(1, IContextKeyService)),
57
+ ( __param(2, ILanguageFeaturesService))
58
+ ], CodeActionDocumentationContribution));
59
+ export { CodeActionDocumentationContribution };
@@ -0,0 +1,61 @@
1
+ import * as nls from 'monaco-editor/esm/vs/nls.js';
2
+ import { languagesExtPoint } from '../../../services/language/common/languageService.js';
3
+ var CodeActionExtensionPointFields;
4
+ ( (function(CodeActionExtensionPointFields) {
5
+ CodeActionExtensionPointFields["languages"] = "languages";
6
+ CodeActionExtensionPointFields["actions"] = "actions";
7
+ CodeActionExtensionPointFields["kind"] = "kind";
8
+ CodeActionExtensionPointFields["title"] = "title";
9
+ CodeActionExtensionPointFields["description"] = "description";
10
+ })(CodeActionExtensionPointFields || (CodeActionExtensionPointFields = {})));
11
+ const codeActionsExtensionPointSchema = ( Object.freeze({
12
+ type: 'array',
13
+ markdownDescription: ( nls.localize('contributes.codeActions', "Configure which editor to use for a resource.")),
14
+ items: {
15
+ type: 'object',
16
+ required: [CodeActionExtensionPointFields.languages, CodeActionExtensionPointFields.actions],
17
+ properties: {
18
+ [CodeActionExtensionPointFields.languages]: {
19
+ type: 'array',
20
+ description: ( nls.localize(
21
+ 'contributes.codeActions.languages',
22
+ "Language modes that the code actions are enabled for."
23
+ )),
24
+ items: { type: 'string' }
25
+ },
26
+ [CodeActionExtensionPointFields.actions]: {
27
+ type: 'object',
28
+ required: [CodeActionExtensionPointFields.kind, CodeActionExtensionPointFields.title],
29
+ properties: {
30
+ [CodeActionExtensionPointFields.kind]: {
31
+ type: 'string',
32
+ markdownDescription: ( nls.localize(
33
+ 'contributes.codeActions.kind',
34
+ "`CodeActionKind` of the contributed code action."
35
+ )),
36
+ },
37
+ [CodeActionExtensionPointFields.title]: {
38
+ type: 'string',
39
+ description: ( nls.localize(
40
+ 'contributes.codeActions.title',
41
+ "Label for the code action used in the UI."
42
+ )),
43
+ },
44
+ [CodeActionExtensionPointFields.description]: {
45
+ type: 'string',
46
+ description: ( nls.localize(
47
+ 'contributes.codeActions.description',
48
+ "Description of what the code action does."
49
+ )),
50
+ },
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }));
56
+ const codeActionsExtensionPointDescriptor = {
57
+ extensionPoint: 'codeActions',
58
+ deps: [languagesExtPoint],
59
+ jsonSchema: codeActionsExtensionPointSchema
60
+ };
61
+ export { codeActionsExtensionPointDescriptor };
@@ -0,0 +1,58 @@
1
+ import * as nls from 'monaco-editor/esm/vs/nls.js';
2
+ import { languagesExtPoint } from '../../../services/language/common/languageService.js';
3
+ var DocumentationExtensionPointFields;
4
+ ( (function(DocumentationExtensionPointFields) {
5
+ DocumentationExtensionPointFields["when"] = "when";
6
+ DocumentationExtensionPointFields["title"] = "title";
7
+ DocumentationExtensionPointFields["command"] = "command";
8
+ })(
9
+ DocumentationExtensionPointFields || (DocumentationExtensionPointFields = {})
10
+ ));
11
+ const documentationExtensionPointSchema = ( Object.freeze({
12
+ type: 'object',
13
+ description: ( nls.localize('contributes.documentation', "Contributed documentation.")),
14
+ properties: {
15
+ 'refactoring': {
16
+ type: 'array',
17
+ description: ( nls.localize(
18
+ 'contributes.documentation.refactorings',
19
+ "Contributed documentation for refactorings."
20
+ )),
21
+ items: {
22
+ type: 'object',
23
+ description: ( nls.localize(
24
+ 'contributes.documentation.refactoring',
25
+ "Contributed documentation for refactoring."
26
+ )),
27
+ required: [
28
+ DocumentationExtensionPointFields.title,
29
+ DocumentationExtensionPointFields.when,
30
+ DocumentationExtensionPointFields.command
31
+ ],
32
+ properties: {
33
+ [DocumentationExtensionPointFields.title]: {
34
+ type: 'string',
35
+ description: ( nls.localize(
36
+ 'contributes.documentation.refactoring.title',
37
+ "Label for the documentation used in the UI."
38
+ )),
39
+ },
40
+ [DocumentationExtensionPointFields.when]: {
41
+ type: 'string',
42
+ description: ( nls.localize('contributes.documentation.refactoring.when', "When clause.")),
43
+ },
44
+ [DocumentationExtensionPointFields.command]: {
45
+ type: 'string',
46
+ description: ( nls.localize('contributes.documentation.refactoring.command', "Command executed.")),
47
+ },
48
+ },
49
+ }
50
+ }
51
+ }
52
+ }));
53
+ const documentationExtensionPointDescriptor = {
54
+ extensionPoint: 'documentation',
55
+ deps: [languagesExtPoint],
56
+ jsonSchema: documentationExtensionPointSchema
57
+ };
58
+ export { documentationExtensionPointDescriptor };
@@ -0,0 +1,84 @@
1
+ import { __decorate, __param } from '../../../../../../node_modules/tslib/tslib.es6.js';
2
+ import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
3
+ import { FoldingController } from 'monaco-editor/esm/vs/editor/contrib/folding/browser/folding.js';
4
+ import * as nls from 'monaco-editor/esm/vs/nls.js';
5
+ import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
6
+ import { Extensions as Extensions$1 } from '../../../common/contributions.js';
7
+ import { Extensions } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
8
+ import { editorConfigurationBaseNode } from 'monaco-editor/esm/vs/editor/common/config/editorConfigurationSchema.js';
9
+ import { IExtensionService } from '../../../services/extensions/common/extensions.js';
10
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
11
+ let DefaultFoldingRangeProvider = class DefaultFoldingRangeProvider extends Disposable {
12
+ constructor(_extensionService, _configurationService) {
13
+ super();
14
+ this._extensionService = _extensionService;
15
+ this._configurationService = _configurationService;
16
+ this._store.add(this._extensionService.onDidChangeExtensions(this._updateConfigValues, this));
17
+ this._store.add(FoldingController.setFoldingRangeProviderSelector(this._selectFoldingRangeProvider.bind(this)));
18
+ this._updateConfigValues();
19
+ }
20
+ async _updateConfigValues() {
21
+ await this._extensionService.whenInstalledExtensionsRegistered();
22
+ DefaultFoldingRangeProvider.extensionIds.length = 0;
23
+ DefaultFoldingRangeProvider.extensionItemLabels.length = 0;
24
+ DefaultFoldingRangeProvider.extensionDescriptions.length = 0;
25
+ DefaultFoldingRangeProvider.extensionIds.push(null);
26
+ DefaultFoldingRangeProvider.extensionItemLabels.push(( nls.localize('null', 'All')));
27
+ DefaultFoldingRangeProvider.extensionDescriptions.push(( nls.localize('nullFormatterDescription', "All active folding range providers")));
28
+ const languageExtensions = [];
29
+ const otherExtensions = [];
30
+ for (const extension of this._extensionService.extensions) {
31
+ if (extension.main || extension.browser) {
32
+ if (extension.categories?.find(cat => cat === 'Programming Languages')) {
33
+ languageExtensions.push(extension);
34
+ }
35
+ else {
36
+ otherExtensions.push(extension);
37
+ }
38
+ }
39
+ }
40
+ const sorter = (a, b) => a.name.localeCompare(b.name);
41
+ for (const extension of languageExtensions.sort(sorter)) {
42
+ DefaultFoldingRangeProvider.extensionIds.push(extension.identifier.value);
43
+ DefaultFoldingRangeProvider.extensionItemLabels.push(extension.displayName ?? '');
44
+ DefaultFoldingRangeProvider.extensionDescriptions.push(extension.description ?? '');
45
+ }
46
+ for (const extension of otherExtensions.sort(sorter)) {
47
+ DefaultFoldingRangeProvider.extensionIds.push(extension.identifier.value);
48
+ DefaultFoldingRangeProvider.extensionItemLabels.push(extension.displayName ?? '');
49
+ DefaultFoldingRangeProvider.extensionDescriptions.push(extension.description ?? '');
50
+ }
51
+ }
52
+ _selectFoldingRangeProvider(providers, document) {
53
+ const value = this._configurationService.getValue(DefaultFoldingRangeProvider.configName, { overrideIdentifier: document.getLanguageId() });
54
+ if (value) {
55
+ return providers.filter(p => p.id === value);
56
+ }
57
+ return undefined;
58
+ }
59
+ };
60
+ DefaultFoldingRangeProvider.configName = 'editor.defaultFoldingRangeProvider';
61
+ DefaultFoldingRangeProvider.extensionIds = [];
62
+ DefaultFoldingRangeProvider.extensionItemLabels = [];
63
+ DefaultFoldingRangeProvider.extensionDescriptions = [];
64
+ DefaultFoldingRangeProvider = ( __decorate([
65
+ ( __param(0, IExtensionService)),
66
+ ( __param(1, IConfigurationService))
67
+ ], DefaultFoldingRangeProvider));
68
+ ( Registry.as(Extensions.Configuration)).registerConfiguration({
69
+ ...editorConfigurationBaseNode,
70
+ properties: {
71
+ [DefaultFoldingRangeProvider.configName]: {
72
+ description: ( nls.localize(
73
+ 'formatter.default',
74
+ "Defines a default folding range provider that takes precedence over all other folding range providers. Must be the identifier of an extension contributing a folding range provider."
75
+ )),
76
+ type: ['string', 'null'],
77
+ default: null,
78
+ enum: DefaultFoldingRangeProvider.extensionIds,
79
+ enumItemLabels: DefaultFoldingRangeProvider.extensionItemLabels,
80
+ markdownEnumDescriptions: DefaultFoldingRangeProvider.extensionDescriptions
81
+ }
82
+ }
83
+ });
84
+ ( Registry.as(Extensions$1.Workbench)).registerWorkbenchContribution(DefaultFoldingRangeProvider, 3 );