@theia/api-tests 1.27.0-next.9 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/api-tests",
|
|
3
|
-
"version": "1.27.0
|
|
3
|
+
"version": "1.27.0",
|
|
4
4
|
"description": "Theia API tests",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.27.0
|
|
6
|
+
"@theia/core": "1.27.0"
|
|
7
7
|
},
|
|
8
8
|
"license": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0",
|
|
9
9
|
"repository": {
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "b952ad743a97821dee94787e946f5a288174d4e8"
|
|
24
24
|
}
|
package/src/file-search.spec.js
CHANGED
|
@@ -58,8 +58,8 @@ describe('file-search', function () {
|
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
it('should not place very good matches above exact matches', () => {
|
|
61
|
-
const exactMatch = '
|
|
62
|
-
const veryGoodMatch = '
|
|
61
|
+
const exactMatch = 'almost_absurdly_long_file_name_with_many_parts.file';
|
|
62
|
+
const veryGoodMatch = 'almost_absurdly_long_file_name_with_many_parts_plus_one.file';
|
|
63
63
|
quickFileOpenService['filterAndRange'] = { filter: exactMatch };
|
|
64
64
|
/** @type import ('@theia/file-search/lib/browser/quick-file-open').FileQuickPickItem*/
|
|
65
65
|
const a = { label: exactMatch, uri: new Uri.default(exactMatch) };
|
package/src/find-replace.spec.js
CHANGED
package/src/navigator.spec.js
CHANGED
|
@@ -44,12 +44,12 @@ describe('Navigator', function () {
|
|
|
44
44
|
await fileService.delete(targetUri.parent, { fromUserGesture: false, useTrash: false, recursive: true });
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
/** @type {Array<['copy' |
|
|
47
|
+
/** @type {Array<['copy' | 'move', boolean]>} */
|
|
48
48
|
const operations = [
|
|
49
49
|
['copy', false],
|
|
50
50
|
['move', false]
|
|
51
51
|
];
|
|
52
|
-
/** @type {Array<['file' |
|
|
52
|
+
/** @type {Array<['file' | 'dir', boolean]>} */
|
|
53
53
|
const fileTypes = [
|
|
54
54
|
['file', false],
|
|
55
55
|
['dir', false],
|
package/src/saveable.spec.js
CHANGED
|
@@ -66,7 +66,7 @@ describe('Saveable', function () {
|
|
|
66
66
|
|
|
67
67
|
const toTearDown = new DisposableCollection();
|
|
68
68
|
|
|
69
|
-
/** @type {string |
|
|
69
|
+
/** @type {string | undefined} */
|
|
70
70
|
const autoSave = preferences.get('files.autoSave', undefined, rootUri.toString());
|
|
71
71
|
|
|
72
72
|
beforeEach(async () => {
|
package/src/typescript.spec.js
CHANGED
|
@@ -62,7 +62,7 @@ describe('TypeScript', function () {
|
|
|
62
62
|
const rootUri = workspaceService.tryGetRoots()[0].resource;
|
|
63
63
|
const demoFileUri = rootUri.resolveToAbsolute('../api-tests/test-ts-workspace/demo-file.ts');
|
|
64
64
|
const definitionFileUri = rootUri.resolveToAbsolute('../api-tests/test-ts-workspace/demo-definitions-file.ts');
|
|
65
|
-
let originalAutoSaveValue = preferences.
|
|
65
|
+
let originalAutoSaveValue = preferences.inspect('files.autoSave').globalValue;
|
|
66
66
|
|
|
67
67
|
before(async function () {
|
|
68
68
|
await pluginService.didStart;
|
|
@@ -71,7 +71,7 @@ describe('TypeScript', function () {
|
|
|
71
71
|
throw new Error(pluginId + ' should be started');
|
|
72
72
|
}
|
|
73
73
|
await pluginService.activatePlugin(pluginId);
|
|
74
|
-
}).concat(preferences.set('files.autoSave', 'off', PreferenceScope.
|
|
74
|
+
}).concat(preferences.set('files.autoSave', 'off', PreferenceScope.User)));
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
beforeEach(async function () {
|
|
@@ -85,7 +85,7 @@ describe('TypeScript', function () {
|
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
after(async () => {
|
|
88
|
-
await preferences.set('files.autoSave', originalAutoSaveValue, PreferenceScope.
|
|
88
|
+
await preferences.set('files.autoSave', originalAutoSaveValue, PreferenceScope.User);
|
|
89
89
|
})
|
|
90
90
|
|
|
91
91
|
/**
|
|
@@ -734,4 +734,43 @@ SPAN {
|
|
|
734
734
|
assert.equal(getResultText(), expectedMessage);
|
|
735
735
|
});
|
|
736
736
|
}
|
|
737
|
+
|
|
738
|
+
it('Can execute code actions', async function () {
|
|
739
|
+
const editor = await openEditor(demoFileUri);
|
|
740
|
+
/** @type {import('@theia/monaco-editor-core/src/vs/editor/contrib/codeAction/browser/codeActionCommands').QuickFixController} */
|
|
741
|
+
const quickFixController = editor.getControl().getContribution('editor.contrib.quickFixController');
|
|
742
|
+
const isActionAvailable = () => {
|
|
743
|
+
const lightbulbVisibility = quickFixController['_ui'].rawValue?.['_lightBulbWidget'].rawValue?.['_domNode'].style.visibility;
|
|
744
|
+
return lightbulbVisibility !== undefined && lightbulbVisibility !== 'hidden';
|
|
745
|
+
}
|
|
746
|
+
assert.isFalse(isActionAvailable());
|
|
747
|
+
// import { DefinedInterface } from "./demo-definitions-file";
|
|
748
|
+
assert.strictEqual(editor.getControl().getModel().getLineContent(30), 'import { DefinedInterface } from "./demo-definitions-file";');
|
|
749
|
+
editor.getControl().revealLine(30);
|
|
750
|
+
editor.getControl().setSelection(new Selection(30, 1, 30, 60));
|
|
751
|
+
await waitForAnimation(() => isActionAvailable(), 5000, 'No code action available. (1)');
|
|
752
|
+
assert.isTrue(isActionAvailable());
|
|
753
|
+
|
|
754
|
+
await commands.executeCommand('editor.action.quickFix');
|
|
755
|
+
await waitForAnimation(() => Boolean(document.querySelector('.p-Widget.p-Menu')), 5000, 'No context menu appeared. (1)');
|
|
756
|
+
await animationFrame();
|
|
757
|
+
|
|
758
|
+
keybindings.dispatchKeyDown('ArrowDown');
|
|
759
|
+
keybindings.dispatchKeyDown('Enter');
|
|
760
|
+
|
|
761
|
+
await waitForAnimation(() => editor.getControl().getModel().getLineContent(30) === 'import * as demoDefinitionsFile from "./demo-definitions-file";', 5000, 'The namespace import did not take effect.');
|
|
762
|
+
|
|
763
|
+
editor.getControl().setSelection(new Selection(30, 1, 30, 64));
|
|
764
|
+
await waitForAnimation(() => isActionAvailable(), 5000, 'No code action available. (2)');
|
|
765
|
+
|
|
766
|
+
// Change it back: https://github.com/eclipse-theia/theia/issues/11059
|
|
767
|
+
await commands.executeCommand('editor.action.quickFix');
|
|
768
|
+
await waitForAnimation(() => Boolean(document.querySelector('.p-Widget.p-Menu')), 5000, 'No context menu appeared. (2)');
|
|
769
|
+
await animationFrame();
|
|
770
|
+
|
|
771
|
+
keybindings.dispatchKeyDown('ArrowDown');
|
|
772
|
+
keybindings.dispatchKeyDown('Enter');
|
|
773
|
+
|
|
774
|
+
await waitForAnimation(() => editor.getControl().getModel().getLineContent(30) === 'import { DefinedInterface } from "./demo-definitions-file";', 5000, 'The named import did not take effect.');
|
|
775
|
+
});
|
|
737
776
|
});
|
|
@@ -64,10 +64,9 @@ describe('Undo, Redo and Select All', function () {
|
|
|
64
64
|
resolve(undefined);
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
const originalValue = preferenceService.get('files.autoSave', undefined, rootUri.toString());
|
|
68
68
|
before(async () => {
|
|
69
|
-
|
|
70
|
-
await preferenceService.set('files.autoSave', 'off', PreferenceScope.User);
|
|
69
|
+
await preferenceService.set('files.autoSave', 'off', undefined, rootUri.toString());
|
|
71
70
|
shell.leftPanelHandler.collapse();
|
|
72
71
|
});
|
|
73
72
|
|
|
@@ -85,7 +84,7 @@ describe('Undo, Redo and Select All', function () {
|
|
|
85
84
|
});
|
|
86
85
|
|
|
87
86
|
after(async () => {
|
|
88
|
-
await preferenceService.set('files.autoSave', originalValue,
|
|
87
|
+
await preferenceService.set('files.autoSave', originalValue, undefined, rootUri.toString());
|
|
89
88
|
shell.leftPanelHandler.collapse();
|
|
90
89
|
});
|
|
91
90
|
|
|
@@ -94,7 +93,7 @@ describe('Undo, Redo and Select All', function () {
|
|
|
94
93
|
*/
|
|
95
94
|
async function assertInEditor(widget) {
|
|
96
95
|
const originalContent = widget.editor.document.getText();
|
|
97
|
-
const editor = /** @type {MonacoEditor}
|
|
96
|
+
const editor = /** @type {MonacoEditor} */ (MonacoEditor.get(widget));
|
|
98
97
|
editor.getControl().pushUndoStop();
|
|
99
98
|
editor.getControl().executeEdits('test', [{
|
|
100
99
|
range: new Range(1, 1, 1, 1),
|