@codingame/monaco-vscode-api 1.83.15 → 1.83.16

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 (48) hide show
  1. package/README.md +430 -0
  2. package/contributions.js +3 -0
  3. package/localExtensionHost.js +3 -2
  4. package/missing-services.js +57 -1
  5. package/monaco-editor-treemending.patch +957 -957
  6. package/package.json +6 -6
  7. package/vscode/src/vs/base/common/prefixTree.js +130 -0
  8. package/vscode/src/vs/platform/actions/browser/floatingMenu.js +26 -2
  9. package/vscode/src/vs/platform/terminal/common/capabilities/bufferMarkCapability.js +41 -0
  10. package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +566 -0
  11. package/vscode/src/vs/platform/terminal/common/capabilities/cwdDetectionCapability.js +29 -0
  12. package/vscode/src/vs/platform/terminal/common/capabilities/partialCommandDetectionCapability.js +48 -0
  13. package/vscode/src/vs/platform/terminal/common/capabilities/terminalCapabilityStore.js +94 -0
  14. package/vscode/src/vs/platform/terminal/common/terminalEnvironment.js +37 -0
  15. package/vscode/src/vs/platform/terminal/common/terminalStrings.js +16 -0
  16. package/vscode/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.js +319 -0
  17. package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +91 -1
  18. package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +423 -0
  19. package/vscode/src/vs/workbench/contrib/format/browser/formatActionsNone.js +82 -0
  20. package/vscode/src/vs/workbench/contrib/terminal/browser/detachedTerminal.js +67 -0
  21. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalExtensions.js +25 -0
  22. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcons.js +64 -0
  23. package/vscode/src/vs/workbench/contrib/terminal/browser/widgets/widgetManager.js +36 -0
  24. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +538 -0
  25. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +104 -0
  26. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +416 -0
  27. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.js +390 -0
  28. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +799 -0
  29. package/vscode/src/vs/workbench/contrib/testing/common/getComputedState.js +101 -0
  30. package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +30 -0
  31. package/vscode/src/vs/workbench/contrib/testing/common/storedValue.js +36 -0
  32. package/vscode/src/vs/workbench/contrib/testing/common/testExplorerFilterState.js +116 -0
  33. package/vscode/src/vs/workbench/contrib/testing/common/testProfileService.js +172 -1
  34. package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +384 -0
  35. package/vscode/src/vs/workbench/contrib/testing/common/testResultService.js +156 -1
  36. package/vscode/src/vs/workbench/contrib/testing/common/testResultStorage.js +156 -0
  37. package/vscode/src/vs/workbench/contrib/testing/common/testService.js +75 -1
  38. package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +9 -1
  39. package/vscode/src/vs/workbench/contrib/testing/common/testingContextKeys.js +179 -0
  40. package/vscode/src/vs/workbench/contrib/testing/common/testingContinuousRunService.js +102 -0
  41. package/vscode/src/vs/workbench/contrib/testing/common/testingDecorations.js +29 -0
  42. package/vscode/src/vs/workbench/contrib/testing/common/testingPeekOpener.js +3 -0
  43. package/vscode/src/vs/workbench/contrib/testing/common/testingStates.js +47 -0
  44. package/vscode/src/vs/workbench/services/suggest/browser/media/suggest.css.js +4 -0
  45. package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionItem.js +10 -0
  46. package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionModel.js +98 -0
  47. package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidget.js +428 -0
  48. package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidgetRenderer.js +83 -0
@@ -1,3 +1,77 @@
1
+ import { CancellationToken } from 'monaco-editor/esm/vs/base/common/cancellation.js';
2
+ import { Iterable } from 'monaco-editor/esm/vs/base/common/iterator.js';
1
3
  import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
4
+ import { TestId } from './testId.js';
2
5
  const ITestService = ( createDecorator('testService'));
