@codingame/monaco-vscode-notebook-service-override 3.2.3 → 4.1.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 (80) hide show
  1. package/notebook.js +13 -13
  2. package/package.json +2 -2
  3. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
  4. package/external/tslib/tslib.es6.js +0 -11
  5. package/override/vs/platform/dialogs/common/dialogs.js +0 -8
  6. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.css.js +0 -6
  7. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +0 -389
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +0 -608
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +0 -109
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +0 -173
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +0 -488
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +0 -106
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +0 -67
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +0 -165
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +0 -67
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +0 -320
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +0 -72
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +0 -6
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +0 -168
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +0 -209
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +0 -84
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +0 -82
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +0 -67
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +0 -91
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +0 -393
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +0 -5
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +0 -97
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +0 -118
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +0 -59
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +0 -148
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +0 -383
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +0 -77
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +0 -511
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +0 -159
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +0 -56
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +0 -94
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +0 -51
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +0 -565
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +0 -31
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +0 -744
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +0 -707
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +0 -351
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +0 -267
  44. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -45
  45. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1297
  46. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -284
  47. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -563
  48. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -108
  49. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -39
  50. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css.js +0 -6
  51. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +0 -313
  52. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -890
  53. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -13
  54. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -393
  55. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -175
  56. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +0 -1174
  57. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +0 -159
  58. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +0 -451
  59. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +0 -192
  60. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +0 -106
  61. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +0 -509
  62. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +0 -130
  63. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +0 -341
  64. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +0 -111
  65. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +0 -28
  66. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +0 -65
  67. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +0 -641
  68. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +0 -200
  69. package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +0 -80
  70. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +0 -1003
  71. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -103
  72. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +0 -202
  73. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +0 -80
  74. package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +0 -98
  75. package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService.js +0 -237
  76. package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +0 -89
  77. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +0 -376
  78. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +0 -408
  79. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +0 -144
  80. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +0 -129
package/notebook.js CHANGED
@@ -1,30 +1,30 @@
1
1
  import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
2
2
  import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
