@codingame/monaco-vscode-notebook-service-override 4.0.0 → 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 (77) hide show
  1. package/notebook.js +12 -12
  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 -10
  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 -391
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +0 -109
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +0 -173
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +0 -544
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +0 -106
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +0 -67
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +0 -165
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +0 -67
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +0 -320
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +0 -72
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +0 -6
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +0 -168
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +0 -209
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +0 -84
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +0 -82
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +0 -67
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +0 -101
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +0 -393
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +0 -5
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +0 -97
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +0 -120
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +0 -60
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +0 -150
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +0 -656
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +0 -77
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +0 -517
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +0 -159
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +0 -56
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +0 -94
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +0 -51
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +0 -652
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +0 -721
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +0 -351
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +0 -315
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +0 -199
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -47
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1297
  44. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -284
  45. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -563
  46. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -115
  47. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -39
  48. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css.js +0 -6
  49. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +0 -313
  50. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -911
  51. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -13
  52. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -395
  53. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -185
  54. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +0 -1187
  55. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +0 -159
  56. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +0 -451
  57. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +0 -192
  58. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +0 -106
  59. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +0 -510
  60. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +0 -130
  61. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +0 -341
  62. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +0 -111
  63. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +0 -28
  64. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +0 -65
  65. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +0 -641
  66. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +0 -200
  67. package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +0 -90
  68. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +0 -1002
  69. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -103
  70. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +0 -203
  71. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +0 -80
  72. package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +0 -98
  73. package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +0 -89
  74. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +0 -386
  75. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +0 -408
  76. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +0 -144
  77. 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
26
  import { NotebookSearchService } from 'vscode/vscode/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService';