3
- export { ITestService };
6
+ const testCollectionIsEmpty = (collection) => !( Iterable.some(collection.rootItems, r => r.children.size > 0));
7
+ const getContextForTestItem = (collection, id) => {
8
+ if (typeof id === 'string') {
9
+ id = TestId.fromString(id);
10
+ }
11
+ if (id.isRoot) {
12
+ return { controller: ( id.toString()) };
13
+ }
14
+ const context = { $mid: 16 , tests: [] };
15
+ for (const i of id.idsFromRoot()) {
16
+ if (!i.isRoot) {
17
+ const test = collection.getNodeById(( i.toString()));
18
+ if (test) {
19
+ context.tests.push(test);
20
+ }
21
+ }
22
+ }
23
+ return context;
24
+ };
25
+ const expandAndGetTestById = async (collection, id, ct = CancellationToken.None) => {
26
+ const idPath = [...TestId.fromString(id).idsFromRoot()];
27
+ let expandToLevel = 0;
28
+ for (let i = idPath.length - 1; !ct.isCancellationRequested && i >= expandToLevel;) {
29
+ const id = ( idPath[i].toString());
30
+ const existing = collection.getNodeById(id);
31
+ if (!existing) {
32
+ i--;
33
+ continue;
34
+ }
35
+ if (i === idPath.length - 1) {
36
+ return existing;
37
+ }
38
+ if (!( existing.children.has(( idPath[i + 1].toString())))) {
39
+ await collection.expand(id, 0);
40
+ }
41
+ expandToLevel = i + 1;
42
+ i = idPath.length - 1;
43
+ }
44
+ return undefined;
45
+ };
46
+ const waitForTestToBeIdle = (testService, test) => {
47
+ if (!test.item.busy) {
48
+ return;
49
+ }
50
+ return ( new Promise(resolve => {
51
+ const l = testService.onDidProcessDiff(() => {
52
+ if (testService.collection.getNodeById(test.item.extId)?.item.busy !== true) {
53
+ resolve();
54
+ l.dispose();
55
+ }
56
+ });
57
+ }));
58
+ };
59
+ const testsInFile = async function* (testService, ident, uri, waitForIdle = true) {
60
+ for (const test of testService.collection.all) {
61
+ if (!test.item.uri) {
62
+ continue;
63
+ }
64
+ if (ident.extUri.isEqual(uri, test.item.uri)) {
65
+ yield test;
66
+ }
67
+ if (ident.extUri.isEqualOrParent(uri, test.item.uri)) {
68
+ if (test.expand === 1 ) {
69
+ await testService.collection.expand(test.item.extId, 1);
70
+ }
71
+ if (waitForIdle) {
72
+ await waitForTestToBeIdle(testService, test);
73
+ }
74
+ }
75
+ }
76
+ };
77
+ export { ITestService, expandAndGetTestById, getContextForTestItem, testCollectionIsEmpty, testsInFile };
@@ -1,6 +1,14 @@
1
1
  import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
2
2
  import { Range } from 'monaco-editor/esm/vs/editor/common/core/range.js';
3
3
  import { TestId } from './testId.js';
4
+ const testRunProfileBitsetList = [
5
+ 2 ,
6
+ 4 ,
7
+ 8 ,
8
+ 16 ,
9
+ 32 ,
10
+ 64 ,
11
+ ];
4
12
  const isStartControllerTests = (t) => 'runId' in t;
5
13
  var IRichLocation;