3
- import { NotebookService } from './vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js';
3
+ import { NotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl';
4
4
  import { INotebookEditorModelResolverService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorModelResolverService';
5
5
  import { INotebookEditorWorkerService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/services/notebookWorkerService';
6
- import { NotebookEditorWorkerServiceImpl } from './vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js';
6
+ import { NotebookEditorWorkerServiceImpl } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl';
7
7
  import { INotebookCellStatusBarService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCellStatusBarService';
8
8
  import { NotebookCellStatusBarService } from './vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.js';
9
9
  import { INotebookEditorService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService';
10
- import { NotebookEditorWidgetService } from './vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js';
11
- import { NotebookModelResolverServiceImpl } from './vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js';
10
+ import { NotebookEditorWidgetService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl';
11
+ import { NotebookModelResolverServiceImpl } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl';
12
12
  import { INotebookKernelService, INotebookKernelHistoryService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService';
13
- import { NotebookKernelService } from './vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js';
14
- import { NotebookRendererMessagingService } from './vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js';
13
+ import { NotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl';
14
+ import { NotebookRendererMessagingService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl';
15
15
  import { INotebookRendererMessagingService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookRendererMessagingService';
16
- import { NotebookExecutionStateService } from './vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js';
17
- import { NotebookExecutionService } from './vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js';
16
+ import { NotebookExecutionStateService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl';
17
+ import { NotebookExecutionService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl';
18
18
  import { INotebookExecutionService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionService';
19
19
  import { INotebookKeymapService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKeymapService';
20
- import { NotebookKeymapService } from './vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js';
20
+ import { NotebookKeymapService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl';
21
21
  import { INotebookExecutionStateService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService';
22
- import { NotebookKernelHistoryService } from './vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js';
22
+ import { NotebookKernelHistoryService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl';
23
23
  import { INotebookLoggingService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookLoggingService';
24
- import { NotebookLoggingService } from './vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js';
24
+ import { NotebookLoggingService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl';
25
25
  import { INotebookSearchService } from 'vscode/vscode/vs/workbench/contrib/search/common/notebookSearch';
26
- import { NotebookSearchService } from './vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService.js';
27
- import './vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js';
26
+ import { NotebookSearchService } from 'vscode/vscode/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService';
27
+ import 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebook.contribution';
28
28
  import { INotebookDocumentService, NotebookDocumentWorkbenchService } from 'vscode/vscode/vs/workbench/services/notebook/common/notebookDocumentService';
29
29
 
30
30
  function getServiceOverride() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-notebook-service-override",
3
- "version": "3.2.3",
3
+ "version": "4.1.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,7 +18,7 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@3.2.3"
21
+ "vscode": "npm:@codingame/monaco-vscode-api@4.1.0"
22
22
  },
23
23
  "exports": {
24
24
  ".": {
@@ -1,3 +0,0 @@
1
- var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=( Object.keys(r.attributes)),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
2
-
3
- export { n as default };
@@ -1,11 +0,0 @@
1
- function __decorate(decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- }
7
- function __param(paramIndex, decorator) {
8
- return function (target, key) { decorator(target, key, paramIndex); }
9
- }
10
-
11
- export { __decorate, __param };
@@ -1,8 +0,0 @@
1
- var ConfirmResult;
2
- ( (function(ConfirmResult) {
3
- ConfirmResult[ConfirmResult["SAVE"] = 0] = "SAVE";
4
- ConfirmResult[ConfirmResult["DONT_SAVE"] = 1] = "DONT_SAVE";
5
- ConfirmResult[ConfirmResult["CANCEL"] = 2] = "CANCEL";
6
- })(ConfirmResult || (ConfirmResult = {})));
7
-
8
- export { ConfirmResult };
@@ -1,6 +0,0 @@
1
- import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
2
-
3
- var css = ".monaco-editor .contentWidgets .empty-editor-hint{color:var(--vscode-input-placeholderForeground)}.monaco-editor .contentWidgets .empty-editor-hint a{color:var(--vscode-textLink-foreground)}";
4
- n(css,{});
5
-
6
- export { css, css as default };
@@ -1,389 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
2
- import './emptyTextEditorHint.css.js';
3
- import { addDisposableListener, $ as $$1 } from 'vscode/vscode/vs/base/browser/dom';
4
- import { dispose, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
5
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
6
- import { ChangeLanguageAction } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorStatus';
7
- import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
8
- import { PLAINTEXT_LANGUAGE_ID } from 'vscode/vscode/vs/editor/common/languages/modesRegistry';
9
- import { Schemas } from 'vscode/vscode/vs/base/common/network';
10
- import { Event } from 'vscode/vscode/vs/base/common/event';
11
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
12
- import { registerEditorContribution } from 'vscode/vscode/vs/editor/browser/editorExtensions';
13
- import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
14
- import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
15
- import { renderFormattedText } from 'vscode/vscode/vs/base/browser/formattedTextRenderer';
16
- import { ApplyFileSnippetAction } from 'vscode/vscode/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets';
17
- import { IInlineChatSessionService } from 'vscode/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService';
18
- import { IInlineChatService } from 'vscode/vscode/vs/workbench/contrib/inlineChat/common/inlineChat';
19
- import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
20
- import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService';
21
- import { KeybindingLabel } from 'vscode/vscode/vs/base/browser/ui/keybindingLabel/keybindingLabel';
22
- import { OS } from 'vscode/vscode/vs/base/common/platform';
23
- import { status } from 'vscode/vscode/vs/base/browser/ui/aria/aria';
24
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
25
- import { Extensions } from 'vscode/vscode/vs/workbench/common/configuration';
26
- import { OUTPUT_MODE_ID, LOG_MODE_ID } from 'vscode/vscode/vs/workbench/services/output/common/output';
27
- import { SEARCH_RESULT_LANGUAGE_ID } from 'vscode/vscode/vs/workbench/services/search/common/search';
28
-
29
- const $ = $$1;
30
- ( Registry.as(Extensions.ConfigurationMigration))
31
- .registerConfigurationMigrations([{
32
- key: 'workbench.editor.untitled.hint',
33
- migrateFn: (value, _accessor) => ([
34
- [emptyTextEditorHintSetting, { value }],
35
- ['workbench.editor.untitled.hint', { value: undefined }]
36
- ])
37
- },
38
- {
39
- key: 'accessibility.verbosity.untitledHint',
40
- migrateFn: (value, _accessor) => ([
41
- ["accessibility.verbosity.emptyEditorHint" , { value }],
42
- ['accessibility.verbosity.untitledHint', { value: undefined }]
43
- ])
44
- }]);
45
- const emptyTextEditorHintSetting = 'workbench.editor.empty.hint';
46
- let EmptyTextEditorHintContribution = class EmptyTextEditorHintContribution {
47
- static { this.ID = 'editor.contrib.emptyTextEditorHint'; }
48
- constructor(editor, editorGroupsService, commandService, configurationService, keybindingService, inlineChatSessionService, inlineChatService, telemetryService, productService) {
49
- this.editor = editor;
50
- this.editorGroupsService = editorGroupsService;
51
- this.commandService = commandService;
52
- this.configurationService = configurationService;
53
- this.keybindingService = keybindingService;
54
- this.inlineChatSessionService = inlineChatSessionService;
55
- this.inlineChatService = inlineChatService;
56
- this.telemetryService = telemetryService;
57
- this.productService = productService;
58
- this.toDispose = [];
59
- this.toDispose.push(this.editor.onDidChangeModel(() => this.update()));
60
- this.toDispose.push(this.editor.onDidChangeModelLanguage(() => this.update()));
61
- this.toDispose.push(this.editor.onDidChangeModelContent(() => this.update()));
62
- this.toDispose.push(this.inlineChatService.onDidChangeProviders(() => this.update()));
63
- this.toDispose.push(this.editor.onDidChangeModelDecorations(() => this.update()));
64
- this.toDispose.push(this.editor.onDidChangeConfiguration((e) => {
65
- if (e.hasChanged(91 )) {
66
- this.update();
67
- }
68
- }));
69
- this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => {
70
- if (e.affectsConfiguration(emptyTextEditorHintSetting)) {
71
- this.update();
72
- }
73
- }));
74
- this.toDispose.push(inlineChatSessionService.onWillStartSession(editor => {
75
- if (this.editor === editor) {
76
- this.textHintContentWidget?.dispose();
77
- }
78
- }));
79
- this.toDispose.push(inlineChatSessionService.onDidEndSession(e => {
80
- if (this.editor === e.editor) {
81
- this.update();
82
- }
83
- }));
84
- }
85
- _getOptions() {
86
- return { clickable: true };
87
- }
88
- _shouldRenderHint() {
89
- const configValue = this.configurationService.getValue(emptyTextEditorHintSetting);
90
- if (configValue === 'hidden') {
91
- return false;
92
- }
93
- if (this.editor.getOption(91 )) {
94
- return false;
95
- }
96
- const model = this.editor.getModel();
97
- const languageId = model?.getLanguageId();
98
- if (!model || languageId === OUTPUT_MODE_ID || languageId === LOG_MODE_ID || languageId === SEARCH_RESULT_LANGUAGE_ID) {
99
- return false;
100
- }
101
- if (this.inlineChatSessionService.getSession(this.editor, model.uri)) {
102
- return false;
103
- }
104
- if (this.editor.getModel()?.getValueLength()) {
105
- return false;
106
- }
107
- const hasConflictingDecorations = Boolean(this.editor.getLineDecorations(1)?.find((d) => d.options.beforeContentClassName
108
- || d.options.afterContentClassName
109
- || d.options.before?.content
110
- || d.options.after?.content));
111
- if (hasConflictingDecorations) {
112
- return false;
113
- }
114
- const inlineChatProviders = [...this.inlineChatService.getAllProvider()];
115
- const shouldRenderDefaultHint = model?.uri.scheme === Schemas.untitled && languageId === PLAINTEXT_LANGUAGE_ID && !inlineChatProviders.length;
116
- return inlineChatProviders.length > 0 || shouldRenderDefaultHint;
117
- }
118
- update() {
119
- const shouldRenderHint = this._shouldRenderHint();
120
- if (shouldRenderHint && !this.textHintContentWidget) {
121
- this.textHintContentWidget = ( new EmptyTextEditorHintContentWidget(
122
- this.editor,
123
- this._getOptions(),
124
- this.editorGroupsService,
125
- this.commandService,
126
- this.configurationService,
127
- this.keybindingService,
128
- this.inlineChatService,
129
- this.telemetryService,
130
- this.productService
131
- ));
132
- }
133
- else if (!shouldRenderHint && this.textHintContentWidget) {
134
- this.textHintContentWidget.dispose();
135
- this.textHintContentWidget = undefined;
136
- }
137
- }
138
- dispose() {
139
- dispose(this.toDispose);
140
- this.textHintContentWidget?.dispose();
141
- }
142
- };
143
- EmptyTextEditorHintContribution = ( __decorate([
144
- ( __param(1, IEditorGroupsService)),
145
- ( __param(2, ICommandService)),
146
- ( __param(3, IConfigurationService)),
147
- ( __param(4, IKeybindingService)),
148
- ( __param(5, IInlineChatSessionService)),
149
- ( __param(6, IInlineChatService)),
150
- ( __param(7, ITelemetryService)),
151
- ( __param(8, IProductService))
152
- ], EmptyTextEditorHintContribution));
153
- class EmptyTextEditorHintContentWidget {
154
- static { this.ID = 'editor.widget.emptyHint'; }
155
- constructor(editor, options, editorGroupsService, commandService, configurationService, keybindingService, inlineChatService, telemetryService, productService) {
156
- this.editor = editor;
157
- this.options = options;
158
- this.editorGroupsService = editorGroupsService;
159
- this.commandService = commandService;
160
- this.configurationService = configurationService;
161
- this.keybindingService = keybindingService;
162
- this.inlineChatService = inlineChatService;
163
- this.telemetryService = telemetryService;
164
- this.productService = productService;
165
- this.isVisible = false;
166
- this.ariaLabel = '';
167
- this.toDispose = ( new DisposableStore());
168
- this.toDispose.add(this.editor.onDidChangeConfiguration((e) => {
169
- if (this.domNode && e.hasChanged(50 )) {
170
- this.editor.applyFontInfo(this.domNode);
171
- }
172
- }));
173
- const onDidFocusEditorText = Event.debounce(this.editor.onDidFocusEditorText, () => undefined, 500);
174
- this.toDispose.add(onDidFocusEditorText(() => {
175
- if (this.editor.hasTextFocus() && this.isVisible && this.ariaLabel && this.configurationService.getValue("accessibility.verbosity.emptyEditorHint" )) {
176
- status(this.ariaLabel);
177
- }
178
- }));
179
- this.editor.addContentWidget(this);
180
- }
181
- getId() {
182
- return EmptyTextEditorHintContentWidget.ID;
183
- }
184
- _getHintInlineChat(providers) {
185
- const providerName = (providers.length === 1 ? providers[0].label : undefined) ?? this.productService.nameShort;
186
- const inlineChatId = 'inlineChat.start';
187
- let ariaLabel = `Ask ${providerName} something or start typing to dismiss.`;
188
- const handleClick = () => {
189
- this.telemetryService.publicLog2('workbenchActionExecuted', {
190
- id: 'inlineChat.hintAction',
191
- from: 'hint'
192
- });
193
- void this.commandService.executeCommand(inlineChatId, { from: 'hint' });
194
- };
195
- const hintHandler = {
196
- disposables: this.toDispose,
197
- callback: (index, _event) => {
198
- switch (index) {
199
- case '0':
200
- handleClick();
201
- break;
202
- }
203
- }
204
- };
205
- const hintElement = $('empty-hint-text');
206
- hintElement.style.display = 'block';
207
- const keybindingHint = this.keybindingService.lookupKeybinding(inlineChatId);
208
- const keybindingHintLabel = keybindingHint?.getLabel();
209
- if (keybindingHint && keybindingHintLabel) {
210
- const actionPart = ( localizeWithPath(
211
- 'vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint',
212
- 'emptyHintText',
213
- 'Press {0} to ask {1} to do something. ',
214
- keybindingHintLabel,
215
- providerName
216
- ));
217
- const [before, after] = ( actionPart.split(keybindingHintLabel).map((fragment) => {
218
- if (this.options.clickable) {
219
- const hintPart = $('a', undefined, fragment);
220
- hintPart.style.fontStyle = 'italic';
221
- hintPart.style.cursor = 'pointer';
222
- hintPart.onclick = handleClick;
223
- return hintPart;
224
- }
225
- else {
226
- const hintPart = $('span', undefined, fragment);
227
- hintPart.style.fontStyle = 'italic';
228
- return hintPart;
229
- }
230
- }));
231
- hintElement.appendChild(before);
232
- const label = ( new KeybindingLabel(hintElement, OS));
233
- label.set(keybindingHint);
234
- label.element.style.width = 'min-content';
235
- label.element.style.display = 'inline';
236
- if (this.options.clickable) {
237
- label.element.style.cursor = 'pointer';
238
- label.element.onclick = handleClick;
239
- }
240
- hintElement.appendChild(after);
241
- const typeToDismiss = ( localizeWithPath(
242
- 'vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint',
243
- 'emptyHintTextDismiss',
244
- 'Start typing to dismiss.'
245
- ));
246
- const textHint2 = $('span', undefined, typeToDismiss);
247
- textHint2.style.fontStyle = 'italic';
248
- hintElement.appendChild(textHint2);
249
- ariaLabel = actionPart.concat(typeToDismiss);
250
- }
251
- else {
252
- const hintMsg = ( localizeWithPath(
253
- 'vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint',
254
- {
255
- key: 'inlineChatHint',
256
- comment: [
257
- 'Preserve double-square brackets and their order',
258
- ]
259
- },
260
- '[[Ask {0} to do something]] or start typing to dismiss.',
261
- providerName
262
- ));
263
- const rendered = renderFormattedText(hintMsg, { actionHandler: hintHandler });
264
- hintElement.appendChild(rendered);
265
- }
266
- return { ariaLabel, hintHandler, hintElement };
267
- }
268
- _getHintDefault() {
269
- const hintHandler = {
270
- disposables: this.toDispose,
271
- callback: (index, event) => {
272
- switch (index) {
273
- case '0':
274
- languageOnClickOrTap(event.browserEvent);
275
- break;
276
- case '1':
277
- snippetOnClickOrTap(event.browserEvent);
278
- break;
279
- case '2':
280
- chooseEditorOnClickOrTap(event.browserEvent);
281
- break;
282
- case '3':
283
- dontShowOnClickOrTap();
284
- break;
285
- }
286
- }
287
- };
288
- const languageOnClickOrTap = async (e) => {
289
- e.stopPropagation();
290
- this.editor.focus();
291
- this.telemetryService.publicLog2('workbenchActionExecuted', {
292
- id: ChangeLanguageAction.ID,
293
- from: 'hint'
294
- });
295
- await this.commandService.executeCommand(ChangeLanguageAction.ID, { from: 'hint' });
296
- this.editor.focus();
297
- };
298
- const snippetOnClickOrTap = async (e) => {
299
- e.stopPropagation();
300
- this.telemetryService.publicLog2('workbenchActionExecuted', {
301
- id: ApplyFileSnippetAction.Id,
302
- from: 'hint'
303
- });
304
- await this.commandService.executeCommand(ApplyFileSnippetAction.Id);
305
- };
306
- const chooseEditorOnClickOrTap = async (e) => {
307
- e.stopPropagation();
308
- const activeEditorInput = this.editorGroupsService.activeGroup.activeEditor;
309
- this.telemetryService.publicLog2('workbenchActionExecuted', {
310
- id: 'welcome.showNewFileEntries',
311
- from: 'hint'
312
- });
313
- const newEditorSelected = await this.commandService.executeCommand('welcome.showNewFileEntries', { from: 'hint' });
314
- if (newEditorSelected && activeEditorInput !== null && activeEditorInput.resource?.scheme === Schemas.untitled) {
315
- this.editorGroupsService.activeGroup.closeEditor(activeEditorInput, { preserveFocus: true });
316
- }
317
- };
318
- const dontShowOnClickOrTap = () => {
319
- this.configurationService.updateValue(emptyTextEditorHintSetting, 'hidden');
320
- this.dispose();
321
- this.editor.focus();
322
- };
323
- const hintMsg = ( localizeWithPath(
324
- 'vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint',
325
- {
326
- key: 'message',
327
- comment: [
328
- 'Preserve double-square brackets and their order',
329
- 'language refers to a programming language'
330
- ]
331
- },
332
- '[[Select a language]], or [[fill with template]], or [[open a different editor]] to get started.\nStart typing to dismiss or [[don\'t show]] this again.'
333
- ));
334
- const hintElement = renderFormattedText(hintMsg, {
335
- actionHandler: hintHandler,
336
- renderCodeSegments: false,
337
- });
338
- hintElement.style.fontStyle = 'italic';
339
- const keybindingsLookup = [ChangeLanguageAction.ID, ApplyFileSnippetAction.Id, 'welcome.showNewFileEntries'];
340
- const keybindingLabels = ( keybindingsLookup.map((id) => this.keybindingService.lookupKeybinding(id)?.getLabel() ?? id));
341
- const ariaLabel = ( localizeWithPath(
342
- 'vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint',
343
- 'defaultHintAriaLabel',
344
- 'Execute {0} to select a language, execute {1} to fill with template, or execute {2} to open a different editor and get started. Start typing to dismiss.',
345
- ...keybindingLabels
346
- ));
347
- for (const anchor of hintElement.querySelectorAll('a')) {
348
- anchor.style.cursor = 'pointer';
349
- const id = keybindingsLookup.shift();
350
- const title = id && this.keybindingService.lookupKeybinding(id)?.getLabel();
351
- anchor.title = title ?? '';
352
- }
353
- return { hintElement, ariaLabel };
354
- }
355
- getDomNode() {
356
- if (!this.domNode) {
357
- this.domNode = $('.empty-editor-hint');
358
- this.domNode.style.width = 'max-content';
359
- this.domNode.style.paddingLeft = '4px';
360
- const inlineChatProviders = [...this.inlineChatService.getAllProvider()];
361
- const { hintElement, ariaLabel } = !inlineChatProviders.length ? this._getHintDefault() : this._getHintInlineChat(inlineChatProviders);
362
- this.domNode.append(hintElement);
363
- this.ariaLabel = ariaLabel.concat(( localizeWithPath(
364
- 'vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint',
365
- 'disableHint',
366
- ' Toggle {0} in settings to disable this hint.',
367
- "accessibility.verbosity.emptyEditorHint"
368
- )));
369
- this.toDispose.add(addDisposableListener(this.domNode, 'click', () => {
370
- this.editor.focus();
371
- }));
372
- this.editor.applyFontInfo(this.domNode);
373
- }
374
- return this.domNode;
375
- }
376
- getPosition() {
377
- return {
378
- position: { lineNumber: 1, column: 1 },
379
- preference: [0 ]
380
- };
381
- }
382
- dispose() {
383
- this.editor.removeContentWidget(this);
384
- dispose(this.toDispose);
385
- }
386
- }
387
- registerEditorContribution(EmptyTextEditorHintContribution.ID, EmptyTextEditorHintContribution, 0 );
388
-
389
- export { EmptyTextEditorHintContribution, emptyTextEditorHintSetting };