27
- import './vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js';
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": "4.0.0",
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@4.0.0"
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,10 +0,0 @@
1
- export { AbstractDialogHandler, IDialogService, IFileDialogService, getFileNamesMessage } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
2
-
3
- var ConfirmResult;
4
- ( (function(ConfirmResult) {
5
- ConfirmResult[ConfirmResult["SAVE"] = 0] = "SAVE";
6
- ConfirmResult[ConfirmResult["DONT_SAVE"] = 1] = "DONT_SAVE";
7
- ConfirmResult[ConfirmResult["CANCEL"] = 2] = "CANCEL";
8
- })(ConfirmResult || (ConfirmResult = {})));
9
-
10
- 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,391 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
2
- import './emptyTextEditorHint.css.js';
3
- import { addDisposableListener, EventType, $ as $$1 } from 'vscode/vscode/vs/base/browser/dom';
4
- import { DisposableStore, dispose } 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
- import { setupCustomHover } from 'vscode/vscode/vs/base/browser/ui/hover/updatableHoverWidget';
29
- import { getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
30
-
31
- const $ = $$1;
32
- ( Registry.as(Extensions.ConfigurationMigration))
33
- .registerConfigurationMigrations([{
34
- key: 'workbench.editor.untitled.hint',
35
- migrateFn: (value, _accessor) => ([
36
- [emptyTextEditorHintSetting, { value }],
37
- ['workbench.editor.untitled.hint', { value: undefined }]
38
- ])
39
- },
40
- {
41
- key: 'accessibility.verbosity.untitledHint',
42
- migrateFn: (value, _accessor) => ([
43
- ["accessibility.verbosity.emptyEditorHint" , { value }],
44
- ['accessibility.verbosity.untitledHint', { value: undefined }]
45
- ])
46
- }]);
47
- const emptyTextEditorHintSetting = 'workbench.editor.empty.hint';
48
- let EmptyTextEditorHintContribution = class EmptyTextEditorHintContribution {
49
- static { this.ID = 'editor.contrib.emptyTextEditorHint'; }
50
- constructor(editor, editorGroupsService, commandService, configurationService, keybindingService, inlineChatSessionService, inlineChatService, telemetryService, productService) {
51
- this.editor = editor;
52
- this.editorGroupsService = editorGroupsService;
53
- this.commandService = commandService;
54
- this.configurationService = configurationService;
55
- this.keybindingService = keybindingService;
56
- this.inlineChatSessionService = inlineChatSessionService;
57
- this.inlineChatService = inlineChatService;
58
- this.telemetryService = telemetryService;
59
- this.productService = productService;
60
- this.toDispose = [];
61
- this.toDispose.push(this.editor.onDidChangeModel(() => this.update()));
62
- this.toDispose.push(this.editor.onDidChangeModelLanguage(() => this.update()));
63
- this.toDispose.push(this.editor.onDidChangeModelContent(() => this.update()));
64
- this.toDispose.push(this.inlineChatService.onDidChangeProviders(() => this.update()));
65
- this.toDispose.push(this.editor.onDidChangeModelDecorations(() => this.update()));
66
- this.toDispose.push(this.editor.onDidChangeConfiguration((e) => {
67
- if (e.hasChanged(91 )) {
68
- this.update();
69
- }
70
- }));
71
- this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => {
72
- if (e.affectsConfiguration(emptyTextEditorHintSetting)) {
73
- this.update();
74
- }
75
- }));
76
- this.toDispose.push(inlineChatSessionService.onWillStartSession(editor => {
77
- if (this.editor === editor) {
78
- this.textHintContentWidget?.dispose();
79
- }
80
- }));
81
- this.toDispose.push(inlineChatSessionService.onDidEndSession(e => {
82
- if (this.editor === e.editor) {
83
- this.update();
84
- }
85
- }));
86
- }
87
- _getOptions() {
88
- return { clickable: true };
89
- }
90
- _shouldRenderHint() {
91
- const configValue = this.configurationService.getValue(emptyTextEditorHintSetting);
92
- if (configValue === 'hidden') {
93
- return false;
94
- }
95
- if (this.editor.getOption(91 )) {
96
- return false;
97
- }
98
- const model = this.editor.getModel();
99
- const languageId = model?.getLanguageId();
100
- if (!model || languageId === OUTPUT_MODE_ID || languageId === LOG_MODE_ID || languageId === SEARCH_RESULT_LANGUAGE_ID) {
101
- return false;
102
- }
103
- if (this.inlineChatSessionService.getSession(this.editor, model.uri)) {
104
- return false;
105
- }
106
- if (this.editor.getModel()?.getValueLength()) {
107
- return false;
108
- }
109
- const hasConflictingDecorations = Boolean(this.editor.getLineDecorations(1)?.find((d) => d.options.beforeContentClassName
110
- || d.options.afterContentClassName
111
- || d.options.before?.content
112
- || d.options.after?.content));
113
- if (hasConflictingDecorations) {
114
- return false;
115
- }
116
- const inlineChatProviders = [...this.inlineChatService.getAllProvider()];
117
- const shouldRenderDefaultHint = model?.uri.scheme === Schemas.untitled && languageId === PLAINTEXT_LANGUAGE_ID && !inlineChatProviders.length;
118
- return inlineChatProviders.length > 0 || shouldRenderDefaultHint;
119
- }
120
- update() {
121
- const shouldRenderHint = this._shouldRenderHint();
122
- if (shouldRenderHint && !this.textHintContentWidget) {
123
- this.textHintContentWidget = ( new EmptyTextEditorHintContentWidget(
124
- this.editor,
125
- this._getOptions(),
126
- this.editorGroupsService,
127
- this.commandService,
128
- this.configurationService,
129
- this.keybindingService,
130
- this.inlineChatService,
131
- this.telemetryService,
132
- this.productService
133
- ));
134
- }
135
- else if (!shouldRenderHint && this.textHintContentWidget) {
136
- this.textHintContentWidget.dispose();
137
- this.textHintContentWidget = undefined;
138
- }
139
- }
140
- dispose() {
141
- dispose(this.toDispose);
142
- this.textHintContentWidget?.dispose();
143
- }
144
- };
145
- EmptyTextEditorHintContribution = ( __decorate([
146
- ( __param(1, IEditorGroupsService)),
147
- ( __param(2, ICommandService)),
148
- ( __param(3, IConfigurationService)),
149
- ( __param(4, IKeybindingService)),
150
- ( __param(5, IInlineChatSessionService)),
151
- ( __param(6, IInlineChatService)),
152
- ( __param(7, ITelemetryService)),
153
- ( __param(8, IProductService))
154
- ], EmptyTextEditorHintContribution));
155
- class EmptyTextEditorHintContentWidget {
156
- static { this.ID = 'editor.widget.emptyHint'; }
157
- constructor(editor, options, editorGroupsService, commandService, configurationService, keybindingService, inlineChatService, telemetryService, productService) {
158
- this.editor = editor;
159
- this.options = options;
160
- this.editorGroupsService = editorGroupsService;
161
- this.commandService = commandService;
162
- this.configurationService = configurationService;
163
- this.keybindingService = keybindingService;
164
- this.inlineChatService = inlineChatService;
165
- this.telemetryService = telemetryService;
166
- this.productService = productService;
167
- this.isVisible = false;
168
- this.ariaLabel = '';
169
- this.toDispose = ( new DisposableStore());
170
- this.toDispose.add(this.editor.onDidChangeConfiguration((e) => {
171
- if (this.domNode && e.hasChanged(50 )) {
172
- this.editor.applyFontInfo(this.domNode);
173
- }
174
- }));
175
- const onDidFocusEditorText = Event.debounce(this.editor.onDidFocusEditorText, () => undefined, 500);
176
- this.toDispose.add(onDidFocusEditorText(() => {
177
- if (this.editor.hasTextFocus() && this.isVisible && this.ariaLabel && this.configurationService.getValue("accessibility.verbosity.emptyEditorHint" )) {
178
- status(this.ariaLabel);
179
- }
180
- }));
181
- this.editor.addContentWidget(this);
182
- }
183
- getId() {
184
- return EmptyTextEditorHintContentWidget.ID;
185
- }
186
- _getHintInlineChat(providers) {
187
- const providerName = (providers.length === 1 ? providers[0].label : undefined) ?? this.productService.nameShort;
188
- const inlineChatId = 'inlineChat.start';
189
- let ariaLabel = `Ask ${providerName} something or start typing to dismiss.`;
190
- const handleClick = () => {
191
- this.telemetryService.publicLog2('workbenchActionExecuted', {
192
- id: 'inlineChat.hintAction',
193
- from: 'hint'
194
- });
195
- this.commandService.executeCommand(inlineChatId, { from: 'hint' });
196
- };
197
- const hintHandler = {
198
- disposables: this.toDispose,
199
- callback: (index, _event) => {
200
- switch (index) {
201
- case '0':
202
- handleClick();
203
- break;
204
- }
205
- }
206
- };
207
- const hintElement = $('empty-hint-text');
208
- hintElement.style.display = 'block';
209
- const keybindingHint = this.keybindingService.lookupKeybinding(inlineChatId);
210
- const keybindingHintLabel = keybindingHint?.getLabel();
211
- if (keybindingHint && keybindingHintLabel) {
212
- const actionPart = ( localizeWithPath(
213
- 'vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint',
214
- 'emptyHintText',
215
- 'Press {0} to ask {1} to do something. ',
216
- keybindingHintLabel,
217
- providerName
218
- ));
219
- const [before, after] = ( actionPart.split(keybindingHintLabel).map((fragment) => {
220
- if (this.options.clickable) {
221
- const hintPart = $('a', undefined, fragment);
222
- hintPart.style.fontStyle = 'italic';
223
- hintPart.style.cursor = 'pointer';
224
- this.toDispose.add(addDisposableListener(hintPart, EventType.CLICK, handleClick));
225
- return hintPart;
226
- }
227
- else {
228
- const hintPart = $('span', undefined, fragment);
229
- hintPart.style.fontStyle = 'italic';
230
- return hintPart;
231
- }
232
- }));
233
- hintElement.appendChild(before);
234
- const label = hintHandler.disposables.add(( new KeybindingLabel(hintElement, OS)));
235
- label.set(keybindingHint);
236
- label.element.style.width = 'min-content';
237
- label.element.style.display = 'inline';
238
- if (this.options.clickable) {
239
- label.element.style.cursor = 'pointer';
240
- this.toDispose.add(addDisposableListener(label.element, EventType.CLICK, handleClick));
241
- }
242
- hintElement.appendChild(after);
243
- const typeToDismiss = ( localizeWithPath(
244
- 'vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint',
245
- 'emptyHintTextDismiss',
246
- 'Start typing to dismiss.'
247
- ));
248
- const textHint2 = $('span', undefined, typeToDismiss);
249
- textHint2.style.fontStyle = 'italic';
250
- hintElement.appendChild(textHint2);
251
- ariaLabel = actionPart.concat(typeToDismiss);
252
- }
253
- else {
254
- const hintMsg = ( localizeWithPath(
255
- 'vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint',
256
- {
257
- key: 'inlineChatHint',
258
- comment: [
259
- 'Preserve double-square brackets and their order',
260
- ]
261
- },
262
- '[[Ask {0} to do something]] or start typing to dismiss.',
263
- providerName
264
- ));
265
- const rendered = renderFormattedText(hintMsg, { actionHandler: hintHandler });
266
- hintElement.appendChild(rendered);
267
- }
268
- return { ariaLabel, hintHandler, hintElement };
269
- }
270
- _getHintDefault() {
271
- const hintHandler = {
272
- disposables: this.toDispose,
273
- callback: (index, event) => {
274
- switch (index) {
275
- case '0':
276
- languageOnClickOrTap(event.browserEvent);
277
- break;
278
- case '1':
279
- snippetOnClickOrTap(event.browserEvent);
280
- break;
281
- case '2':
282
- chooseEditorOnClickOrTap(event.browserEvent);
283
- break;
284
- case '3':
285
- dontShowOnClickOrTap();
286
- break;
287
- }
288
- }
289
- };
290
- const languageOnClickOrTap = async (e) => {
291
- e.stopPropagation();
292
- this.editor.focus();
293
- this.telemetryService.publicLog2('workbenchActionExecuted', {
294
- id: ChangeLanguageAction.ID,
295
- from: 'hint'
296
- });
297
- await this.commandService.executeCommand(ChangeLanguageAction.ID, { from: 'hint' });
298
- this.editor.focus();
299
- };
300
- const snippetOnClickOrTap = async (e) => {
301
- e.stopPropagation();
302
- this.telemetryService.publicLog2('workbenchActionExecuted', {
303
- id: ApplyFileSnippetAction.Id,
304
- from: 'hint'
305
- });
306
- await this.commandService.executeCommand(ApplyFileSnippetAction.Id);
307
- };
308
- const chooseEditorOnClickOrTap = async (e) => {
309
- e.stopPropagation();
310
- const activeEditorInput = this.editorGroupsService.activeGroup.activeEditor;
311
- this.telemetryService.publicLog2('workbenchActionExecuted', {
312
- id: 'welcome.showNewFileEntries',
313
- from: 'hint'
314
- });
315
- const newEditorSelected = await this.commandService.executeCommand('welcome.showNewFileEntries', { from: 'hint' });
316
- if (newEditorSelected && activeEditorInput !== null && activeEditorInput.resource?.scheme === Schemas.untitled) {
317
- this.editorGroupsService.activeGroup.closeEditor(activeEditorInput, { preserveFocus: true });
318
- }
319
- };
320
- const dontShowOnClickOrTap = () => {
321
- this.configurationService.updateValue(emptyTextEditorHintSetting, 'hidden');
322
- this.dispose();
323
- this.editor.focus();
324
- };
325
- const hintMsg = ( localizeWithPath(
326
- 'vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint',
327
- {
328
- key: 'message',
329
- comment: [
330
- 'Preserve double-square brackets and their order',
331
- 'language refers to a programming language'
332
- ]
333
- },
334
- '[[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.'
335
- ));
336
- const hintElement = renderFormattedText(hintMsg, {
337
- actionHandler: hintHandler,
338
- renderCodeSegments: false,
339
- });
340
- hintElement.style.fontStyle = 'italic';
341
- const keybindingsLookup = [ChangeLanguageAction.ID, ApplyFileSnippetAction.Id, 'welcome.showNewFileEntries'];
342
- const keybindingLabels = ( keybindingsLookup.map((id) => this.keybindingService.lookupKeybinding(id)?.getLabel() ?? id));
343
- const ariaLabel = ( localizeWithPath(
344
- 'vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint',
345
- 'defaultHintAriaLabel',
346
- '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.',
347
- ...keybindingLabels
348
- ));
349
- for (const anchor of hintElement.querySelectorAll('a')) {
350
- anchor.style.cursor = 'pointer';
351
- const id = keybindingsLookup.shift();
352
- const title = id && this.keybindingService.lookupKeybinding(id)?.getLabel();
353
- hintHandler.disposables.add(setupCustomHover(getDefaultHoverDelegate('mouse'), anchor, title ?? ''));
354
- }
355
- return { hintElement, ariaLabel };
356
- }
357
- getDomNode() {
358
- if (!this.domNode) {
359
- this.domNode = $('.empty-editor-hint');
360
- this.domNode.style.width = 'max-content';
361
- this.domNode.style.paddingLeft = '4px';
362
- const inlineChatProviders = [...this.inlineChatService.getAllProvider()];
363
- const { hintElement, ariaLabel } = !inlineChatProviders.length ? this._getHintDefault() : this._getHintInlineChat(inlineChatProviders);
364
- this.domNode.append(hintElement);
365
- this.ariaLabel = ariaLabel.concat(( localizeWithPath(
366
- 'vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint',
367
- 'disableHint',
368
- ' Toggle {0} in settings to disable this hint.',
369
- "accessibility.verbosity.emptyEditorHint"
370
- )));
371
- this.toDispose.add(addDisposableListener(this.domNode, 'click', () => {
372
- this.editor.focus();
373
- }));
374
- this.editor.applyFontInfo(this.domNode);
375
- }
376
- return this.domNode;
377
- }
378
- getPosition() {
379
- return {
380
- position: { lineNumber: 1, column: 1 },
381
- preference: [0 ]
382
- };
383
- }
384
- dispose() {
385
- this.editor.removeContentWidget(this);
386
- dispose(this.toDispose);
387
- }
388
- }
389
- registerEditorContribution(EmptyTextEditorHintContribution.ID, EmptyTextEditorHintContribution, 0 );
390
-
391
- export { EmptyTextEditorHintContribution, emptyTextEditorHintSetting };
@@ -1,109 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
2
- import { Throttler } from 'vscode/vscode/vs/base/common/async';
3
- import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
4
- import { Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
5
- import { NotebookVisibleCellObserver } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver';
6
- import { registerNotebookContribution } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
7
- import { INotebookCellStatusBarService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCellStatusBarService';
8
-
9
- let ContributedStatusBarItemController = class ContributedStatusBarItemController extends Disposable {
10
- static { this.id = 'workbench.notebook.statusBar.contributed'; }
11
- constructor(_notebookEditor, _notebookCellStatusBarService) {
12
- super();
13
- this._notebookEditor = _notebookEditor;
14
- this._notebookCellStatusBarService = _notebookCellStatusBarService;
15
- this._visibleCells = ( new Map());
16
- this._observer = this._register(( new NotebookVisibleCellObserver(this._notebookEditor)));
17
- this._register(this._observer.onDidChangeVisibleCells(this._updateVisibleCells, this));
18
- this._updateEverything();
19
- this._register(this._notebookCellStatusBarService.onDidChangeProviders(this._updateEverything, this));
20
- this._register(this._notebookCellStatusBarService.onDidChangeItems(this._updateEverything, this));
21
- }
22
- _updateEverything() {
23
- const newCells = this._observer.visibleCells.filter(cell => !( this._visibleCells.has(cell.handle)));
24
- const visibleCellHandles = ( new Set(( this._observer.visibleCells.map(item => item.handle))));
25
- const currentCellHandles = Array.from(( this._visibleCells.keys()));
26
- const removedCells = currentCellHandles.filter(handle => !( visibleCellHandles.has(handle)));
27
- const itemsToUpdate = currentCellHandles.filter(handle => ( visibleCellHandles.has(handle)));
28
- this._updateVisibleCells({ added: newCells, removed: ( removedCells.map(handle => ({ handle }))) });
29
- itemsToUpdate.forEach(handle => this._visibleCells.get(handle)?.update());
30
- }
31
- _updateVisibleCells(e) {
32
- const vm = this._notebookEditor.getViewModel();
33
- if (!vm) {
34
- return;
35
- }
36
- for (const newCell of e.added) {
37
- const helper = ( new CellStatusBarHelper(vm, newCell, this._notebookCellStatusBarService));
38
- this._visibleCells.set(newCell.handle, helper);
39
- }
40
- for (const oldCell of e.removed) {
41
- this._visibleCells.get(oldCell.handle)?.dispose();
42
- this._visibleCells.delete(oldCell.handle);
43
- }
44
- }
45
- dispose() {
46
- super.dispose();
47
- this._visibleCells.forEach(cell => cell.dispose());
48
- this._visibleCells.clear();
49
- }
50
- };
51
- ContributedStatusBarItemController = ( __decorate([
52
- ( __param(1, INotebookCellStatusBarService))
53
- ], ContributedStatusBarItemController));
54
- class CellStatusBarHelper extends Disposable {
55
- constructor(_notebookViewModel, _cell, _notebookCellStatusBarService) {
56
- super();
57
- this._notebookViewModel = _notebookViewModel;
58
- this._cell = _cell;
59
- this._notebookCellStatusBarService = _notebookCellStatusBarService;
60
- this._currentItemIds = [];
61
- this._currentItemLists = [];
62
- this._isDisposed = false;
63
- this._updateThrottler = this._register(( new Throttler()));
64
- this._register(toDisposable(() => this._activeToken?.dispose(true)));
65
- this._updateSoon();
66
- this._register(this._cell.model.onDidChangeContent(() => this._updateSoon()));
67
- this._register(this._cell.model.onDidChangeLanguage(() => this._updateSoon()));
68
- this._register(this._cell.model.onDidChangeMetadata(() => this._updateSoon()));
69
- this._register(this._cell.model.onDidChangeInternalMetadata(() => this._updateSoon()));
70
- this._register(this._cell.model.onDidChangeOutputs(() => this._updateSoon()));
71
- }
72
- update() {
73
- this._updateSoon();
74
- }
75
- _updateSoon() {
76
- setTimeout(() => {
77
- if (!this._isDisposed) {
78
- this._updateThrottler.queue(() => this._update());
79
- }
80
- }, 0);
81
- }
82
- async _update() {
83
- const cellIndex = this._notebookViewModel.getCellIndex(this._cell);
84
- const docUri = this._notebookViewModel.notebookDocument.uri;
85
- const viewType = this._notebookViewModel.notebookDocument.viewType;
86
- this._activeToken?.dispose(true);
87
- const tokenSource = this._activeToken = ( new CancellationTokenSource());
88
- const itemLists = await this._notebookCellStatusBarService.getStatusBarItemsForCell(docUri, cellIndex, viewType, tokenSource.token);
89
- if (tokenSource.token.isCancellationRequested) {
90
- itemLists.forEach(itemList => itemList.dispose && itemList.dispose());
91
- return;
92
- }
93
- const items = ( itemLists.map(itemList => itemList.items)).flat();
94
- const newIds = this._notebookViewModel.deltaCellStatusBarItems(this._currentItemIds, [{ handle: this._cell.handle, items }]);
95
- this._currentItemLists.forEach(itemList => itemList.dispose && itemList.dispose());
96
- this._currentItemLists = itemLists;
97
- this._currentItemIds = newIds;
98
- }
99
- dispose() {
100
- super.dispose();
101
- this._isDisposed = true;
102
- this._activeToken?.dispose(true);
103
- this._notebookViewModel.deltaCellStatusBarItems(this._currentItemIds, [{ handle: this._cell.handle, items: [] }]);
104
- this._currentItemLists.forEach(itemList => itemList.dispose && itemList.dispose());
105
- }
106
- }
107
- registerNotebookContribution(ContributedStatusBarItemController.id, ContributedStatusBarItemController);
108
-
109
- export { ContributedStatusBarItemController };