@theia/plugin-ext 1.30.0-next.7 → 1.30.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/lib/common/plugin-api-rpc-model.d.ts +5 -0
- package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc-model.js +6 -1
- package/lib/common/plugin-api-rpc-model.js.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +18 -3
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts +5 -3
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.js +17 -5
- package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
- package/lib/main/browser/languages-main.d.ts +2 -1
- package/lib/main/browser/languages-main.d.ts.map +1 -1
- package/lib/main/browser/languages-main.js +17 -2
- package/lib/main/browser/languages-main.js.map +1 -1
- package/lib/main/browser/plugin-frontend-view-contribution.d.ts.map +1 -1
- package/lib/main/browser/plugin-frontend-view-contribution.js +1 -2
- package/lib/main/browser/plugin-frontend-view-contribution.js.map +1 -1
- package/lib/main/browser/quick-open-main.d.ts.map +1 -1
- package/lib/main/browser/quick-open-main.js +4 -5
- package/lib/main/browser/quick-open-main.js.map +1 -1
- package/lib/main/browser/terminal-main.d.ts +2 -0
- package/lib/main/browser/terminal-main.d.ts.map +1 -1
- package/lib/main/browser/terminal-main.js +9 -0
- package/lib/main/browser/terminal-main.js.map +1 -1
- package/lib/plugin/file-system-event-service-ext-impl.js.map +1 -1
- package/lib/plugin/languages/code-action.d.ts.map +1 -1
- package/lib/plugin/languages/code-action.js +2 -1
- package/lib/plugin/languages/code-action.js.map +1 -1
- package/lib/plugin/languages.d.ts.map +1 -1
- package/lib/plugin/languages.js +8 -2
- package/lib/plugin/languages.js.map +1 -1
- package/lib/plugin/output-channel/output-channel-item.d.ts +1 -1
- package/lib/plugin/output-channel/output-channel-item.d.ts.map +1 -1
- package/lib/plugin/output-channel/output-channel-item.js +4 -1
- package/lib/plugin/output-channel/output-channel-item.js.map +1 -1
- package/lib/plugin/quick-open.d.ts +20 -10
- package/lib/plugin/quick-open.d.ts.map +1 -1
- package/lib/plugin/quick-open.js +49 -2
- package/lib/plugin/quick-open.js.map +1 -1
- package/lib/plugin/terminal-ext.d.ts.map +1 -1
- package/lib/plugin/terminal-ext.js +10 -0
- package/lib/plugin/terminal-ext.js.map +1 -1
- package/lib/plugin/tree/tree-views.js +1 -1
- package/lib/plugin/tree/tree-views.js.map +1 -1
- package/lib/plugin/type-converters.d.ts +1 -0
- package/lib/plugin/type-converters.d.ts.map +1 -1
- package/lib/plugin/type-converters.js +13 -3
- package/lib/plugin/type-converters.js.map +1 -1
- package/lib/plugin/webview-views.d.ts +2 -2
- package/lib/plugin/webview-views.d.ts.map +1 -1
- package/lib/plugin/webview-views.js +2 -2
- package/lib/plugin/webview-views.js.map +1 -1
- package/package.json +25 -25
- package/src/common/plugin-api-rpc-model.ts +6 -0
- package/src/common/plugin-api-rpc.ts +21 -4
- package/src/main/browser/custom-editors/custom-editors-main.ts +25 -7
- package/src/main/browser/languages-main.ts +20 -2
- package/src/main/browser/plugin-frontend-view-contribution.ts +1 -2
- package/src/main/browser/quick-open-main.ts +5 -2
- package/src/main/browser/terminal-main.ts +9 -0
- package/src/plugin/file-system-event-service-ext-impl.ts +2 -2
- package/src/plugin/languages/code-action.ts +2 -1
- package/src/plugin/languages.ts +10 -2
- package/src/plugin/output-channel/output-channel-item.ts +4 -1
- package/src/plugin/quick-open.ts +59 -10
- package/src/plugin/terminal-ext.ts +9 -0
- package/src/plugin/tree/tree-views.ts +1 -1
- package/src/plugin/type-converters.ts +12 -1
- package/src/plugin/webview-views.ts +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webview-views.js","sourceRoot":"","sources":["../../src/plugin/webview-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/package.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/plugin-ext",
|
|
3
|
-
"version": "1.30.0
|
|
3
|
+
"version": "1.30.0",
|
|
4
4
|
"description": "Theia - Plugin Extension",
|
|
5
5
|
"main": "lib/common/index.js",
|
|
6
6
|
"typings": "lib/common/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@theia/bulk-edit": "1.30.0
|
|
9
|
-
"@theia/callhierarchy": "1.30.0
|
|
10
|
-
"@theia/console": "1.30.0
|
|
11
|
-
"@theia/core": "1.30.0
|
|
12
|
-
"@theia/debug": "1.30.0
|
|
13
|
-
"@theia/editor": "1.30.0
|
|
14
|
-
"@theia/file-search": "1.30.0
|
|
15
|
-
"@theia/filesystem": "1.30.0
|
|
16
|
-
"@theia/markers": "1.30.0
|
|
17
|
-
"@theia/messages": "1.30.0
|
|
18
|
-
"@theia/monaco": "1.30.0
|
|
8
|
+
"@theia/bulk-edit": "1.30.0",
|
|
9
|
+
"@theia/callhierarchy": "1.30.0",
|
|
10
|
+
"@theia/console": "1.30.0",
|
|
11
|
+
"@theia/core": "1.30.0",
|
|
12
|
+
"@theia/debug": "1.30.0",
|
|
13
|
+
"@theia/editor": "1.30.0",
|
|
14
|
+
"@theia/file-search": "1.30.0",
|
|
15
|
+
"@theia/filesystem": "1.30.0",
|
|
16
|
+
"@theia/markers": "1.30.0",
|
|
17
|
+
"@theia/messages": "1.30.0",
|
|
18
|
+
"@theia/monaco": "1.30.0",
|
|
19
19
|
"@theia/monaco-editor-core": "1.67.2",
|
|
20
|
-
"@theia/navigator": "1.30.0
|
|
21
|
-
"@theia/output": "1.30.0
|
|
22
|
-
"@theia/plugin": "1.30.0
|
|
23
|
-
"@theia/preferences": "1.30.0
|
|
24
|
-
"@theia/scm": "1.30.0
|
|
25
|
-
"@theia/search-in-workspace": "1.30.0
|
|
26
|
-
"@theia/task": "1.30.0
|
|
27
|
-
"@theia/terminal": "1.30.0
|
|
28
|
-
"@theia/timeline": "1.30.0
|
|
29
|
-
"@theia/variable-resolver": "1.30.0
|
|
30
|
-
"@theia/workspace": "1.30.0
|
|
20
|
+
"@theia/navigator": "1.30.0",
|
|
21
|
+
"@theia/output": "1.30.0",
|
|
22
|
+
"@theia/plugin": "1.30.0",
|
|
23
|
+
"@theia/preferences": "1.30.0",
|
|
24
|
+
"@theia/scm": "1.30.0",
|
|
25
|
+
"@theia/search-in-workspace": "1.30.0",
|
|
26
|
+
"@theia/task": "1.30.0",
|
|
27
|
+
"@theia/terminal": "1.30.0",
|
|
28
|
+
"@theia/timeline": "1.30.0",
|
|
29
|
+
"@theia/variable-resolver": "1.30.0",
|
|
30
|
+
"@theia/workspace": "1.30.0",
|
|
31
31
|
"@types/mime": "^2.0.1",
|
|
32
32
|
"@vscode/debugprotocol": "^1.51.0",
|
|
33
33
|
"decompress": "^4.2.1",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"watch": "theiaext watch"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"@theia/ext-scripts": "1.
|
|
87
|
+
"@theia/ext-scripts": "1.30.0",
|
|
88
88
|
"@types/decompress": "^4.2.2",
|
|
89
89
|
"@types/escape-html": "^0.0.20",
|
|
90
90
|
"@types/lodash.clonedeep": "^4.5.3",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"nyc": {
|
|
95
95
|
"extends": "../../configs/nyc.json"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "1b32ca5626bb8252143b7a6ad6b513410f49366e"
|
|
98
98
|
}
|
|
@@ -356,8 +356,14 @@ export interface CodeAction {
|
|
|
356
356
|
isPreferred?: boolean;
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
+
export enum CodeActionTriggerKind {
|
|
360
|
+
Invoke = 1,
|
|
361
|
+
Automatic = 2,
|
|
362
|
+
}
|
|
363
|
+
|
|
359
364
|
export interface CodeActionContext {
|
|
360
365
|
only?: string;
|
|
366
|
+
trigger: CodeActionTriggerKind
|
|
361
367
|
}
|
|
362
368
|
|
|
363
369
|
export type CodeActionProviderDocumentation = ReadonlyArray<{ command: Command, kind: string }>;
|
|
@@ -100,7 +100,7 @@ import type {
|
|
|
100
100
|
import { SerializableEnvironmentVariableCollection } from '@theia/terminal/lib/common/base-terminal-protocol';
|
|
101
101
|
import { ThemeType } from '@theia/core/lib/common/theme';
|
|
102
102
|
import { Disposable } from '@theia/core/lib/common/disposable';
|
|
103
|
-
import { PickOptions, QuickInputButtonHandle
|
|
103
|
+
import { PickOptions, QuickInputButtonHandle } from '@theia/core/lib/common';
|
|
104
104
|
import { Severity } from '@theia/core/lib/common/severity';
|
|
105
105
|
|
|
106
106
|
export interface PreferenceData {
|
|
@@ -333,6 +333,13 @@ export interface TerminalServiceMain {
|
|
|
333
333
|
*/
|
|
334
334
|
$dispose(id: string): void;
|
|
335
335
|
|
|
336
|
+
/**
|
|
337
|
+
* Set the terminal widget name.
|
|
338
|
+
* @param id terminal widget id.
|
|
339
|
+
* @param name new terminal widget name.
|
|
340
|
+
*/
|
|
341
|
+
$setName(id: string, name: string): void;
|
|
342
|
+
|
|
336
343
|
/**
|
|
337
344
|
* Send text to the terminal by id.
|
|
338
345
|
* @param id - terminal id.
|
|
@@ -377,6 +384,13 @@ export interface TerminalServiceMain {
|
|
|
377
384
|
$disposeByTerminalId(id: number, waitOnExit?: boolean | string): void;
|
|
378
385
|
|
|
379
386
|
$setEnvironmentVariableCollection(extensionIdentifier: string, persistent: boolean, collection: SerializableEnvironmentVariableCollection | undefined): void;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Set the terminal widget name.
|
|
390
|
+
* @param id terminal id.
|
|
391
|
+
* @param name new terminal widget name.
|
|
392
|
+
*/
|
|
393
|
+
$setNameByTerminalId(id: number, name: string): void;
|
|
380
394
|
}
|
|
381
395
|
|
|
382
396
|
export interface AutoFocus {
|
|
@@ -431,12 +445,13 @@ export interface QuickOpenExt {
|
|
|
431
445
|
$acceptDidChangeValue(sessionId: number, changedValue: string): Promise<void>;
|
|
432
446
|
$acceptOnDidHide(sessionId: number): Promise<void>;
|
|
433
447
|
$acceptOnDidTriggerButton(sessionId: number, btn: QuickInputButtonHandle): Promise<void>;
|
|
448
|
+
$onDidTriggerItemButton(sessionId: number, itemHandle: number, buttonHandle: number): void;
|
|
434
449
|
$onDidChangeActive(sessionId: number, handles: number[]): void;
|
|
435
450
|
$onDidChangeSelection(sessionId: number, handles: number[]): void;
|
|
436
451
|
|
|
437
452
|
/* eslint-disable max-len */
|
|
438
453
|
showQuickPick(itemsOrItemsPromise: Array<theia.QuickPickItem> | Promise<Array<theia.QuickPickItem>>, options: theia.QuickPickOptions & { canPickMany: true; },
|
|
439
|
-
token?: theia.CancellationToken): Promise<Array<QuickPickItem> | undefined>;
|
|
454
|
+
token?: theia.CancellationToken): Promise<Array<theia.QuickPickItem> | undefined>;
|
|
440
455
|
showQuickPick(itemsOrItemsPromise: string[] | Promise<string[]>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<string | undefined>;
|
|
441
456
|
showQuickPick(itemsOrItemsPromise: Array<theia.QuickPickItem> | Promise<Array<theia.QuickPickItem>>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<theia.QuickPickItem | undefined>;
|
|
442
457
|
showQuickPick(itemsOrItemsPromise: Item[] | Promise<Item[]>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<Item | Item[] | undefined>;
|
|
@@ -572,7 +587,8 @@ export interface TransferQuickPickSeparator extends theia.QuickPickItem {
|
|
|
572
587
|
}
|
|
573
588
|
|
|
574
589
|
export interface TransferQuickInputButton extends theia.QuickInputButton {
|
|
575
|
-
iconPath: theia.Uri | { light: theia.Uri, dark: theia.Uri } | ThemeIcon
|
|
590
|
+
iconPath: theia.Uri | { light: theia.Uri, dark: theia.Uri } | ThemeIcon;
|
|
591
|
+
iconClass?: string;
|
|
576
592
|
handle?: number;
|
|
577
593
|
}
|
|
578
594
|
|
|
@@ -1562,7 +1578,8 @@ export interface LanguagesMain {
|
|
|
1562
1578
|
$emitCodeLensEvent(eventHandle: number, event?: any): void;
|
|
1563
1579
|
$registerOutlineSupport(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[], displayName?: string): void;
|
|
1564
1580
|
$registerWorkspaceSymbolProvider(handle: number, pluginInfo: PluginInfo): void;
|
|
1565
|
-
$registerFoldingRangeProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[]): void;
|
|
1581
|
+
$registerFoldingRangeProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[], eventHandle?: number): void;
|
|
1582
|
+
$emitFoldingRangeEvent(handle: number, event?: any): void;
|
|
1566
1583
|
$registerSelectionRangeProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[]): void;
|
|
1567
1584
|
$registerDocumentColorProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[]): void;
|
|
1568
1585
|
$registerRenameProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[], supportsResolveInitialValues: boolean): void;
|
|
@@ -25,7 +25,7 @@ import { RPCProtocol } from '../../../common/rpc-protocol';
|
|
|
25
25
|
import { HostedPluginSupport } from '../../../hosted/browser/hosted-plugin';
|
|
26
26
|
import { PluginCustomEditorRegistry } from './plugin-custom-editor-registry';
|
|
27
27
|
import { CustomEditorWidget } from './custom-editor-widget';
|
|
28
|
-
import { Emitter } from '@theia/core';
|
|
28
|
+
import { Emitter, UNTITLED_SCHEME } from '@theia/core';
|
|
29
29
|
import { UriComponents } from '../../../common/uri-components';
|
|
30
30
|
import { URI } from '@theia/core/shared/vscode-uri';
|
|
31
31
|
import TheiaURI from '@theia/core/lib/common/uri';
|
|
@@ -185,7 +185,7 @@ export class CustomEditorsMainImpl implements CustomEditorsMain, Disposable {
|
|
|
185
185
|
|
|
186
186
|
switch (modelType) {
|
|
187
187
|
case CustomEditorModelType.Text: {
|
|
188
|
-
const model = CustomTextEditorModel.create(viewType, resource, this.textModelService, this.fileService);
|
|
188
|
+
const model = CustomTextEditorModel.create(viewType, resource, this.textModelService, this.fileService, this.editorPreferences);
|
|
189
189
|
return this.customEditorService.models.add(resource, viewType, model);
|
|
190
190
|
}
|
|
191
191
|
case CustomEditorModelType.Custom: {
|
|
@@ -505,7 +505,7 @@ export class MainCustomEditorModel implements CustomEditorModel {
|
|
|
505
505
|
this.onDirtyChangedEmitter.fire();
|
|
506
506
|
}
|
|
507
507
|
|
|
508
|
-
if (this.autoSave !== 'off') {
|
|
508
|
+
if (this.autoSave !== 'off' && this.dirty && this.resource.scheme !== UNTITLED_SCHEME) {
|
|
509
509
|
const handle = window.setTimeout(() => {
|
|
510
510
|
this.save();
|
|
511
511
|
window.clearTimeout(handle);
|
|
@@ -520,24 +520,27 @@ export class CustomTextEditorModel implements CustomEditorModel {
|
|
|
520
520
|
private readonly toDispose = new DisposableCollection();
|
|
521
521
|
private readonly onDirtyChangedEmitter = new Emitter<void>();
|
|
522
522
|
readonly onDirtyChanged = this.onDirtyChangedEmitter.event;
|
|
523
|
-
|
|
523
|
+
autoSave: 'off' | 'afterDelay' | 'onFocusChange' | 'onWindowChange';
|
|
524
|
+
autoSaveDelay: number;
|
|
524
525
|
|
|
525
526
|
static async create(
|
|
526
527
|
viewType: string,
|
|
527
528
|
resource: TheiaURI,
|
|
528
529
|
editorModelService: EditorModelService,
|
|
529
|
-
fileService: FileService
|
|
530
|
+
fileService: FileService,
|
|
531
|
+
editorPreferences: EditorPreferences,
|
|
530
532
|
): Promise<CustomTextEditorModel> {
|
|
531
533
|
const model = await editorModelService.createModelReference(resource);
|
|
532
534
|
model.object.suppressOpenEditorWhenDirty = true;
|
|
533
|
-
return new CustomTextEditorModel(viewType, resource, model, fileService);
|
|
535
|
+
return new CustomTextEditorModel(viewType, resource, model, fileService, editorPreferences);
|
|
534
536
|
}
|
|
535
537
|
|
|
536
538
|
constructor(
|
|
537
539
|
readonly viewType: string,
|
|
538
540
|
readonly editorResource: TheiaURI,
|
|
539
541
|
private readonly model: Reference<MonacoEditorModel>,
|
|
540
|
-
private readonly fileService: FileService
|
|
542
|
+
private readonly fileService: FileService,
|
|
543
|
+
private readonly editorPreferences: EditorPreferences
|
|
541
544
|
) {
|
|
542
545
|
this.toDispose.push(
|
|
543
546
|
this.editorTextModel.onDirtyChanged(e => {
|
|
@@ -545,6 +548,21 @@ export class CustomTextEditorModel implements CustomEditorModel {
|
|
|
545
548
|
})
|
|
546
549
|
);
|
|
547
550
|
this.toDispose.push(this.onDirtyChangedEmitter);
|
|
551
|
+
|
|
552
|
+
this.autoSave = this.editorPreferences.get('files.autoSave', undefined, editorResource.toString());
|
|
553
|
+
this.autoSaveDelay = this.editorPreferences.get('files.autoSaveDelay', undefined, editorResource.toString());
|
|
554
|
+
|
|
555
|
+
this.toDispose.push(
|
|
556
|
+
this.editorPreferences.onPreferenceChanged(event => {
|
|
557
|
+
if (event.preferenceName === 'files.autoSave') {
|
|
558
|
+
this.autoSave = this.editorPreferences.get('files.autoSave', undefined, editorResource.toString());
|
|
559
|
+
}
|
|
560
|
+
if (event.preferenceName === 'files.autoSaveDelay') {
|
|
561
|
+
this.autoSaveDelay = this.editorPreferences.get('files.autoSaveDelay', undefined, editorResource.toString());
|
|
562
|
+
}
|
|
563
|
+
})
|
|
564
|
+
);
|
|
565
|
+
this.toDispose.push(this.onDirtyChangedEmitter);
|
|
548
566
|
}
|
|
549
567
|
|
|
550
568
|
dispose(): void {
|
|
@@ -69,6 +69,7 @@ import { LanguageSelector, RelativePattern } from '@theia/editor/lib/common/lang
|
|
|
69
69
|
import { ILanguageFeaturesService } from '@theia/monaco-editor-core/esm/vs/editor/common/services/languageFeatures';
|
|
70
70
|
import { EvaluatableExpression, EvaluatableExpressionProvider } from '@theia/monaco-editor-core/esm/vs/editor/common/languages';
|
|
71
71
|
import { ITextModel } from '@theia/monaco-editor-core/esm/vs/editor/common/model';
|
|
72
|
+
import { CodeActionTriggerKind } from '../../plugin/types-impl';
|
|
72
73
|
|
|
73
74
|
/**
|
|
74
75
|
* @monaco-uplift The public API declares these functions as (languageId: string, service).
|
|
@@ -678,9 +679,16 @@ export class LanguagesMainImpl implements LanguagesMain, Disposable {
|
|
|
678
679
|
return this.proxy.$provideOnTypeFormattingEdits(handle, model.uri, position, ch, options, token);
|
|
679
680
|
}
|
|
680
681
|
|
|
681
|
-
$registerFoldingRangeProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[]): void {
|
|
682
|
+
$registerFoldingRangeProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[], eventHandle: number | undefined): void {
|
|
682
683
|
const languageSelector = this.toLanguageSelector(selector);
|
|
683
684
|
const provider = this.createFoldingRangeProvider(handle);
|
|
685
|
+
|
|
686
|
+
if (typeof eventHandle === 'number') {
|
|
687
|
+
const emitter = new Emitter<monaco.languages.FoldingRangeProvider>();
|
|
688
|
+
this.services.set(eventHandle, emitter);
|
|
689
|
+
provider.onDidChange = emitter.event;
|
|
690
|
+
}
|
|
691
|
+
|
|
684
692
|
this.register(handle, (monaco.languages.registerFoldingRangeProvider as RegistrationFunction<monaco.languages.FoldingRangeProvider>)(languageSelector, provider));
|
|
685
693
|
}
|
|
686
694
|
|
|
@@ -690,6 +698,13 @@ export class LanguagesMainImpl implements LanguagesMain, Disposable {
|
|
|
690
698
|
};
|
|
691
699
|
}
|
|
692
700
|
|
|
701
|
+
$emitFoldingRangeEvent(eventHandle: number, event?: unknown): void {
|
|
702
|
+
const obj = this.services.get(eventHandle);
|
|
703
|
+
if (obj instanceof Emitter) {
|
|
704
|
+
obj.fire(event);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
|
|
693
708
|
protected provideFoldingRanges(handle: number, model: monaco.editor.ITextModel,
|
|
694
709
|
context: monaco.languages.FoldingContext, token: monaco.CancellationToken): monaco.languages.ProviderResult<monaco.languages.FoldingRange[]> {
|
|
695
710
|
return this.proxy.$provideFoldingRange(handle, model.uri, context, token);
|
|
@@ -782,7 +797,10 @@ export class LanguagesMainImpl implements LanguagesMain, Disposable {
|
|
|
782
797
|
rangeOrSelection: Range, context: monaco.languages.CodeActionContext,
|
|
783
798
|
token: monaco.CancellationToken): Promise<monaco.languages.CodeActionList | monaco.languages.CodeActionList> {
|
|
784
799
|
const actions = await this.proxy.$provideCodeActions(handle, model.uri, rangeOrSelection, {
|
|
785
|
-
...context
|
|
800
|
+
...context,
|
|
801
|
+
// @monaco-uplift
|
|
802
|
+
// the current version of monaco.languages.CodeActionContext has no CodeActionTriggerKind
|
|
803
|
+
trigger: CodeActionTriggerKind.Automatic
|
|
786
804
|
}, token);
|
|
787
805
|
if (!actions) {
|
|
788
806
|
return undefined!;
|
|
@@ -39,7 +39,7 @@ import { DisposableCollection, Disposable } from '@theia/core/lib/common/disposa
|
|
|
39
39
|
import { CancellationToken } from '@theia/core/lib/common/cancellation';
|
|
40
40
|
import { MonacoQuickInputService } from '@theia/monaco/lib/browser/monaco-quick-input-service';
|
|
41
41
|
import { QuickInputButtons } from '../../plugin/types-impl';
|
|
42
|
-
import {
|
|
42
|
+
import { getIconPathOrClass } from '../../plugin/quick-open';
|
|
43
43
|
import * as monaco from '@theia/monaco-editor-core';
|
|
44
44
|
import { IQuickPickItem, IQuickInput } from '@theia/monaco-editor-core/esm/vs/base/parts/quickinput/common/quickInput';
|
|
45
45
|
import { ThemeIcon } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService';
|
|
@@ -210,6 +210,9 @@ export class QuickOpenMainImpl implements QuickOpenMain, Disposable {
|
|
|
210
210
|
quickPick.onDidTriggerButton((button: QuickInputButtonHandle) => {
|
|
211
211
|
this.proxy.$acceptOnDidTriggerButton(sessionId, button);
|
|
212
212
|
});
|
|
213
|
+
quickPick.onDidTriggerItemButton(e => {
|
|
214
|
+
this.proxy.$onDidTriggerItemButton(sessionId, (e.item as TransferQuickPickItems).handle, (e.button as TransferQuickPickItems).handle);
|
|
215
|
+
});
|
|
213
216
|
quickPick.onDidChangeValue((value: string) => {
|
|
214
217
|
this.proxy.$acceptDidChangeValue(sessionId, value);
|
|
215
218
|
});
|
|
@@ -313,7 +316,7 @@ export class QuickOpenMainImpl implements QuickOpenMain, Disposable {
|
|
|
313
316
|
|
|
314
317
|
private convertToQuickInputButtons(buttons: Array<TransferQuickInputButton>): Array<QuickInputButton> {
|
|
315
318
|
return buttons.map((button, i) => ({
|
|
316
|
-
|
|
319
|
+
...getIconPathOrClass(button),
|
|
317
320
|
tooltip: button.tooltip,
|
|
318
321
|
handle: button === QuickInputButtons.Back ? -1 : i,
|
|
319
322
|
} as QuickInputButton));
|
|
@@ -125,6 +125,7 @@ export class TerminalServiceMainImpl implements TerminalServiceMain, Disposable
|
|
|
125
125
|
shellArgs: options.shellArgs,
|
|
126
126
|
cwd: new URI(options.cwd),
|
|
127
127
|
env: options.env,
|
|
128
|
+
strictEnv: options.strictEnv,
|
|
128
129
|
destroyTermOnClose: true,
|
|
129
130
|
useServerTitle: false,
|
|
130
131
|
attributes: options.attributes,
|
|
@@ -179,6 +180,10 @@ export class TerminalServiceMainImpl implements TerminalServiceMain, Disposable
|
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
182
|
|
|
183
|
+
$setName(id: string, name: string): void {
|
|
184
|
+
this.terminals.getById(id)?.setTitle(name);
|
|
185
|
+
}
|
|
186
|
+
|
|
182
187
|
$sendTextByTerminalId(id: number, text: string, addNewLine?: boolean): void {
|
|
183
188
|
const terminal = this.terminals.getByTerminalId(id);
|
|
184
189
|
if (terminal) {
|
|
@@ -232,4 +237,8 @@ export class TerminalServiceMainImpl implements TerminalServiceMain, Disposable
|
|
|
232
237
|
terminal.dispose();
|
|
233
238
|
}
|
|
234
239
|
}
|
|
240
|
+
|
|
241
|
+
$setNameByTerminalId(id: number, name: string): void {
|
|
242
|
+
this.terminals.getByTerminalId(id)?.setTitle(name);
|
|
243
|
+
}
|
|
235
244
|
}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
29
29
|
/* eslint-disable @typescript-eslint/tslint/config */
|
|
30
30
|
|
|
31
|
-
import { Emitter, WaitUntilEvent, AsyncEmitter } from '@theia/core/lib/common/event';
|
|
31
|
+
import { Emitter, WaitUntilEvent, AsyncEmitter, WaitUntilData } from '@theia/core/lib/common/event';
|
|
32
32
|
import { IRelativePattern, parse } from '@theia/core/lib/common/glob';
|
|
33
33
|
import { UriComponents } from '@theia/core/shared/vscode-uri';
|
|
34
34
|
import { Disposable, URI, WorkspaceEdit } from './types-impl';
|
|
@@ -222,7 +222,7 @@ export class ExtHostFileSystemEventService implements ExtHostFileSystemEventServ
|
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
private async _fireWillEvent<E extends IWaitUntil>(emitter: AsyncEmitter<E>, data:
|
|
225
|
+
private async _fireWillEvent<E extends IWaitUntil>(emitter: AsyncEmitter<E>, data: WaitUntilData<E>, timeout: number, token: CancellationToken): Promise<any> {
|
|
226
226
|
|
|
227
227
|
const edits: WorkspaceEdit[] = [];
|
|
228
228
|
await emitter.fire(data, token, async (thenable, listener) => {
|
|
@@ -61,7 +61,8 @@ export class CodeActionAdapter {
|
|
|
61
61
|
|
|
62
62
|
const codeActionContext: theia.CodeActionContext = {
|
|
63
63
|
diagnostics: allDiagnostics,
|
|
64
|
-
only: context.only ? new CodeActionKind(context.only) : undefined
|
|
64
|
+
only: context.only ? new CodeActionKind(context.only) : undefined,
|
|
65
|
+
triggerKind: Converter.toCodeActionTriggerKind(context.trigger)
|
|
65
66
|
};
|
|
66
67
|
|
|
67
68
|
const commandsOrActions = await this.provider.provideCodeActions(doc, ran, codeActionContext, token);
|
package/src/plugin/languages.ts
CHANGED
|
@@ -582,8 +582,16 @@ export class LanguagesExtImpl implements LanguagesExt {
|
|
|
582
582
|
// ### Folding Range Provider begin
|
|
583
583
|
registerFoldingRangeProvider(selector: theia.DocumentSelector, provider: theia.FoldingRangeProvider, pluginInfo: PluginInfo): theia.Disposable {
|
|
584
584
|
const callId = this.addNewAdapter(new FoldingProviderAdapter(provider, this.documents));
|
|
585
|
-
|
|
586
|
-
|
|
585
|
+
const eventHandle = typeof provider.onDidChangeFoldingRanges === 'function' ? this.nextCallId() : undefined;
|
|
586
|
+
|
|
587
|
+
this.proxy.$registerFoldingRangeProvider(callId, pluginInfo, this.transformDocumentSelector(selector), eventHandle);
|
|
588
|
+
let result = this.createDisposable(callId);
|
|
589
|
+
|
|
590
|
+
if (eventHandle !== undefined) {
|
|
591
|
+
const subscription = provider.onDidChangeFoldingRanges!(() => this.proxy.$emitFoldingRangeEvent(eventHandle));
|
|
592
|
+
result = Disposable.from(result, subscription);
|
|
593
|
+
}
|
|
594
|
+
return result;
|
|
587
595
|
}
|
|
588
596
|
|
|
589
597
|
$provideFoldingRange(
|
|
@@ -52,8 +52,11 @@ export class OutputChannelImpl implements theia.OutputChannel {
|
|
|
52
52
|
this.proxy.$clear(this.name);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
show(
|
|
55
|
+
show(preserveFocusOrColumn?: boolean | theia.ViewColumn, preserveFocus?: boolean): void {
|
|
56
56
|
this.validate();
|
|
57
|
+
if (typeof preserveFocusOrColumn === 'boolean') {
|
|
58
|
+
preserveFocus = preserveFocusOrColumn;
|
|
59
|
+
}
|
|
57
60
|
this.proxy.$reveal(this.name, !!preserveFocus);
|
|
58
61
|
}
|
|
59
62
|
|
package/src/plugin/quick-open.ts
CHANGED
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
Item, TransferQuickInputButton, TransferQuickPickItems, TransferQuickInput
|
|
20
20
|
} from '../common/plugin-api-rpc';
|
|
21
21
|
import * as theia from '@theia/plugin';
|
|
22
|
-
import { QuickPickItem, InputBoxOptions, InputBox, QuickPick, QuickInput } from '@theia/plugin';
|
|
23
22
|
import { CancellationToken } from '@theia/core/lib/common/cancellation';
|
|
24
23
|
import { RPCProtocol } from '../common/rpc-protocol';
|
|
25
24
|
import { Emitter, Event } from '@theia/core/lib/common/event';
|
|
@@ -32,6 +31,7 @@ import { PluginPackage } from '../common/plugin-protocol';
|
|
|
32
31
|
import { QuickInputButtonHandle } from '@theia/core/lib/browser';
|
|
33
32
|
import { MaybePromise } from '@theia/core/lib/common/types';
|
|
34
33
|
import Severity from '@theia/monaco-editor-core/esm/vs/base/common/severity';
|
|
34
|
+
import { ThemeIcon as MonacoThemeIcon } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService';
|
|
35
35
|
|
|
36
36
|
const canceledName = 'Canceled';
|
|
37
37
|
/**
|
|
@@ -63,6 +63,22 @@ export function getDarkIconUri(iconPath: URI | { light: URI; dark: URI; }): URI
|
|
|
63
63
|
return typeof iconPath === 'object' && 'dark' in iconPath ? iconPath.dark : iconPath;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
export function getIconPathOrClass(button: theia.QuickInputButton): { iconPath: { dark: URI; light?: URI | undefined; } | undefined; iconClass: string | undefined; } {
|
|
67
|
+
const iconPathOrIconClass = getIconUris(button.iconPath);
|
|
68
|
+
let iconPath: { dark: URI; light?: URI | undefined } | undefined;
|
|
69
|
+
let iconClass: string | undefined;
|
|
70
|
+
if ('id' in iconPathOrIconClass) {
|
|
71
|
+
iconClass = MonacoThemeIcon.asClassName(iconPathOrIconClass);
|
|
72
|
+
} else {
|
|
73
|
+
iconPath = iconPathOrIconClass;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
iconPath,
|
|
78
|
+
iconClass
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
66
82
|
export class QuickOpenExtImpl implements QuickOpenExt {
|
|
67
83
|
private proxy: QuickOpenMain;
|
|
68
84
|
private onDidSelectItem: undefined | ((handle: number) => void);
|
|
@@ -75,9 +91,9 @@ export class QuickOpenExtImpl implements QuickOpenExt {
|
|
|
75
91
|
}
|
|
76
92
|
|
|
77
93
|
/* eslint-disable max-len */
|
|
78
|
-
showQuickPick(itemsOrItemsPromise: Array<QuickPickItem> | Promise<Array<QuickPickItem>>, options: theia.QuickPickOptions & { canPickMany: true; }, token?: theia.CancellationToken): Promise<Array<QuickPickItem> | undefined>;
|
|
94
|
+
showQuickPick(itemsOrItemsPromise: Array<theia.QuickPickItem> | Promise<Array<theia.QuickPickItem>>, options: theia.QuickPickOptions & { canPickMany: true; }, token?: theia.CancellationToken): Promise<Array<theia.QuickPickItem> | undefined>;
|
|
79
95
|
showQuickPick(itemsOrItemsPromise: string[] | Promise<string[]>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<string | undefined>;
|
|
80
|
-
showQuickPick(itemsOrItemsPromise: Array<QuickPickItem> | Promise<Array<QuickPickItem>>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<QuickPickItem | undefined>;
|
|
96
|
+
showQuickPick(itemsOrItemsPromise: Array<theia.QuickPickItem> | Promise<Array<theia.QuickPickItem>>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<theia.QuickPickItem | undefined>;
|
|
81
97
|
showQuickPick(itemsOrItemsPromise: Item[] | Promise<Item[]>, options?: theia.QuickPickOptions, token: theia.CancellationToken = CancellationToken.None): Promise<Item | Item[] | undefined> {
|
|
82
98
|
this.onDidSelectItem = undefined;
|
|
83
99
|
|
|
@@ -145,7 +161,7 @@ export class QuickOpenExtImpl implements QuickOpenExt {
|
|
|
145
161
|
|
|
146
162
|
// ---- input
|
|
147
163
|
|
|
148
|
-
showInput(options?: InputBoxOptions, token: theia.CancellationToken = CancellationToken.None): PromiseLike<string | undefined> {
|
|
164
|
+
showInput(options?: theia.InputBoxOptions, token: theia.CancellationToken = CancellationToken.None): PromiseLike<string | undefined> {
|
|
149
165
|
this.validateInputHandler = options?.validateInput;
|
|
150
166
|
if (!options) { options = { placeHolder: '' }; }
|
|
151
167
|
return this.proxy.$input(options, typeof this.validateInputHandler === 'function', token);
|
|
@@ -190,13 +206,13 @@ export class QuickOpenExtImpl implements QuickOpenExt {
|
|
|
190
206
|
|
|
191
207
|
// ---- QuickInput
|
|
192
208
|
|
|
193
|
-
createQuickPick<T extends QuickPickItem>(plugin: Plugin): QuickPick<T> {
|
|
209
|
+
createQuickPick<T extends theia.QuickPickItem>(plugin: Plugin): theia.QuickPick<T> {
|
|
194
210
|
const session: any = new QuickPickExt<T>(this, this.proxy, plugin, () => this._sessions.delete(session._id));
|
|
195
211
|
this._sessions.set(session._id, session);
|
|
196
212
|
return session;
|
|
197
213
|
}
|
|
198
214
|
|
|
199
|
-
createInputBox(plugin: Plugin): InputBox {
|
|
215
|
+
createInputBox(plugin: Plugin): theia.InputBox {
|
|
200
216
|
const session: any = new InputBoxExt(this, this.proxy, plugin, () => this._sessions.delete(session._id));
|
|
201
217
|
this._sessions.set(session._id, session);
|
|
202
218
|
return session;
|
|
@@ -252,9 +268,17 @@ export class QuickOpenExtImpl implements QuickOpenExt {
|
|
|
252
268
|
session._fireDidChangeSelection(handles);
|
|
253
269
|
}
|
|
254
270
|
}
|
|
271
|
+
|
|
272
|
+
$onDidTriggerItemButton(sessionId: number, itemHandle: number, buttonHandle: number): void {
|
|
273
|
+
const session = this._sessions.get(sessionId);
|
|
274
|
+
if (session instanceof QuickPickExt) {
|
|
275
|
+
session._fireDidTriggerItemButton(itemHandle, buttonHandle);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
255
279
|
}
|
|
256
280
|
|
|
257
|
-
export class QuickInputExt implements QuickInput {
|
|
281
|
+
export class QuickInputExt implements theia.QuickInput {
|
|
258
282
|
|
|
259
283
|
private static _nextId = 1;
|
|
260
284
|
_id = QuickInputExt._nextId++;
|
|
@@ -389,6 +413,7 @@ export class QuickInputExt implements QuickInput {
|
|
|
389
413
|
this.update({
|
|
390
414
|
buttons: buttons.map<TransferQuickInputButton>((button, i) => ({
|
|
391
415
|
iconPath: getIconUris(button.iconPath),
|
|
416
|
+
iconClass: ThemeIcon.is(button.iconPath) ? MonacoThemeIcon.asClassName(button.iconPath) : undefined,
|
|
392
417
|
tooltip: button.tooltip,
|
|
393
418
|
handle: button === QuickInputButtons.Back ? -1 : i,
|
|
394
419
|
}))
|
|
@@ -514,7 +539,7 @@ export class QuickInputExt implements QuickInput {
|
|
|
514
539
|
* Base implementation of {@link InputBox} that uses {@link QuickOpenExt}.
|
|
515
540
|
* Missing functionality is going to be implemented in the scope of https://github.com/eclipse-theia/theia/issues/5109
|
|
516
541
|
*/
|
|
517
|
-
export class InputBoxExt extends QuickInputExt implements InputBox {
|
|
542
|
+
export class InputBoxExt extends QuickInputExt implements theia.InputBox {
|
|
518
543
|
|
|
519
544
|
private _password: boolean;
|
|
520
545
|
private _prompt: string | undefined;
|
|
@@ -567,7 +592,7 @@ export class InputBoxExt extends QuickInputExt implements InputBox {
|
|
|
567
592
|
* Base implementation of {@link QuickPick} that uses {@link QuickOpenExt}.
|
|
568
593
|
* Missing functionality is going to be implemented in the scope of https://github.com/eclipse-theia/theia/issues/5059
|
|
569
594
|
*/
|
|
570
|
-
export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt implements QuickPick<T> {
|
|
595
|
+
export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt implements theia.QuickPick<T> {
|
|
571
596
|
private _items: T[] = [];
|
|
572
597
|
private _handlesToItems = new Map<number, T>();
|
|
573
598
|
private _itemsToHandles = new Map<T, number>();
|
|
@@ -580,6 +605,7 @@ export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt i
|
|
|
580
605
|
private _selectedItems: T[] = [];
|
|
581
606
|
private readonly _onDidChangeActiveEmitter = new Emitter<T[]>();
|
|
582
607
|
private readonly _onDidChangeSelectionEmitter = new Emitter<T[]>();
|
|
608
|
+
private readonly _onDidTriggerItemButtonEmitter = new Emitter<theia.QuickPickItemButtonEvent<T>>();
|
|
583
609
|
|
|
584
610
|
constructor(
|
|
585
611
|
override readonly quickOpen: QuickOpenExtImpl,
|
|
@@ -592,6 +618,7 @@ export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt i
|
|
|
592
618
|
|
|
593
619
|
this.disposableCollection.push(this._onDidChangeActiveEmitter);
|
|
594
620
|
this.disposableCollection.push(this._onDidChangeSelectionEmitter);
|
|
621
|
+
this.disposableCollection.push(this._onDidTriggerItemButtonEmitter);
|
|
595
622
|
|
|
596
623
|
this.update({ type: 'quickPick' });
|
|
597
624
|
}
|
|
@@ -620,7 +647,13 @@ export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt i
|
|
|
620
647
|
handle: i,
|
|
621
648
|
detail: item.detail,
|
|
622
649
|
picked: item.picked,
|
|
623
|
-
alwaysShow: item.alwaysShow
|
|
650
|
+
alwaysShow: item.alwaysShow,
|
|
651
|
+
buttons: item.buttons?.map<TransferQuickInputButton>((button, index) => ({
|
|
652
|
+
iconPath: getIconUris(button.iconPath),
|
|
653
|
+
iconClass: ThemeIcon.is(button.iconPath) ? MonacoThemeIcon.asClassName(button.iconPath) : undefined,
|
|
654
|
+
tooltip: button.tooltip,
|
|
655
|
+
handle: button === QuickInputButtons.Back ? -1 : index,
|
|
656
|
+
}))
|
|
624
657
|
};
|
|
625
658
|
})
|
|
626
659
|
});
|
|
@@ -704,4 +737,20 @@ export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt i
|
|
|
704
737
|
this._selectedItems = items;
|
|
705
738
|
this._onDidChangeSelectionEmitter.fire(items);
|
|
706
739
|
}
|
|
740
|
+
|
|
741
|
+
onDidTriggerItemButton = this._onDidTriggerItemButtonEmitter.event;
|
|
742
|
+
|
|
743
|
+
_fireDidTriggerItemButton(itemHandle: number, buttonHandle: number): void {
|
|
744
|
+
const item = this._handlesToItems.get(itemHandle)!;
|
|
745
|
+
if (!item || !item.buttons || !item.buttons.length) {
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
const button = item.buttons[buttonHandle];
|
|
749
|
+
if (button) {
|
|
750
|
+
this._onDidTriggerItemButtonEmitter.fire({
|
|
751
|
+
button,
|
|
752
|
+
item
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
}
|
|
707
756
|
}
|
|
@@ -343,6 +343,15 @@ export class PseudoTerminal {
|
|
|
343
343
|
}
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
|
+
if (pseudoTerminal.onDidChangeName) {
|
|
347
|
+
pseudoTerminal.onDidChangeName(name => {
|
|
348
|
+
if (typeof id === 'string') {
|
|
349
|
+
this.proxy.$setName(id, name);
|
|
350
|
+
} else {
|
|
351
|
+
this.proxy.$setNameByTerminalId(id, name);
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
}
|
|
346
355
|
}
|
|
347
356
|
|
|
348
357
|
emitOnClose(): void {
|
|
@@ -192,7 +192,7 @@ class TreeViewExtImpl<T> implements Disposable {
|
|
|
192
192
|
this.toDispose.push(Disposable.create(() => this.proxy.$unregisterTreeDataProvider(treeViewId)));
|
|
193
193
|
|
|
194
194
|
if (treeDataProvider.onDidChangeTreeData) {
|
|
195
|
-
treeDataProvider.onDidChangeTreeData((
|
|
195
|
+
treeDataProvider.onDidChangeTreeData(() => {
|
|
196
196
|
this.pendingRefresh = proxy.$refresh(treeViewId);
|
|
197
197
|
});
|
|
198
198
|
}
|