@theia/api-tests 1.27.0-next.4 → 1.27.0-next.41
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-next.
|
|
3
|
+
"version": "1.27.0-next.41+f6c0689dde8",
|
|
4
4
|
"description": "Theia API tests",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.27.0-next.
|
|
6
|
+
"@theia/core": "1.27.0-next.41+f6c0689dde8"
|
|
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": "f6c0689dde8b207726deab75bc3cb5cfdae6acfb"
|
|
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
|
@@ -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
|
});
|
|
@@ -94,7 +94,7 @@ describe('Undo, Redo and Select All', function () {
|
|
|
94
94
|
*/
|
|
95
95
|
async function assertInEditor(widget) {
|
|
96
96
|
const originalContent = widget.editor.document.getText();
|
|
97
|
-
const editor = /** @type {MonacoEditor}
|
|
97
|
+
const editor = /** @type {MonacoEditor} */ (MonacoEditor.get(widget));
|
|
98
98
|
editor.getControl().pushUndoStop();
|
|
99
99
|
editor.getControl().executeEdits('test', [{
|
|
100
100
|
range: new Range(1, 1, 1, 1),
|