6
14
  ( (function(IRichLocation) {
@@ -354,4 +362,4 @@ class AbstractIncrementalTestCollection {
354
362
  return {};
355
363
  }
356
364
  }
357
- export { AbstractIncrementalTestCollection, IRichLocation, ITestErrorMessage, ITestItem, ITestItemUpdate, ITestMessage, ITestOutputMessage, ITestTaskState, InternalTestItem, TestResultItem, TestsDiffOp, applyTestItemUpdate, denamespaceTestTag, getMarkId, isStartControllerTests, namespaceTestTag };
365
+ export { AbstractIncrementalTestCollection, IRichLocation, ITestErrorMessage, ITestItem, ITestItemUpdate, ITestMessage, ITestOutputMessage, ITestTaskState, InternalTestItem, TestResultItem, TestsDiffOp, applyTestItemUpdate, denamespaceTestTag, getMarkId, isStartControllerTests, namespaceTestTag, testRunProfileBitsetList };
@@ -0,0 +1,179 @@
1
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
2
+ import { RawContextKey } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
3
+ var TestingContextKeys;
4
+ ( (function(TestingContextKeys) {
5
+ TestingContextKeys.providerCount = ( new RawContextKey('testing.providerCount', 0));
6
+ TestingContextKeys.canRefreshTests = ( new RawContextKey(
7
+ 'testing.canRefresh',
8
+ false,
9
+ { type: 'boolean', description: ( localizeWithPath(
10
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
11
+ 'testing.canRefresh',
12
+ 'Indicates whether any test controller has an attached refresh handler.'
13
+ )) }
14
+ ));
15
+ TestingContextKeys.isRefreshingTests = ( new RawContextKey(
16
+ 'testing.isRefreshing',
17
+ false,
18
+ { type: 'boolean', description: ( localizeWithPath(
19
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
20
+ 'testing.isRefreshing',
21
+ 'Indicates whether any test controller is currently refreshing tests.'
22
+ )) }
23
+ ));
24
+ TestingContextKeys.isContinuousModeOn = ( new RawContextKey(
25
+ 'testing.isContinuousModeOn',
26
+ false,
27
+ { type: 'boolean', description: ( localizeWithPath(
28
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
29
+ 'testing.isContinuousModeOn',
30
+ 'Indicates whether continuous test mode is on.'
31
+ )) }
32
+ ));
33
+ TestingContextKeys.hasDebuggableTests = ( new RawContextKey(
34
+ 'testing.hasDebuggableTests',
35
+ false,
36
+ { type: 'boolean', description: ( localizeWithPath(
37
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
38
+ 'testing.hasDebuggableTests',
39
+ 'Indicates whether any test controller has registered a debug configuration'
40
+ )) }
41
+ ));
42
+ TestingContextKeys.hasRunnableTests = ( new RawContextKey(
43
+ 'testing.hasRunnableTests',
44
+ false,
45
+ { type: 'boolean', description: ( localizeWithPath(
46
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
47
+ 'testing.hasRunnableTests',
48
+ 'Indicates whether any test controller has registered a run configuration'
49
+ )) }
50
+ ));
51
+ TestingContextKeys.hasCoverableTests = ( new RawContextKey(
52
+ 'testing.hasCoverableTests',
53
+ false,
54
+ { type: 'boolean', description: ( localizeWithPath(
55
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
56
+ 'testing.hasCoverableTests',
57
+ 'Indicates whether any test controller has registered a coverage configuration'
58
+ )) }
59
+ ));
60
+ TestingContextKeys.hasNonDefaultProfile = ( new RawContextKey(
61
+ 'testing.hasNonDefaultProfile',
62
+ false,
63
+ { type: 'boolean', description: ( localizeWithPath(
64
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
65
+ 'testing.hasNonDefaultConfig',
66
+ 'Indicates whether any test controller has registered a non-default configuration'
67
+ )) }
68
+ ));
69
+ TestingContextKeys.hasConfigurableProfile = ( new RawContextKey(
70
+ 'testing.hasConfigurableProfile',
71
+ false,
72
+ { type: 'boolean', description: ( localizeWithPath(
73
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
74
+ 'testing.hasConfigurableConfig',
75
+ 'Indicates whether any test configuration can be configured'
76
+ )) }
77
+ ));
78
+ TestingContextKeys.supportsContinuousRun = ( new RawContextKey(
79
+ 'testing.supportsContinuousRun',
80
+ false,
81
+ { type: 'boolean', description: ( localizeWithPath(
82
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
83
+ 'testing.supportsContinuousRun',
84
+ 'Indicates whether continous test running is supported'
85
+ )) }
86
+ ));
87
+ TestingContextKeys.isParentRunningContinuously = ( new RawContextKey(
88
+ 'testing.isParentRunningContinuously',
89
+ false,
90
+ { type: 'boolean', description: ( localizeWithPath(
91
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
92
+ 'testing.isParentRunningContinuously',
93
+ 'Indicates whether the parent of a test is continuously running, set in the menu context of test items'
94
+ )) }
95
+ ));
96
+ TestingContextKeys.activeEditorHasTests = ( new RawContextKey(
97
+ 'testing.activeEditorHasTests',
98
+ false,
99
+ { type: 'boolean', description: ( localizeWithPath(
100
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
101
+ 'testing.activeEditorHasTests',
102
+ 'Indicates whether any tests are present in the current editor'
103
+ )) }
104
+ ));
105
+ TestingContextKeys.capabilityToContextKey = {
106
+ [2 ]: TestingContextKeys.hasRunnableTests,
107
+ [8 ]: TestingContextKeys.hasCoverableTests,
108
+ [4 ]: TestingContextKeys.hasDebuggableTests,
109
+ [16 ]: TestingContextKeys.hasNonDefaultProfile,
110
+ [32 ]: TestingContextKeys.hasConfigurableProfile,
111
+ [64 ]: TestingContextKeys.supportsContinuousRun,
112
+ };
113
+ TestingContextKeys.hasAnyResults = ( new RawContextKey('testing.hasAnyResults', false));
114
+ TestingContextKeys.viewMode = ( new RawContextKey('testing.explorerViewMode', "list" ));
115
+ TestingContextKeys.viewSorting = ( new RawContextKey(
116
+ 'testing.explorerViewSorting',
117
+ "location"
118
+ ));
119
+ TestingContextKeys.isRunning = ( new RawContextKey('testing.isRunning', false));
120
+ TestingContextKeys.isInPeek = ( new RawContextKey('testing.isInPeek', false));
121
+ TestingContextKeys.isPeekVisible = ( new RawContextKey('testing.isPeekVisible', false));
122
+ TestingContextKeys.peekItemType = ( new RawContextKey('peekItemType', undefined, {
123
+ type: 'string',
124
+ description: ( localizeWithPath(
125
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
126
+ 'testing.peekItemType',
127
+ 'Type of the item in the output peek view. Either a "test", "message", "task", or "result".'
128
+ )),
129
+ }));
130
+ TestingContextKeys.controllerId = ( new RawContextKey('controllerId', undefined, {
131
+ type: 'string',
132
+ description: ( localizeWithPath(
133
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
134
+ 'testing.controllerId',
135
+ 'Controller ID of the current test item'
136
+ ))
137
+ }));
138
+ TestingContextKeys.testItemExtId = ( new RawContextKey('testId', undefined, {
139
+ type: 'string',
140
+ description: ( localizeWithPath(
141
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
142
+ 'testing.testId',
143
+ 'ID of the current test item, set when creating or opening menus on test items'
144
+ ))
145
+ }));
146
+ TestingContextKeys.testItemHasUri = ( new RawContextKey('testing.testItemHasUri', false, {
147
+ type: 'boolean',
148
+ description: ( localizeWithPath(
149
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
150
+ 'testing.testItemHasUri',
151
+ 'Boolean indicating whether the test item has a URI defined'
152
+ ))
153
+ }));
154
+ TestingContextKeys.testItemIsHidden = ( new RawContextKey('testing.testItemIsHidden', false, {
155
+ type: 'boolean',
156
+ description: ( localizeWithPath(
157
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
158
+ 'testing.testItemIsHidden',
159
+ 'Boolean indicating whether the test item is hidden'
160
+ ))
161
+ }));
162
+ TestingContextKeys.testMessageContext = ( new RawContextKey('testMessage', undefined, {
163
+ type: 'string',
164
+ description: ( localizeWithPath(
165
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
166
+ 'testing.testMessage',
167
+ 'Value set in `testMessage.contextValue`, available in editor/content and testing/message/context'
168
+ ))
169
+ }));
170
+ TestingContextKeys.testResultOutdated = ( new RawContextKey('testResultOutdated', undefined, {
171
+ type: 'boolean',
172
+ description: ( localizeWithPath(
173
+ 'vs/workbench/contrib/testing/common/testingContextKeys',
174
+ 'testing.testResultOutdated',
175
+ 'Value available in editor/content and testing/message/context when the result is outdated'
176
+ ))
177
+ }));
178
+ })(TestingContextKeys || (TestingContextKeys = {})));
179
+ export { TestingContextKeys };
@@ -0,0 +1,102 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
3
+ import { Disposable, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
4
+ import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
5
+ import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
6
+ import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
7
+ import { StoredValue } from './storedValue.js';
8
+ import { TestingContextKeys } from './testingContextKeys.js';
9
+ import { ITestService } from './testService.js';
10
+ import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
11
+ import { TestId } from './testId.js';
12
+ import { WellDefinedPrefixTree } from '../../../../base/common/prefixTree.js';
13
+ const ITestingContinuousRunService = ( createDecorator('testingContinuousRunService'));
14
+ let TestingContinuousRunService = class TestingContinuousRunService extends Disposable {
15
+ get lastRunProfileIds() {
16
+ return this.lastRun.get(( new Set()));
17
+ }
18
+ constructor(testService, storageService, contextKeyService) {
19
+ super();
20
+ this.testService = testService;
21
+ this.changeEmitter = ( new Emitter());
22
+ this.running = ( new WellDefinedPrefixTree());
23
+ this.onDidChange = this.changeEmitter.event;
24
+ this.isGloballyOn = TestingContextKeys.isContinuousModeOn.bindTo(contextKeyService);
25
+ this.lastRun = this._register(( new StoredValue({
26
+ key: 'lastContinuousRunProfileIds',
27
+ scope: 1 ,
28
+ target: 1 ,
29
+ serialization: {
30
+ deserialize: v => ( new Set(JSON.parse(v))),
31
+ serialize: v => JSON.stringify([...v])
32
+ },
33
+ }, storageService)));
34
+ this._register(toDisposable(() => {
35
+ this.globallyRunning?.dispose();
36
+ for (const cts of ( this.running.values())) {
37
+ cts.dispose();
38
+ }
39
+ }));
40
+ }
41
+ isSpecificallyEnabledFor(testId) {
42
+ return this.running.size > 0 && this.running.hasKey(TestId.fromString(testId).path);
43
+ }
44
+ isEnabledForAParentOf(testId) {
45
+ if (this.globallyRunning) {
46
+ return true;
47
+ }
48
+ return this.running.size > 0 && this.running.hasKeyOrParent(TestId.fromString(testId).path);
49
+ }
50
+ isEnabledForAChildOf(testId) {
51
+ return this.running.size > 0 && this.running.hasKeyOrChildren(TestId.fromString(testId).path);
52
+ }
53
+ isEnabled() {
54
+ return !!this.globallyRunning || this.running.size > 0;
55
+ }
56
+ start(profile, testId) {
57
+ const cts = ( new CancellationTokenSource());
58
+ if (testId === undefined) {
59
+ this.isGloballyOn.set(true);
60
+ }
61
+ if (!testId) {
62
+ this.globallyRunning?.dispose(true);
63
+ this.globallyRunning = cts;
64
+ }
65
+ else {
66
+ this.running.mutate(TestId.fromString(testId).path, c => {
67
+ c?.dispose(true);
68
+ return cts;
69
+ });
70
+ }
71
+ this.lastRun.store(( new Set(( profile.map(p => p.profileId)))));
72
+ this.testService.startContinuousRun({
73
+ continuous: true,
74
+ targets: ( profile.map(p => ({
75
+ testIds: [testId ?? p.controllerId],
76
+ controllerId: p.controllerId,
77
+ profileGroup: p.group,
78
+ profileId: p.profileId
79
+ }))),
80
+ }, cts.token);
81
+ this.changeEmitter.fire(testId);
82
+ }
83
+ stop(testId) {
84
+ if (!testId) {
85
+ this.globallyRunning?.dispose(true);
86
+ this.globallyRunning = undefined;
87
+ }
88
+ else {
89
+ this.running.delete(TestId.fromString(testId).path)?.dispose(true);
90
+ }
91
+ if (testId === undefined) {
92
+ this.isGloballyOn.set(false);
93
+ }
94
+ this.changeEmitter.fire(testId);
95
+ }
96
+ };
97
+ TestingContinuousRunService = ( __decorate([
98
+ ( __param(0, ITestService)),
99
+ ( __param(1, IStorageService)),
100
+ ( __param(2, IContextKeyService))
101
+ ], TestingContinuousRunService));
102
+ export { ITestingContinuousRunService, TestingContinuousRunService };
@@ -0,0 +1,29 @@
1
+ import { binarySearch } from 'monaco-editor/esm/vs/base/common/arrays.js';
2
+ import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
3
+ class TestDecorations {
4
+ constructor() {
5
+ this.value = [];
6
+ }
7
+ push(value) {
8
+ const searchIndex = binarySearch(this.value, value, (a, b) => a.line - b.line);
9
+ this.value.splice(searchIndex < 0 ? ~searchIndex : searchIndex, 0, value);
10
+ }
11
+ *lines() {
12
+ if (!this.value.length) {
13
+ return;
14
+ }
15
+ let startIndex = 0;
16
+ let startLine = this.value[0].line;
17
+ for (let i = 1; i < this.value.length; i++) {
18
+ const v = this.value[i];
19
+ if (v.line !== startLine) {
20
+ yield [startLine, this.value.slice(startIndex, i)];
21
+ startLine = v.line;
22
+ startIndex = i;
23
+ }
24
+ }
25
+ yield [startLine, this.value.slice(startIndex)];
26
+ }
27
+ }
28
+ const ITestingDecorationsService = ( createDecorator('testingDecorationService'));
29
+ export { ITestingDecorationsService, TestDecorations };
@@ -0,0 +1,3 @@
1
+ import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
2
+ const ITestingPeekOpener = ( createDecorator('testingPeekOpener'));
3
+ export { ITestingPeekOpener };
@@ -0,0 +1,47 @@
1
+ const statePriority = {
2
+ [2 ]: 6,
3
+ [6 ]: 5,
4
+ [4 ]: 4,
5
+ [1 ]: 3,
6
+ [3 ]: 2,
7
+ [0 ]: 0,
8
+ [5 ]: 1,
9
+ };
10
+ const isFailedState = (s) => s === 6 || s === 4 ;
11
+ const isStateWithResult = (s) => s === 6 || s === 4 || s === 3 ;
12
+ Object.entries(statePriority).reduce((acc, [stateStr, priority]) => {
13
+ const state = Number(stateStr);
14
+ acc[state] = { statusNode: true, state, priority };
15
+ return acc;
16
+ }, {});
17
+ const cmpPriority = (a, b) => statePriority[b] - statePriority[a];
18
+ const maxPriority = (...states) => {
19
+ switch (states.length) {
20
+ case 0:
21
+ return 0 ;
22
+ case 1:
23
+ return states[0];
24
+ case 2:
25
+ return statePriority[states[0]] > statePriority[states[1]] ? states[0] : states[1];
26
+ default: {
27
+ let max = states[0];
28
+ for (let i = 1; i < states.length; i++) {
29
+ if (statePriority[max] < statePriority[states[i]]) {
30
+ max = states[i];
31
+ }
32
+ }
33
+ return max;
34
+ }
35
+ }
36
+ };
37
+ const statesInOrder = ( ( Object.keys(statePriority)).map(s => Number(s))).sort(cmpPriority);
38
+ const terminalStatePriorities = {
39
+ [3 ]: 0,
40
+ [5 ]: 1,
41
+ [4 ]: 2,
42
+ [6 ]: 3,
43
+ };
44
+ const makeEmptyCounts = () => {
45
+ return ( new Uint32Array(statesInOrder.length));
46
+ };
47
+ export { cmpPriority, isFailedState, isStateWithResult, makeEmptyCounts, maxPriority, statePriority, statesInOrder, terminalStatePriorities };
@@ -0,0 +1,4 @@
1
+ import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
2
+ var css = ".workbench-suggest-widget{display:flex;flex-direction:column;left:0;position:absolute;top:0;width:430px;z-index:40}.workbench-suggest-widget.message{align-items:center;flex-direction:row}.monaco-workbench .workbench-suggest-details,.workbench-suggest-widget{background-color:var(--vscode-editorSuggestWidget-background);border-color:var(--vscode-editorSuggestWidget-border);border-style:solid;border-width:1px;flex:0 1 auto;width:100%}.monaco-workbench.hc-black .workbench-suggest-details,.monaco-workbench.hc-black .workbench-suggest-widget,.monaco-workbench.hc-light .workbench-suggest-details,.monaco-workbench.hc-light .workbench-suggest-widget{border-width:2px}.monaco-workbench .workbench-suggest-widget.with-status-bar .suggest-status-bar{display:flex}.monaco-workbench .workbench-suggest-widget .suggest-status-bar .left{padding-right:8px}.monaco-workbench .workbench-suggest-widget.with-status-bar .suggest-status-bar .action-label{color:var(--vscode-editorSuggestWidgetStatus-foreground)}.monaco-workbench .workbench-suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label{margin-right:0}.monaco-workbench .workbench-suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label:after{content:\", \";margin-right:.3em}.monaco-workbench .workbench-suggest-widget.with-status-bar .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore,.monaco-workbench .workbench-suggest-widget.with-status-bar .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:none}.workbench-suggest-widget .monaco-list .monaco-list-row{background-position:2px 2px;background-repeat:no-repeat;-mox-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:flex;padding-right:10px;touch-action:none;white-space:nowrap}.workbench-suggest-widget .monaco-list .monaco-list-row.focused{color:var(--vscode-editorSuggestWidget-selectedForeground)}.workbench-suggest-widget .monaco-list .monaco-list-row.focused .codicon{color:var(--vscode-editorSuggestWidget-selectedIconForeground)}.workbench-suggest-widget .monaco-list .monaco-list-row>.contents{flex:1;height:100%;overflow:hidden;padding-left:2px}.workbench-suggest-widget .monaco-list .monaco-list-row>.contents>.main{display:flex;justify-content:space-between;overflow:hidden;text-overflow:ellipsis;white-space:pre}.workbench-suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left,.workbench-suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right{display:flex}.workbench-suggest-widget .monaco-list .monaco-list-row:not(.focused)>.contents>.main .monaco-icon-label{color:var(--vscode-editorSuggestWidget-foreground)}.workbench-suggest-widget:not(.frozen) .monaco-highlighted-label .highlight{font-weight:700}.workbench-suggest-widget .monaco-list .monaco-list-row>.contents>.main .monaco-highlighted-label .highlight{color:var(--vscode-editorSuggestWidget-highlightForeground)}.workbench-suggest-widget .monaco-list .monaco-list-row.focused>.contents>.main .monaco-highlighted-label .highlight{color:var(--vscode-editorSuggestWidget-focusHighlightForeground)}.workbench-suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated{opacity:.66;text-decoration:unset}.workbench-suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated>.monaco-icon-label-container>.monaco-icon-name-container{text-decoration:line-through}.workbench-suggest-widget .monaco-list .monaco-list-row .monaco-icon-label:before{height:100%}.workbench-suggest-widget .monaco-list .monaco-list-row .icon{background-position:50%;background-repeat:no-repeat;background-size:80%;display:block;height:16px;margin-left:2px;width:16px}.workbench-suggest-widget .monaco-list .monaco-list-row .icon.hide{display:none}.workbench-suggest-widget .monaco-list .monaco-list-row .suggest-icon{align-items:center;display:flex;margin-right:4px}.workbench-suggest-widget.no-icons .monaco-list .monaco-list-row .icon,.workbench-suggest-widget.no-icons .monaco-list .monaco-list-row .suggest-icon:before{display:none}.workbench-suggest-widget .monaco-list .monaco-list-row .icon.customcolor .colorspan{border:.1em solid #000;display:inline-block;height:.7em;margin:0 0 0 .3em;width:.7em}.workbench-suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{opacity:.7}.workbench-suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.signature-label{opacity:.6;overflow:hidden;text-overflow:ellipsis}.workbench-suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.qualifier-label{align-self:center;font-size:85%;line-height:normal;margin-left:12px;opacity:.4;overflow:hidden;text-overflow:ellipsis}.workbench-suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{font-size:85%;margin-left:1.1em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.workbench-suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label>.monaco-tokenized-source{display:inline}.workbench-suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{display:none}.workbench-suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.right>.details-label,.workbench-suggest-widget.docs-side .monaco-list .monaco-list-row.focused:not(.string-label)>.contents>.main>.right>.details-label,.workbench-suggest-widget:not(.shows-details) .monaco-list .monaco-list-row.focused>.contents>.main>.right>.details-label{display:inline}.workbench-suggest-widget:not(.docs-side) .monaco-list .monaco-list-row.focused:hover>.contents>.main>.right.can-expand-details>.details-label{width:calc(100% - 26px)}.workbench-suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left{flex-grow:1;flex-shrink:1;overflow:hidden}.workbench-suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.monaco-icon-label{flex-shrink:0}.workbench-suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.left>.monaco-icon-label{max-width:100%}.workbench-suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.left>.monaco-icon-label{flex-shrink:1}.workbench-suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right{flex-shrink:4;max-width:70%;overflow:hidden}.workbench-suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:inline-block;height:18px;position:absolute;right:10px;visibility:hidden;width:18px}";
3
+ n(css,{});
4
+ export { css, css as default };
@@ -0,0 +1,10 @@
1
+ import { FuzzyScore } from 'monaco-editor/esm/vs/base/common/filters.js';
2
+ class SimpleCompletionItem {
3
+ constructor(completion) {
4
+ this.completion = completion;
5
+ this.score = FuzzyScore.Default;
6
+ this.distance = 0;
7
+ this.labelLow = this.completion.label.toLowerCase();
8
+ }
9
+ }
10
+ export { SimpleCompletionItem };
@@ -0,0 +1,98 @@
1
+ import { quickSelect } from 'monaco-editor/esm/vs/base/common/arrays.js';
2
+ import { FuzzyScoreOptions, FuzzyScore, fuzzyScore, fuzzyScoreGracefulAggressive } from 'monaco-editor/esm/vs/base/common/filters.js';
3
+ class LineContext {
4
+ constructor(leadingLineContent, characterCountDelta) {
5
+ this.leadingLineContent = leadingLineContent;
6
+ this.characterCountDelta = characterCountDelta;
7
+ }
8
+ }
9
+ class SimpleCompletionModel {
10
+ constructor(_items, _lineContext, replacementIndex, replacementLength) {
11
+ this._items = _items;
12
+ this._lineContext = _lineContext;
13
+ this.replacementIndex = replacementIndex;
14
+ this.replacementLength = replacementLength;
15
+ this._refilterKind = 1 ;
16
+ this._fuzzyScoreOptions = FuzzyScoreOptions.default;
17
+ this._options = {};
18
+ }
19
+ get items() {
20
+ this._ensureCachedState();
21
+ return this._filteredItems;
22
+ }
23
+ get stats() {
24
+ this._ensureCachedState();
25
+ return this._stats;
26
+ }
27
+ get lineContext() {
28
+ return this._lineContext;
29
+ }
30
+ set lineContext(value) {
31
+ if (this._lineContext.leadingLineContent !== value.leadingLineContent
32
+ || this._lineContext.characterCountDelta !== value.characterCountDelta) {
33
+ this._refilterKind = this._lineContext.characterCountDelta < value.characterCountDelta && this._filteredItems ? 2 : 1 ;
34
+ this._lineContext = value;
35
+ }
36
+ }
37
+ _ensureCachedState() {
38
+ if (this._refilterKind !== 0 ) {
39
+ this._createCachedState();
40
+ }
41
+ }
42
+ _createCachedState() {
43
+ const labelLengths = [];
44
+ const { leadingLineContent, characterCountDelta } = this._lineContext;
45
+ let word = '';
46
+ let wordLow = '';
47
+ const source = this._refilterKind === 1 ? this._items : this._filteredItems;
48
+ const target = [];
49
+ const scoreFn = (!this._options.filterGraceful || source.length > 2000) ? fuzzyScore : fuzzyScoreGracefulAggressive;
50
+ for (let i = 0; i < source.length; i++) {
51
+ const item = source[i];
52
+ const overwriteBefore = this.replacementLength;
53
+ const wordLen = overwriteBefore + characterCountDelta;
54
+ if (word.length !== wordLen) {
55
+ word = wordLen === 0 ? '' : leadingLineContent.slice(-wordLen);
56
+ wordLow = word.toLowerCase();
57
+ }
58
+ item.word = word;
59
+ if (wordLen === 0) {
60
+ item.score = FuzzyScore.Default;
61
+ }
62
+ else {
63
+ let wordPos = 0;
64
+ while (wordPos < overwriteBefore) {
65
+ const ch = word.charCodeAt(wordPos);
66
+ if (ch === 32 || ch === 9 ) {
67
+ wordPos += 1;
68
+ }
69
+ else {
70
+ break;
71
+ }
72
+ }
73
+ if (wordPos >= wordLen) {
74
+ item.score = FuzzyScore.Default;
75
+ }
76
+ else {
77
+ const match = scoreFn(word, wordLow, wordPos, item.completion.label, item.labelLow, 0, this._fuzzyScoreOptions);
78
+ if (!match) {
79
+ continue;
80
+ }
81
+ item.score = match;
82
+ }
83
+ }
84
+ item.idx = i;
85
+ item.distance = 1;
86
+ target.push(item);
87
+ labelLengths.push(item.completion.label.length);
88
+ }
89
+ this._filteredItems = target;
90
+ this._refilterKind = 0 ;
91
+ this._stats = {
92
+ pLabelLen: labelLengths.length ?
93
+ quickSelect(labelLengths.length - .85, labelLengths, (a, b) => a - b)
94
+ : 0
95
+ };
96
+ }
97
+ }
98
+ export { LineContext, SimpleCompletionModel };