@theia/plugin-ext 1.53.2 → 1.54.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 +10 -1
- package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc-model.js.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +7 -6
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.js.map +1 -1
- package/lib/common/test-types.d.ts +11 -1
- package/lib/common/test-types.d.ts.map +1 -1
- package/lib/common/test-types.js +9 -1
- package/lib/common/test-types.js.map +1 -1
- package/lib/main/browser/authentication-main.d.ts +6 -6
- package/lib/main/browser/authentication-main.d.ts.map +1 -1
- package/lib/main/browser/authentication-main.js +15 -9
- package/lib/main/browser/authentication-main.js.map +1 -1
- package/lib/main/browser/command-registry-main.d.ts +0 -1
- package/lib/main/browser/command-registry-main.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.d.ts +5 -3
- package/lib/main/browser/custom-editors/custom-editor-opener.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.js +16 -3
- package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts +0 -1
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts +2 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js +6 -2
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-service.d.ts +0 -1
- package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
- package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
- package/lib/main/browser/editors-and-documents-main.js +14 -2
- package/lib/main/browser/editors-and-documents-main.js.map +1 -1
- package/lib/main/browser/languages-main.d.ts +0 -1
- package/lib/main/browser/languages-main.d.ts.map +1 -1
- package/lib/main/browser/menus/plugin-menu-command-adapter.d.ts.map +1 -1
- package/lib/main/browser/menus/plugin-menu-command-adapter.js +2 -2
- package/lib/main/browser/menus/plugin-menu-command-adapter.js.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js +2 -0
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js.map +1 -1
- package/lib/main/browser/notebooks/notebooks-main.d.ts +0 -1
- package/lib/main/browser/notebooks/notebooks-main.d.ts.map +1 -1
- package/lib/main/browser/quick-open-main.d.ts +0 -1
- package/lib/main/browser/quick-open-main.d.ts.map +1 -1
- package/lib/main/browser/tabs/tabs-main.d.ts +1 -1
- package/lib/main/browser/tabs/tabs-main.d.ts.map +1 -1
- package/lib/main/browser/tabs/tabs-main.js +1 -1
- package/lib/main/browser/tabs/tabs-main.js.map +1 -1
- package/lib/main/browser/terminal-main.d.ts +0 -1
- package/lib/main/browser/terminal-main.d.ts.map +1 -1
- package/lib/main/browser/test-main.d.ts.map +1 -1
- package/lib/main/browser/test-main.js.map +1 -1
- package/lib/main/browser/text-editor-main.d.ts +6 -3
- package/lib/main/browser/text-editor-main.d.ts.map +1 -1
- package/lib/main/browser/text-editor-main.js +39 -5
- package/lib/main/browser/text-editor-main.js.map +1 -1
- package/lib/main/browser/view/tree-view-decorator-service.d.ts +0 -1
- package/lib/main/browser/view/tree-view-decorator-service.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.d.ts +0 -1
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-views-main.d.ts +0 -1
- package/lib/main/browser/view/tree-views-main.d.ts.map +1 -1
- package/lib/main/browser/webview/webview.d.ts +0 -1
- package/lib/main/browser/webview/webview.d.ts.map +1 -1
- package/lib/main/browser/webview-views/webview-views-main.d.ts +0 -1
- package/lib/main/browser/webview-views/webview-views-main.d.ts.map +1 -1
- package/lib/main/browser/webviews-main.d.ts +0 -1
- package/lib/main/browser/webviews-main.d.ts.map +1 -1
- package/lib/main/browser/workspace-main.d.ts +0 -1
- package/lib/main/browser/workspace-main.d.ts.map +1 -1
- package/lib/plugin/authentication-ext.d.ts +3 -3
- package/lib/plugin/authentication-ext.d.ts.map +1 -1
- package/lib/plugin/authentication-ext.js +8 -5
- package/lib/plugin/authentication-ext.js.map +1 -1
- package/lib/plugin/clipboard-ext.d.ts +0 -1
- package/lib/plugin/clipboard-ext.d.ts.map +1 -1
- package/lib/plugin/command-registry.d.ts +0 -1
- package/lib/plugin/command-registry.d.ts.map +1 -1
- package/lib/plugin/comments.d.ts +0 -1
- package/lib/plugin/comments.d.ts.map +1 -1
- package/lib/plugin/custom-editors.d.ts +0 -1
- package/lib/plugin/custom-editors.d.ts.map +1 -1
- package/lib/plugin/debug/debug-ext.d.ts +0 -1
- package/lib/plugin/debug/debug-ext.d.ts.map +1 -1
- package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts +0 -1
- package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts.map +1 -1
- package/lib/plugin/debug/plugin-debug-adapter-session.d.ts +0 -1
- package/lib/plugin/debug/plugin-debug-adapter-session.d.ts.map +1 -1
- package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts +0 -1
- package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts.map +1 -1
- package/lib/plugin/decorations.d.ts +0 -1
- package/lib/plugin/decorations.d.ts.map +1 -1
- package/lib/plugin/dialogs.d.ts +0 -1
- package/lib/plugin/dialogs.d.ts.map +1 -1
- package/lib/plugin/document-data.d.ts +0 -1
- package/lib/plugin/document-data.d.ts.map +1 -1
- package/lib/plugin/documents.d.ts +0 -1
- package/lib/plugin/documents.d.ts.map +1 -1
- package/lib/plugin/env.d.ts +0 -1
- package/lib/plugin/env.d.ts.map +1 -1
- package/lib/plugin/file-system-event-service-ext-impl.d.ts +0 -1
- package/lib/plugin/file-system-event-service-ext-impl.d.ts.map +1 -1
- package/lib/plugin/file-system-ext-impl.d.ts +0 -1
- package/lib/plugin/file-system-ext-impl.d.ts.map +1 -1
- package/lib/plugin/label-service.d.ts +0 -1
- package/lib/plugin/label-service.d.ts.map +1 -1
- package/lib/plugin/languages/call-hierarchy.d.ts +0 -1
- package/lib/plugin/languages/call-hierarchy.d.ts.map +1 -1
- package/lib/plugin/languages/code-action.d.ts +0 -1
- package/lib/plugin/languages/code-action.d.ts.map +1 -1
- package/lib/plugin/languages/color.d.ts +0 -1
- package/lib/plugin/languages/color.d.ts.map +1 -1
- package/lib/plugin/languages/completion.d.ts +0 -1
- package/lib/plugin/languages/completion.d.ts.map +1 -1
- package/lib/plugin/languages/declaration.d.ts +0 -1
- package/lib/plugin/languages/declaration.d.ts.map +1 -1
- package/lib/plugin/languages/definition.d.ts +0 -1
- package/lib/plugin/languages/definition.d.ts.map +1 -1
- package/lib/plugin/languages/diagnostics.d.ts +0 -1
- package/lib/plugin/languages/diagnostics.d.ts.map +1 -1
- package/lib/plugin/languages/document-drop-edit.d.ts +0 -1
- package/lib/plugin/languages/document-drop-edit.d.ts.map +1 -1
- package/lib/plugin/languages/document-formatting.d.ts +0 -1
- package/lib/plugin/languages/document-formatting.d.ts.map +1 -1
- package/lib/plugin/languages/document-highlight.d.ts +0 -1
- package/lib/plugin/languages/document-highlight.d.ts.map +1 -1
- package/lib/plugin/languages/evaluatable-expression.d.ts +0 -1
- package/lib/plugin/languages/evaluatable-expression.d.ts.map +1 -1
- package/lib/plugin/languages/folding.d.ts +0 -1
- package/lib/plugin/languages/folding.d.ts.map +1 -1
- package/lib/plugin/languages/hover.d.ts +0 -1
- package/lib/plugin/languages/hover.d.ts.map +1 -1
- package/lib/plugin/languages/implementation.d.ts +0 -1
- package/lib/plugin/languages/implementation.d.ts.map +1 -1
- package/lib/plugin/languages/inlay-hints.d.ts +0 -1
- package/lib/plugin/languages/inlay-hints.d.ts.map +1 -1
- package/lib/plugin/languages/inline-completion.d.ts +0 -1
- package/lib/plugin/languages/inline-completion.d.ts.map +1 -1
- package/lib/plugin/languages/inline-values.d.ts +0 -1
- package/lib/plugin/languages/inline-values.d.ts.map +1 -1
- package/lib/plugin/languages/lens.d.ts +0 -1
- package/lib/plugin/languages/lens.d.ts.map +1 -1
- package/lib/plugin/languages/link-provider.d.ts +0 -1
- package/lib/plugin/languages/link-provider.d.ts.map +1 -1
- package/lib/plugin/languages/linked-editing-range.d.ts +0 -1
- package/lib/plugin/languages/linked-editing-range.d.ts.map +1 -1
- package/lib/plugin/languages/on-type-formatting.d.ts +0 -1
- package/lib/plugin/languages/on-type-formatting.d.ts.map +1 -1
- package/lib/plugin/languages/outline.d.ts +0 -1
- package/lib/plugin/languages/outline.d.ts.map +1 -1
- package/lib/plugin/languages/range-formatting.d.ts +0 -1
- package/lib/plugin/languages/range-formatting.d.ts.map +1 -1
- package/lib/plugin/languages/reference.d.ts +0 -1
- package/lib/plugin/languages/reference.d.ts.map +1 -1
- package/lib/plugin/languages/rename.d.ts +0 -1
- package/lib/plugin/languages/rename.d.ts.map +1 -1
- package/lib/plugin/languages/selection-range.d.ts +0 -1
- package/lib/plugin/languages/selection-range.d.ts.map +1 -1
- package/lib/plugin/languages/semantic-highlighting.d.ts +0 -1
- package/lib/plugin/languages/semantic-highlighting.d.ts.map +1 -1
- package/lib/plugin/languages/signature.d.ts +0 -1
- package/lib/plugin/languages/signature.d.ts.map +1 -1
- package/lib/plugin/languages/type-definition.d.ts +0 -1
- package/lib/plugin/languages/type-definition.d.ts.map +1 -1
- package/lib/plugin/languages/type-hierarchy.d.ts +0 -1
- package/lib/plugin/languages/type-hierarchy.d.ts.map +1 -1
- package/lib/plugin/languages/util.d.ts +0 -1
- package/lib/plugin/languages/util.d.ts.map +1 -1
- package/lib/plugin/languages/workspace-symbol.d.ts +0 -1
- package/lib/plugin/languages/workspace-symbol.d.ts.map +1 -1
- package/lib/plugin/languages-utils.d.ts +0 -1
- package/lib/plugin/languages-utils.d.ts.map +1 -1
- package/lib/plugin/languages.d.ts +0 -1
- package/lib/plugin/languages.d.ts.map +1 -1
- package/lib/plugin/markdown-string.d.ts +0 -1
- package/lib/plugin/markdown-string.d.ts.map +1 -1
- package/lib/plugin/message-registry.d.ts +0 -1
- package/lib/plugin/message-registry.d.ts.map +1 -1
- package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts +0 -1
- package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-document.d.ts +0 -1
- package/lib/plugin/notebook/notebook-document.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-documents.d.ts +0 -1
- package/lib/plugin/notebook/notebook-documents.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-editor.d.ts +0 -1
- package/lib/plugin/notebook/notebook-editor.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-editors.d.ts +0 -1
- package/lib/plugin/notebook/notebook-editors.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-kernels.d.ts +0 -1
- package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -1
- package/lib/plugin/notebook/notebook-renderers.d.ts +0 -1
- package/lib/plugin/notebook/notebook-renderers.d.ts.map +1 -1
- package/lib/plugin/notebook/notebooks.d.ts +1 -1
- package/lib/plugin/notebook/notebooks.d.ts.map +1 -1
- package/lib/plugin/notebook/notebooks.js +22 -2
- package/lib/plugin/notebook/notebooks.js.map +1 -1
- package/lib/plugin/notification.d.ts +0 -1
- package/lib/plugin/notification.d.ts.map +1 -1
- package/lib/plugin/output-channel/log-output-channel.d.ts +0 -1
- package/lib/plugin/output-channel/log-output-channel.d.ts.map +1 -1
- package/lib/plugin/output-channel/output-channel-item.d.ts +0 -1
- package/lib/plugin/output-channel/output-channel-item.d.ts.map +1 -1
- package/lib/plugin/output-channel-registry.d.ts +0 -1
- package/lib/plugin/output-channel-registry.d.ts.map +1 -1
- package/lib/plugin/plugin-context.d.ts +0 -1
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +4 -0
- package/lib/plugin/plugin-context.js.map +1 -1
- package/lib/plugin/plugin-manager.d.ts +0 -1
- package/lib/plugin/plugin-manager.d.ts.map +1 -1
- package/lib/plugin/plugin-storage.d.ts +0 -1
- package/lib/plugin/plugin-storage.d.ts.map +1 -1
- package/lib/plugin/preference-registry.d.ts +0 -1
- package/lib/plugin/preference-registry.d.ts.map +1 -1
- package/lib/plugin/quick-open.d.ts +0 -1
- package/lib/plugin/quick-open.d.ts.map +1 -1
- package/lib/plugin/scm.d.ts +0 -1
- package/lib/plugin/scm.d.ts.map +1 -1
- package/lib/plugin/secrets-ext.d.ts +0 -1
- package/lib/plugin/secrets-ext.d.ts.map +1 -1
- package/lib/plugin/status-bar/status-bar-item.d.ts +0 -1
- package/lib/plugin/status-bar/status-bar-item.d.ts.map +1 -1
- package/lib/plugin/status-bar-message-registry.d.ts +0 -1
- package/lib/plugin/status-bar-message-registry.d.ts.map +1 -1
- package/lib/plugin/tabs.d.ts +0 -1
- package/lib/plugin/tabs.d.ts.map +1 -1
- package/lib/plugin/tasks/task-provider.d.ts +0 -1
- package/lib/plugin/tasks/task-provider.d.ts.map +1 -1
- package/lib/plugin/tasks/tasks.d.ts +0 -1
- package/lib/plugin/tasks/tasks.d.ts.map +1 -1
- package/lib/plugin/terminal-ext.d.ts +1 -1
- package/lib/plugin/terminal-ext.d.ts.map +1 -1
- package/lib/plugin/terminal-ext.js +1 -0
- package/lib/plugin/terminal-ext.js.map +1 -1
- package/lib/plugin/test-item.d.ts +0 -1
- package/lib/plugin/test-item.d.ts.map +1 -1
- package/lib/plugin/tests.d.ts +8 -2
- package/lib/plugin/tests.d.ts.map +1 -1
- package/lib/plugin/tests.js +24 -1
- package/lib/plugin/tests.js.map +1 -1
- package/lib/plugin/text-editor.d.ts +1 -2
- package/lib/plugin/text-editor.d.ts.map +1 -1
- package/lib/plugin/text-editor.js.map +1 -1
- package/lib/plugin/text-editors.d.ts +0 -1
- package/lib/plugin/text-editors.d.ts.map +1 -1
- package/lib/plugin/timeline.d.ts +0 -1
- package/lib/plugin/timeline.d.ts.map +1 -1
- package/lib/plugin/tree/tree-views.d.ts +0 -1
- package/lib/plugin/tree/tree-views.d.ts.map +1 -1
- package/lib/plugin/type-converters.d.ts +13 -2
- package/lib/plugin/type-converters.d.ts.map +1 -1
- package/lib/plugin/type-converters.js +55 -5
- package/lib/plugin/type-converters.js.map +1 -1
- package/lib/plugin/types-impl.d.ts +7 -1
- package/lib/plugin/types-impl.d.ts.map +1 -1
- package/lib/plugin/types-impl.js +9 -1
- package/lib/plugin/types-impl.js.map +1 -1
- package/lib/plugin/uri-ext.d.ts +0 -1
- package/lib/plugin/uri-ext.d.ts.map +1 -1
- package/lib/plugin/webview-views.d.ts +0 -1
- package/lib/plugin/webview-views.d.ts.map +1 -1
- package/lib/plugin/webviews.d.ts +0 -1
- package/lib/plugin/webviews.d.ts.map +1 -1
- package/lib/plugin/window-state.d.ts +0 -1
- package/lib/plugin/window-state.d.ts.map +1 -1
- package/lib/plugin/workspace.d.ts +0 -1
- package/lib/plugin/workspace.d.ts.map +1 -1
- package/package.json +29 -29
- package/src/common/plugin-api-rpc-model.ts +11 -0
- package/src/common/plugin-api-rpc.ts +7 -5
- package/src/common/test-types.ts +15 -1
- package/src/main/browser/authentication-main.ts +24 -11
- package/src/main/browser/custom-editors/custom-editor-opener.tsx +19 -4
- package/src/main/browser/custom-editors/plugin-custom-editor-registry.ts +7 -3
- package/src/main/browser/editors-and-documents-main.ts +25 -2
- package/src/main/browser/menus/plugin-menu-command-adapter.ts +2 -2
- package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +4 -1
- package/src/main/browser/tabs/tabs-main.ts +6 -2
- package/src/main/browser/test-main.ts +4 -1
- package/src/main/browser/text-editor-main.ts +55 -14
- package/src/plugin/authentication-ext.ts +9 -5
- package/src/plugin/notebook/notebooks.ts +21 -0
- package/src/plugin/plugin-context.ts +6 -1
- package/src/plugin/terminal-ext.ts +1 -0
- package/src/plugin/tests.ts +34 -3
- package/src/plugin/text-editor.ts +1 -1
- package/src/plugin/type-converters.ts +58 -6
- package/src/plugin/types-impl.ts +10 -1
|
@@ -72,6 +72,17 @@ export interface Range {
|
|
|
72
72
|
readonly endColumn: number;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
export interface Position {
|
|
76
|
+
/**
|
|
77
|
+
* line number (starts at 1)
|
|
78
|
+
*/
|
|
79
|
+
readonly lineNumber: number,
|
|
80
|
+
/**
|
|
81
|
+
* column (starts at 1)
|
|
82
|
+
*/
|
|
83
|
+
readonly column: number
|
|
84
|
+
}
|
|
85
|
+
|
|
75
86
|
export { MarkdownStringDTO as MarkdownString };
|
|
76
87
|
|
|
77
88
|
export interface SerializedDocumentFilter {
|
|
@@ -805,9 +805,9 @@ export interface RegisterTreeDataProviderOptions {
|
|
|
805
805
|
}
|
|
806
806
|
|
|
807
807
|
export interface TreeViewRevealOptions {
|
|
808
|
-
select: boolean
|
|
809
|
-
focus: boolean
|
|
810
|
-
expand: boolean | number
|
|
808
|
+
readonly select: boolean
|
|
809
|
+
readonly focus: boolean
|
|
810
|
+
readonly expand: boolean | number
|
|
811
811
|
}
|
|
812
812
|
|
|
813
813
|
export interface TreeViewsMain {
|
|
@@ -2398,13 +2398,14 @@ export interface TasksMain {
|
|
|
2398
2398
|
}
|
|
2399
2399
|
|
|
2400
2400
|
export interface AuthenticationExt {
|
|
2401
|
-
$getSessions(
|
|
2402
|
-
$createSession(id: string, scopes: string[]): Promise<theia.AuthenticationSession>;
|
|
2401
|
+
$getSessions(providerId: string, scopes: string[] | undefined, options: theia.AuthenticationProviderSessionOptions): Promise<ReadonlyArray<theia.AuthenticationSession>>;
|
|
2402
|
+
$createSession(id: string, scopes: string[], options: theia.AuthenticationProviderSessionOptions): Promise<theia.AuthenticationSession>;
|
|
2403
2403
|
$removeSession(id: string, sessionId: string): Promise<void>;
|
|
2404
2404
|
$onDidChangeAuthenticationSessions(provider: theia.AuthenticationProviderInformation): Promise<void>;
|
|
2405
2405
|
}
|
|
2406
2406
|
|
|
2407
2407
|
export interface AuthenticationMain {
|
|
2408
|
+
$getAccounts(providerId: string): Thenable<readonly theia.AuthenticationSessionAccountInformation[]>;
|
|
2408
2409
|
$registerAuthenticationProvider(id: string, label: string, supportsMultipleAccounts: boolean): void;
|
|
2409
2410
|
$unregisterAuthenticationProvider(id: string): void;
|
|
2410
2411
|
$onDidChangeSessions(providerId: string, event: AuthenticationProviderAuthenticationSessionsChangeEvent): void;
|
|
@@ -2672,6 +2673,7 @@ export interface NotebookDocumentsExt {
|
|
|
2672
2673
|
|
|
2673
2674
|
export interface NotebookDocumentsAndEditorsExt {
|
|
2674
2675
|
$acceptDocumentsAndEditorsDelta(delta: NotebookDocumentsAndEditorsDelta): Promise<void>;
|
|
2676
|
+
$acceptActiveCellEditorChange(newActiveEditor: string | null): void;
|
|
2675
2677
|
}
|
|
2676
2678
|
|
|
2677
2679
|
export interface NotebookDocumentsAndEditorsMain extends Disposable {
|
package/src/common/test-types.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { MarkdownString } from '@theia/core/lib/common/markdown-rendering';
|
|
|
27
27
|
import { UriComponents } from './uri-components';
|
|
28
28
|
import { Location, Range } from './plugin-api-rpc-model';
|
|
29
29
|
import { isObject } from '@theia/core';
|
|
30
|
+
import * as languageProtocol from '@theia/core/shared/vscode-languageserver-protocol';
|
|
30
31
|
|
|
31
32
|
export enum TestRunProfileKind {
|
|
32
33
|
Run = 1,
|
|
@@ -74,17 +75,30 @@ export interface TestFailureDTO extends TestStateChangeDTO {
|
|
|
74
75
|
readonly duration?: number;
|
|
75
76
|
}
|
|
76
77
|
|
|
78
|
+
export namespace TestFailureDTO {
|
|
79
|
+
export function is(ref: unknown): ref is TestFailureDTO {
|
|
80
|
+
return isObject<TestFailureDTO>(ref)
|
|
81
|
+
&& (ref.state === TestExecutionState.Failed || ref.state === TestExecutionState.Errored);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
77
84
|
export interface TestSuccessDTO extends TestStateChangeDTO {
|
|
78
85
|
readonly state: TestExecutionState.Passed;
|
|
79
86
|
readonly duration?: number;
|
|
80
87
|
}
|
|
81
88
|
|
|
89
|
+
export interface TestMessageStackFrameDTO {
|
|
90
|
+
uri?: languageProtocol.DocumentUri;
|
|
91
|
+
position?: languageProtocol.Position;
|
|
92
|
+
label: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
82
95
|
export interface TestMessageDTO {
|
|
83
96
|
readonly expected?: string;
|
|
84
97
|
readonly actual?: string;
|
|
85
|
-
readonly location?: Location;
|
|
98
|
+
readonly location?: languageProtocol.Location;
|
|
86
99
|
readonly message: string | MarkdownString;
|
|
87
100
|
readonly contextValue?: string;
|
|
101
|
+
readonly stackTrace?: TestMessageStackFrameDTO[];
|
|
88
102
|
}
|
|
89
103
|
|
|
90
104
|
export interface TestItemDTO {
|
|
@@ -27,7 +27,10 @@ import { MessageService } from '@theia/core/lib/common/message-service';
|
|
|
27
27
|
import { ConfirmDialog, Dialog, StorageService } from '@theia/core/lib/browser';
|
|
28
28
|
import {
|
|
29
29
|
AuthenticationProvider,
|
|
30
|
+
AuthenticationProviderSessionOptions,
|
|
30
31
|
AuthenticationService,
|
|
32
|
+
AuthenticationSession,
|
|
33
|
+
AuthenticationSessionAccountInformation,
|
|
31
34
|
readAllowedExtensions
|
|
32
35
|
} from '@theia/core/lib/browser/authentication-service';
|
|
33
36
|
import { QuickPickService } from '@theia/core/lib/common/quick-pick-service';
|
|
@@ -77,9 +80,13 @@ export class AuthenticationMainImpl implements AuthenticationMain {
|
|
|
77
80
|
return this.authenticationService.requestNewSession(providerId, scopes, extensionId, extensionName);
|
|
78
81
|
}
|
|
79
82
|
|
|
83
|
+
$getAccounts(providerId: string): Thenable<readonly theia.AuthenticationSessionAccountInformation[]> {
|
|
84
|
+
return this.authenticationService.getSessions(providerId).then(sessions => sessions.map(session => session.account));
|
|
85
|
+
}
|
|
86
|
+
|
|
80
87
|
async $getSession(providerId: string, scopes: string[], extensionId: string, extensionName: string,
|
|
81
88
|
options: theia.AuthenticationGetSessionOptions): Promise<theia.AuthenticationSession | undefined> {
|
|
82
|
-
const sessions = await this.authenticationService.getSessions(providerId, scopes);
|
|
89
|
+
const sessions = await this.authenticationService.getSessions(providerId, scopes, options?.account);
|
|
83
90
|
|
|
84
91
|
// Error cases
|
|
85
92
|
if (options.forceNewSession && !sessions.length) {
|
|
@@ -140,26 +147,32 @@ export class AuthenticationMainImpl implements AuthenticationMain {
|
|
|
140
147
|
}
|
|
141
148
|
|
|
142
149
|
protected async selectSession(providerId: string, providerName: string, extensionId: string, extensionName: string,
|
|
143
|
-
potentialSessions: Readonly<
|
|
150
|
+
potentialSessions: Readonly<AuthenticationSession[]>, scopes: string[], clearSessionPreference: boolean): Promise<theia.AuthenticationSession> {
|
|
151
|
+
|
|
144
152
|
if (!potentialSessions.length) {
|
|
145
153
|
throw new Error('No potential sessions found');
|
|
146
154
|
}
|
|
147
155
|
|
|
148
156
|
return new Promise(async (resolve, reject) => {
|
|
149
|
-
const items: QuickPickValue<{ session?:
|
|
157
|
+
const items: QuickPickValue<{ session?: AuthenticationSession, account?: AuthenticationSessionAccountInformation }>[] = potentialSessions.map(session => ({
|
|
150
158
|
label: session.account.label,
|
|
151
159
|
value: { session }
|
|
152
160
|
}));
|
|
153
161
|
items.push({
|
|
154
162
|
label: nls.localizeByDefault('Sign in to another account'),
|
|
155
|
-
value: {
|
|
163
|
+
value: {}
|
|
156
164
|
});
|
|
165
|
+
|
|
166
|
+
// VS Code has code here that pushes accounts that have no active sessions. However, since we do not store
|
|
167
|
+
// any accounts that don't have sessions, we dont' do this.
|
|
157
168
|
const selected = await this.quickPickService.show(items,
|
|
158
169
|
{
|
|
159
170
|
title: nls.localizeByDefault("The extension '{0}' wants to access a {1} account", extensionName, providerName),
|
|
160
171
|
ignoreFocusOut: true
|
|
161
172
|
});
|
|
162
173
|
if (selected) {
|
|
174
|
+
|
|
175
|
+
// if we ever have accounts without sessions, pass the account to the login call
|
|
163
176
|
const session = selected.value?.session ?? await this.authenticationService.login(providerId, scopes);
|
|
164
177
|
const accountName = session.account.label;
|
|
165
178
|
|
|
@@ -318,13 +331,13 @@ export class AuthenticationProviderImpl implements AuthenticationProvider {
|
|
|
318
331
|
}
|
|
319
332
|
}
|
|
320
333
|
|
|
321
|
-
async getSessions(scopes?: string[]): Promise<ReadonlyArray<theia.AuthenticationSession>> {
|
|
322
|
-
return this.proxy.$getSessions(this.id, scopes);
|
|
334
|
+
async getSessions(scopes?: string[], account?: AuthenticationSessionAccountInformation): Promise<ReadonlyArray<theia.AuthenticationSession>> {
|
|
335
|
+
return this.proxy.$getSessions(this.id, scopes, { account: account });
|
|
323
336
|
}
|
|
324
337
|
|
|
325
338
|
async updateSessionItems(event: theia.AuthenticationProviderAuthenticationSessionsChangeEvent): Promise<void> {
|
|
326
339
|
const { added, removed } = event;
|
|
327
|
-
const session = await this.proxy.$getSessions(this.id);
|
|
340
|
+
const session = await this.proxy.$getSessions(this.id, undefined, {});
|
|
328
341
|
const addedSessions = added ? session.filter(s => added.some(addedSession => addedSession.id === s.id)) : [];
|
|
329
342
|
|
|
330
343
|
removed?.forEach(removedSession => {
|
|
@@ -347,16 +360,16 @@ export class AuthenticationProviderImpl implements AuthenticationProvider {
|
|
|
347
360
|
addedSessions.forEach(s => this.registerSession(s));
|
|
348
361
|
}
|
|
349
362
|
|
|
350
|
-
async login(scopes: string[]): Promise<theia.AuthenticationSession> {
|
|
351
|
-
return this.createSession(scopes);
|
|
363
|
+
async login(scopes: string[], options: AuthenticationProviderSessionOptions): Promise<theia.AuthenticationSession> {
|
|
364
|
+
return this.createSession(scopes, options);
|
|
352
365
|
}
|
|
353
366
|
|
|
354
367
|
async logout(sessionId: string): Promise<void> {
|
|
355
368
|
return this.removeSession(sessionId);
|
|
356
369
|
}
|
|
357
370
|
|
|
358
|
-
createSession(scopes: string[]): Thenable<theia.AuthenticationSession> {
|
|
359
|
-
return this.proxy.$createSession(this.id, scopes);
|
|
371
|
+
createSession(scopes: string[], options: AuthenticationProviderSessionOptions): Thenable<theia.AuthenticationSession> {
|
|
372
|
+
return this.proxy.$createSession(this.id, scopes, options);
|
|
360
373
|
}
|
|
361
374
|
|
|
362
375
|
removeSession(sessionId: string): Thenable<void> {
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import URI from '@theia/core/lib/common/uri';
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
ApplicationShell, DiffUris, OpenHandler, OpenerOptions, PreferenceService, SplitWidget, Widget, WidgetManager, WidgetOpenerOptions, getDefaultHandler, defaultHandlerPriority
|
|
20
|
+
} from '@theia/core/lib/browser';
|
|
19
21
|
import { CustomEditor, CustomEditorPriority, CustomEditorSelector } from '../../../common';
|
|
20
22
|
import { CustomEditorWidget } from './custom-editor-widget';
|
|
21
23
|
import { PluginCustomEditorRegistry } from './plugin-custom-editor-registry';
|
|
@@ -35,7 +37,8 @@ export class CustomEditorOpener implements OpenHandler {
|
|
|
35
37
|
private readonly editor: CustomEditor,
|
|
36
38
|
protected readonly shell: ApplicationShell,
|
|
37
39
|
protected readonly widgetManager: WidgetManager,
|
|
38
|
-
protected readonly editorRegistry: PluginCustomEditorRegistry
|
|
40
|
+
protected readonly editorRegistry: PluginCustomEditorRegistry,
|
|
41
|
+
protected readonly preferenceService: PreferenceService
|
|
39
42
|
) {
|
|
40
43
|
this.id = CustomEditorOpener.toCustomEditorId(this.editor.viewType);
|
|
41
44
|
this.label = this.editor.displayName;
|
|
@@ -45,14 +48,26 @@ export class CustomEditorOpener implements OpenHandler {
|
|
|
45
48
|
return `custom-editor-${editorViewType}`;
|
|
46
49
|
}
|
|
47
50
|
|
|
48
|
-
canHandle(uri: URI): number {
|
|
51
|
+
canHandle(uri: URI, options?: OpenerOptions): number {
|
|
52
|
+
let priority = 0;
|
|
49
53
|
const { selector } = this.editor;
|
|
50
54
|
if (DiffUris.isDiffUri(uri)) {
|
|
51
55
|
const [left, right] = DiffUris.decode(uri);
|
|
52
56
|
if (this.matches(selector, right) && this.matches(selector, left)) {
|
|
53
|
-
|
|
57
|
+
priority = this.getPriority();
|
|
54
58
|
}
|
|
55
59
|
} else if (this.matches(selector, uri)) {
|
|
60
|
+
if (getDefaultHandler(uri, this.preferenceService) === this.editor.viewType) {
|
|
61
|
+
priority = defaultHandlerPriority;
|
|
62
|
+
} else {
|
|
63
|
+
priority = this.getPriority();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return priority;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
canOpenWith(uri: URI): number {
|
|
70
|
+
if (this.matches(this.editor.selector, uri)) {
|
|
56
71
|
return this.getPriority();
|
|
57
72
|
}
|
|
58
73
|
return 0;
|
|
@@ -20,7 +20,7 @@ import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposa
|
|
|
20
20
|
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
21
21
|
import { CustomEditorOpener } from './custom-editor-opener';
|
|
22
22
|
import { Emitter } from '@theia/core';
|
|
23
|
-
import { ApplicationShell, DefaultOpenerService, OpenWithService, WidgetManager } from '@theia/core/lib/browser';
|
|
23
|
+
import { ApplicationShell, DefaultOpenerService, OpenWithService, PreferenceService, WidgetManager } from '@theia/core/lib/browser';
|
|
24
24
|
import { CustomEditorWidget } from './custom-editor-widget';
|
|
25
25
|
|
|
26
26
|
@injectable()
|
|
@@ -44,6 +44,9 @@ export class PluginCustomEditorRegistry {
|
|
|
44
44
|
@inject(OpenWithService)
|
|
45
45
|
protected readonly openWithService: OpenWithService;
|
|
46
46
|
|
|
47
|
+
@inject(PreferenceService)
|
|
48
|
+
protected readonly preferenceService: PreferenceService;
|
|
49
|
+
|
|
47
50
|
@postConstruct()
|
|
48
51
|
protected init(): void {
|
|
49
52
|
this.widgetManager.onDidCreateWidget(({ factoryId, widget }) => {
|
|
@@ -76,7 +79,8 @@ export class PluginCustomEditorRegistry {
|
|
|
76
79
|
editor,
|
|
77
80
|
this.shell,
|
|
78
81
|
this.widgetManager,
|
|
79
|
-
this
|
|
82
|
+
this,
|
|
83
|
+
this.preferenceService
|
|
80
84
|
);
|
|
81
85
|
toDispose.push(this.defaultOpenerService.addHandler(editorOpenHandler));
|
|
82
86
|
toDispose.push(
|
|
@@ -84,7 +88,7 @@ export class PluginCustomEditorRegistry {
|
|
|
84
88
|
id: editor.viewType,
|
|
85
89
|
label: editorOpenHandler.label,
|
|
86
90
|
providerName: plugin.metadata.model.displayName,
|
|
87
|
-
canHandle: uri => editorOpenHandler.
|
|
91
|
+
canHandle: uri => editorOpenHandler.canOpenWith(uri),
|
|
88
92
|
open: uri => editorOpenHandler.open(uri)
|
|
89
93
|
})
|
|
90
94
|
);
|
|
@@ -34,6 +34,8 @@ import { DisposableCollection, Emitter, URI } from '@theia/core';
|
|
|
34
34
|
import { EditorManager, EditorWidget } from '@theia/editor/lib/browser';
|
|
35
35
|
import { SaveableService } from '@theia/core/lib/browser/saveable-service';
|
|
36
36
|
import { TabsMainImpl } from './tabs/tabs-main';
|
|
37
|
+
import { NotebookCellEditorService, NotebookEditorWidgetService } from '@theia/notebook/lib/browser';
|
|
38
|
+
import { SimpleMonacoEditor } from '@theia/monaco/lib/browser/simple-monaco-editor';
|
|
37
39
|
|
|
38
40
|
export class EditorsAndDocumentsMain implements Disposable {
|
|
39
41
|
|
|
@@ -67,7 +69,11 @@ export class EditorsAndDocumentsMain implements Disposable {
|
|
|
67
69
|
this.modelService = container.get(EditorModelService);
|
|
68
70
|
this.saveResourceService = container.get(SaveableService);
|
|
69
71
|
|
|
70
|
-
this.stateComputer = new EditorAndDocumentStateComputer(d => this.onDelta(d),
|
|
72
|
+
this.stateComputer = new EditorAndDocumentStateComputer(d => this.onDelta(d),
|
|
73
|
+
this.editorManager,
|
|
74
|
+
container.get(NotebookCellEditorService),
|
|
75
|
+
container.get(NotebookEditorWidgetService),
|
|
76
|
+
this.modelService, tabsMain);
|
|
71
77
|
this.toDispose.push(this.stateComputer);
|
|
72
78
|
this.toDispose.push(this.onTextEditorAddEmitter);
|
|
73
79
|
this.toDispose.push(this.onTextEditorRemoveEmitter);
|
|
@@ -218,6 +224,8 @@ class EditorAndDocumentStateComputer implements Disposable {
|
|
|
218
224
|
constructor(
|
|
219
225
|
private callback: (delta: EditorAndDocumentStateDelta) => void,
|
|
220
226
|
private readonly editorService: EditorManager,
|
|
227
|
+
private readonly cellEditorService: NotebookCellEditorService,
|
|
228
|
+
private readonly notebookWidgetService: NotebookEditorWidgetService,
|
|
221
229
|
private readonly modelService: EditorModelService,
|
|
222
230
|
private readonly tabsMain: TabsMainImpl
|
|
223
231
|
) { }
|
|
@@ -240,6 +248,16 @@ class EditorAndDocumentStateComputer implements Disposable {
|
|
|
240
248
|
this.toDispose.push(this.modelService.onModelAdded(this.onModelAdded, this));
|
|
241
249
|
this.toDispose.push(this.modelService.onModelRemoved(() => this.update()));
|
|
242
250
|
|
|
251
|
+
this.toDispose.push(this.cellEditorService.onDidChangeCellEditors(() => this.update()));
|
|
252
|
+
|
|
253
|
+
this.toDispose.push(this.notebookWidgetService.onDidChangeFocusedEditor(() => {
|
|
254
|
+
this.currentState = this.currentState && new EditorAndDocumentState(
|
|
255
|
+
this.currentState.documents,
|
|
256
|
+
this.currentState.editors,
|
|
257
|
+
undefined
|
|
258
|
+
);
|
|
259
|
+
}));
|
|
260
|
+
|
|
243
261
|
for (const widget of this.editorService.all) {
|
|
244
262
|
this.onTextEditorAdd(widget);
|
|
245
263
|
}
|
|
@@ -318,6 +336,11 @@ class EditorAndDocumentStateComputer implements Disposable {
|
|
|
318
336
|
}
|
|
319
337
|
}
|
|
320
338
|
|
|
339
|
+
for (const editor of this.cellEditorService.allCellEditors) {
|
|
340
|
+
const editorSnapshot = new EditorSnapshot(editor);
|
|
341
|
+
editors.set(editorSnapshot.id, editorSnapshot);
|
|
342
|
+
};
|
|
343
|
+
|
|
321
344
|
const newState = new EditorAndDocumentState(models, editors, activeId);
|
|
322
345
|
const delta = EditorAndDocumentState.compute(this.currentState, newState);
|
|
323
346
|
if (!delta.isEmpty) {
|
|
@@ -384,7 +407,7 @@ class EditorAndDocumentState {
|
|
|
384
407
|
|
|
385
408
|
class EditorSnapshot {
|
|
386
409
|
readonly id: string;
|
|
387
|
-
constructor(readonly editor: MonacoEditor) {
|
|
410
|
+
constructor(readonly editor: MonacoEditor | SimpleMonacoEditor) {
|
|
388
411
|
this.id = `${editor.getControl().getId()},${editor.getControl().getModel()!.id}`;
|
|
389
412
|
}
|
|
390
413
|
}
|
|
@@ -32,7 +32,6 @@ import { TreeViewWidget } from '../view/tree-view-widget';
|
|
|
32
32
|
import { CodeEditorWidgetUtil, codeToTheiaMappings, ContributionPoint } from './vscode-theia-menu-mappings';
|
|
33
33
|
import { TAB_BAR_TOOLBAR_CONTEXT_MENU } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
34
34
|
import { TestItem, TestMessage } from '@theia/test/lib/browser/test-service';
|
|
35
|
-
import { fromLocation } from '../hierarchy/hierarchy-types-converters';
|
|
36
35
|
|
|
37
36
|
export type ArgumentAdapter = (...args: unknown[]) => unknown[];
|
|
38
37
|
|
|
@@ -315,7 +314,8 @@ export class PluginMenuCommandAdapter implements MenuCommandAdapter {
|
|
|
315
314
|
actual: testMessage.actual,
|
|
316
315
|
expected: testMessage.expected,
|
|
317
316
|
contextValue: testMessage.contextValue,
|
|
318
|
-
location: testMessage.location
|
|
317
|
+
location: testMessage.location,
|
|
318
|
+
stackTrace: testMessage.stackTrace
|
|
319
319
|
};
|
|
320
320
|
return [TestMessageArg.create(testItemReference, testMessageDTO)];
|
|
321
321
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
import { Disposable, DisposableCollection } from '@theia/core';
|
|
22
22
|
import { interfaces } from '@theia/core/shared/inversify';
|
|
23
23
|
import { UriComponents } from '@theia/core/lib/common/uri';
|
|
24
|
-
import { NotebookEditorWidget, NotebookService, NotebookEditorWidgetService } from '@theia/notebook/lib/browser';
|
|
24
|
+
import { NotebookEditorWidget, NotebookService, NotebookEditorWidgetService, NotebookCellEditorService } from '@theia/notebook/lib/browser';
|
|
25
25
|
import { NotebookModel } from '@theia/notebook/lib/browser/view-model/notebook-model';
|
|
26
26
|
import { MAIN_RPC_CONTEXT, NotebookDocumentsAndEditorsDelta, NotebookDocumentsAndEditorsMain, NotebookEditorAddData, NotebookModelAddedData, NotebooksExt } from '../../../common';
|
|
27
27
|
import { RPCProtocol } from '../../../common/rpc-protocol';
|
|
@@ -105,6 +105,9 @@ export class NotebooksAndEditorsMain implements NotebookDocumentsAndEditorsMain
|
|
|
105
105
|
this.notebookService = container.get(NotebookService);
|
|
106
106
|
this.notebookEditorService = container.get(NotebookEditorWidgetService);
|
|
107
107
|
this.WidgetManager = container.get(WidgetManager);
|
|
108
|
+
const notebookCellEditorService = container.get(NotebookCellEditorService);
|
|
109
|
+
|
|
110
|
+
notebookCellEditorService.onDidChangeFocusedCellEditor(editor => this.proxy.$acceptActiveCellEditorChange(editor?.uri.toString() ?? null), this, this.disposables);
|
|
108
111
|
|
|
109
112
|
this.notebookService.onDidAddNotebookDocument(async () => this.updateState(), this, this.disposables);
|
|
110
113
|
this.notebookService.onDidRemoveNotebookDocument(async () => this.updateState(), this, this.disposables);
|
|
@@ -231,9 +231,13 @@ export class TabsMainImpl implements TabsMain, Disposable {
|
|
|
231
231
|
return { kind: TabInputKind.UnknownInput };
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
protected connectToSignal<T>(disposableList: DisposableCollection,
|
|
234
|
+
protected connectToSignal<T>(disposableList: DisposableCollection,
|
|
235
|
+
signal: {
|
|
236
|
+
connect(listener: T, context: unknown): void,
|
|
237
|
+
disconnect(listener: T, context: unknown): void
|
|
238
|
+
}, listener: T): void {
|
|
235
239
|
signal.connect(listener, this);
|
|
236
|
-
disposableList.push(Disposable.create(() => signal.disconnect(listener)));
|
|
240
|
+
disposableList.push(Disposable.create(() => signal.disconnect(listener, this)));
|
|
237
241
|
}
|
|
238
242
|
|
|
239
243
|
protected tabDtosEqual(a: TabDto, b: TabDto): boolean {
|
|
@@ -27,7 +27,10 @@ import { CancellationToken, Disposable, Event, URI } from '@theia/core';
|
|
|
27
27
|
import { MAIN_RPC_CONTEXT, TestControllerUpdate, TestingExt, TestingMain } from '../../common';
|
|
28
28
|
import { RPCProtocol } from '../../common/rpc-protocol';
|
|
29
29
|
import { interfaces } from '@theia/core/shared/inversify';
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
TestExecutionState, TestItemDTO, TestItemReference, TestOutputDTO,
|
|
32
|
+
TestRunDTO, TestRunProfileDTO, TestStateChangeDTO
|
|
33
|
+
} from '../../common/test-types';
|
|
31
34
|
import { TestRunProfileKind } from '../../plugin/types-impl';
|
|
32
35
|
import { CommandRegistryMainImpl } from './command-registry-main';
|
|
33
36
|
|
|
@@ -33,11 +33,14 @@ import { Range } from '../../common/plugin-api-rpc-model';
|
|
|
33
33
|
import { Emitter, Event } from '@theia/core';
|
|
34
34
|
import { TextEditorCursorStyle, cursorStyleToString } from '../../common/editor-options';
|
|
35
35
|
import { TextEditorLineNumbersStyle, EndOfLine } from '../../plugin/types-impl';
|
|
36
|
+
import { SimpleMonacoEditor } from '@theia/monaco/lib/browser/simple-monaco-editor';
|
|
37
|
+
import { EndOfLineSequence, ITextModel } from '@theia/monaco-editor-core/esm/vs/editor/common/model';
|
|
38
|
+
import { EditorOption, RenderLineNumbersType } from '@theia/monaco-editor-core/esm/vs/editor/common/config/editorOptions';
|
|
36
39
|
|
|
37
40
|
export class TextEditorMain implements Disposable {
|
|
38
41
|
|
|
39
42
|
private properties: TextEditorPropertiesMain | undefined;
|
|
40
|
-
private editor: MonacoEditor | undefined;
|
|
43
|
+
private editor: MonacoEditor | SimpleMonacoEditor | undefined;
|
|
41
44
|
|
|
42
45
|
private readonly onPropertiesChangedEmitter = new Emitter<EditorChangedPropertiesData>();
|
|
43
46
|
|
|
@@ -48,8 +51,8 @@ export class TextEditorMain implements Disposable {
|
|
|
48
51
|
|
|
49
52
|
constructor(
|
|
50
53
|
private id: string,
|
|
51
|
-
private model: monaco.editor.IModel,
|
|
52
|
-
editor: MonacoEditor
|
|
54
|
+
private model: monaco.editor.IModel | ITextModel,
|
|
55
|
+
editor: MonacoEditor | SimpleMonacoEditor
|
|
53
56
|
) {
|
|
54
57
|
this.toDispose.push(this.model.onDidChangeOptions(() =>
|
|
55
58
|
this.updateProperties(undefined)
|
|
@@ -76,7 +79,7 @@ export class TextEditorMain implements Disposable {
|
|
|
76
79
|
|
|
77
80
|
protected readonly toDisposeOnEditor = new DisposableCollection();
|
|
78
81
|
|
|
79
|
-
private setEditor(editor?: MonacoEditor): void {
|
|
82
|
+
private setEditor(editor?: MonacoEditor | SimpleMonacoEditor): void {
|
|
80
83
|
if (this.editor === editor) {
|
|
81
84
|
return;
|
|
82
85
|
}
|
|
@@ -115,7 +118,7 @@ export class TextEditorMain implements Disposable {
|
|
|
115
118
|
return this.id;
|
|
116
119
|
}
|
|
117
120
|
|
|
118
|
-
getModel(): monaco.editor.IModel {
|
|
121
|
+
getModel(): monaco.editor.IModel | ITextModel {
|
|
119
122
|
return this.model;
|
|
120
123
|
}
|
|
121
124
|
|
|
@@ -208,7 +211,7 @@ export class TextEditorMain implements Disposable {
|
|
|
208
211
|
}
|
|
209
212
|
|
|
210
213
|
revealRange(range: monaco.Range, revealType: TextEditorRevealType): void {
|
|
211
|
-
if (!this.editor) {
|
|
214
|
+
if (!this.editor || this.editor instanceof SimpleMonacoEditor) {
|
|
212
215
|
return;
|
|
213
216
|
}
|
|
214
217
|
switch (revealType) {
|
|
@@ -240,10 +243,14 @@ export class TextEditorMain implements Disposable {
|
|
|
240
243
|
return false;
|
|
241
244
|
}
|
|
242
245
|
|
|
243
|
-
if (opts.setEndOfLine === EndOfLine.CRLF) {
|
|
246
|
+
if (opts.setEndOfLine === EndOfLine.CRLF && !this.isSimpleWidget(this.model)) {
|
|
244
247
|
this.model.setEOL(monaco.editor.EndOfLineSequence.CRLF);
|
|
245
|
-
} else if (opts.setEndOfLine === EndOfLine.LF) {
|
|
248
|
+
} else if (opts.setEndOfLine === EndOfLine.LF && !this.isSimpleWidget(this.model)) {
|
|
246
249
|
this.model.setEOL(monaco.editor.EndOfLineSequence.LF);
|
|
250
|
+
} else if (opts.setEndOfLine === EndOfLine.CRLF && this.isSimpleWidget(this.model)) {
|
|
251
|
+
this.model.setEOL(EndOfLineSequence.CRLF);
|
|
252
|
+
} else if (opts.setEndOfLine === EndOfLine.LF && this.isSimpleWidget(this.model)) {
|
|
253
|
+
this.model.setEOL(EndOfLineSequence.CRLF);
|
|
247
254
|
}
|
|
248
255
|
|
|
249
256
|
const editOperations: monaco.editor.IIdentifiedSingleEditOperation[] = [];
|
|
@@ -311,6 +318,10 @@ export class TextEditorMain implements Disposable {
|
|
|
311
318
|
private static toMonacoSelections(selection: Selection): monaco.Selection {
|
|
312
319
|
return new monaco.Selection(selection.selectionStartLineNumber, selection.selectionStartColumn, selection.positionLineNumber, selection.positionColumn);
|
|
313
320
|
}
|
|
321
|
+
|
|
322
|
+
private isSimpleWidget(model: monaco.editor.IModel | ITextModel): model is ITextModel {
|
|
323
|
+
return !!(model as ITextModel).isForSimpleWidget;
|
|
324
|
+
}
|
|
314
325
|
}
|
|
315
326
|
|
|
316
327
|
// TODO move to monaco typings!
|
|
@@ -362,17 +373,26 @@ export class TextEditorPropertiesMain {
|
|
|
362
373
|
return undefined;
|
|
363
374
|
}
|
|
364
375
|
|
|
365
|
-
static readFromEditor(prevProperties: TextEditorPropertiesMain | undefined,
|
|
376
|
+
static readFromEditor(prevProperties: TextEditorPropertiesMain | undefined,
|
|
377
|
+
model: monaco.editor.IModel | ITextModel,
|
|
378
|
+
editor: MonacoEditor | SimpleMonacoEditor): TextEditorPropertiesMain {
|
|
379
|
+
|
|
366
380
|
const selections = TextEditorPropertiesMain.getSelectionsFromEditor(prevProperties, editor);
|
|
367
381
|
const options = TextEditorPropertiesMain.getOptionsFromEditor(prevProperties, model, editor);
|
|
368
382
|
const visibleRanges = TextEditorPropertiesMain.getVisibleRangesFromEditor(prevProperties, editor);
|
|
369
383
|
return new TextEditorPropertiesMain(selections, options, visibleRanges);
|
|
370
384
|
}
|
|
371
385
|
|
|
372
|
-
private static getSelectionsFromEditor(prevProperties: TextEditorPropertiesMain | undefined, editor: MonacoEditor): monaco.Selection[] {
|
|
386
|
+
private static getSelectionsFromEditor(prevProperties: TextEditorPropertiesMain | undefined, editor: MonacoEditor | SimpleMonacoEditor): monaco.Selection[] {
|
|
373
387
|
let result: monaco.Selection[] | undefined = undefined;
|
|
374
|
-
if (editor) {
|
|
388
|
+
if (editor && editor instanceof MonacoEditor) {
|
|
375
389
|
result = editor.getControl().getSelections() || undefined;
|
|
390
|
+
} else if (editor && editor instanceof SimpleMonacoEditor) {
|
|
391
|
+
result = editor.getControl().getSelections()?.map(selection => new monaco.Selection(
|
|
392
|
+
selection.startLineNumber,
|
|
393
|
+
selection.startColumn,
|
|
394
|
+
selection.positionLineNumber,
|
|
395
|
+
selection.positionColumn));
|
|
376
396
|
}
|
|
377
397
|
|
|
378
398
|
if (!result && prevProperties) {
|
|
@@ -385,14 +405,16 @@ export class TextEditorPropertiesMain {
|
|
|
385
405
|
return result;
|
|
386
406
|
}
|
|
387
407
|
|
|
388
|
-
private static getOptionsFromEditor(prevProperties: TextEditorPropertiesMain | undefined,
|
|
408
|
+
private static getOptionsFromEditor(prevProperties: TextEditorPropertiesMain | undefined,
|
|
409
|
+
model: monaco.editor.IModel | ITextModel,
|
|
410
|
+
editor: MonacoEditor | SimpleMonacoEditor): TextEditorConfiguration {
|
|
389
411
|
if (model.isDisposed()) {
|
|
390
412
|
return prevProperties!.options;
|
|
391
413
|
}
|
|
392
414
|
|
|
393
415
|
let cursorStyle: TextEditorCursorStyle;
|
|
394
416
|
let lineNumbers: TextEditorLineNumbersStyle;
|
|
395
|
-
if (editor) {
|
|
417
|
+
if (editor && editor instanceof MonacoEditor) {
|
|
396
418
|
const editorOptions = editor.getControl().getOptions();
|
|
397
419
|
const lineNumbersOpts = editorOptions.get(monaco.editor.EditorOption.lineNumbers);
|
|
398
420
|
cursorStyle = editorOptions.get(monaco.editor.EditorOption.cursorStyle);
|
|
@@ -410,6 +432,25 @@ export class TextEditorPropertiesMain {
|
|
|
410
432
|
lineNumbers = TextEditorLineNumbersStyle.On;
|
|
411
433
|
break;
|
|
412
434
|
}
|
|
435
|
+
} else if (editor && editor instanceof SimpleMonacoEditor) {
|
|
436
|
+
const editorOptions = editor.getControl().getOptions();
|
|
437
|
+
const lineNumbersOpts = editorOptions.get(EditorOption.lineNumbers);
|
|
438
|
+
cursorStyle = editorOptions.get(EditorOption.cursorStyle);
|
|
439
|
+
switch (lineNumbersOpts.renderType) {
|
|
440
|
+
case RenderLineNumbersType.Off:
|
|
441
|
+
lineNumbers = TextEditorLineNumbersStyle.Off;
|
|
442
|
+
break;
|
|
443
|
+
case RenderLineNumbersType.Relative:
|
|
444
|
+
lineNumbers = TextEditorLineNumbersStyle.Relative;
|
|
445
|
+
break;
|
|
446
|
+
case RenderLineNumbersType.Interval:
|
|
447
|
+
lineNumbers = TextEditorLineNumbersStyle.Interval;
|
|
448
|
+
break;
|
|
449
|
+
default:
|
|
450
|
+
lineNumbers = TextEditorLineNumbersStyle.On;
|
|
451
|
+
break;
|
|
452
|
+
}
|
|
453
|
+
|
|
413
454
|
} else if (prevProperties) {
|
|
414
455
|
cursorStyle = prevProperties.options.cursorStyle;
|
|
415
456
|
lineNumbers = prevProperties.options.lineNumbers;
|
|
@@ -428,7 +469,7 @@ export class TextEditorPropertiesMain {
|
|
|
428
469
|
};
|
|
429
470
|
}
|
|
430
471
|
|
|
431
|
-
private static getVisibleRangesFromEditor(prevProperties: TextEditorPropertiesMain | undefined, editor: MonacoEditor): monaco.Range[] {
|
|
472
|
+
private static getVisibleRangesFromEditor(prevProperties: TextEditorPropertiesMain | undefined, editor: MonacoEditor | SimpleMonacoEditor): monaco.Range[] {
|
|
432
473
|
if (editor) {
|
|
433
474
|
return editor.getControl().getVisibleRanges();
|
|
434
475
|
}
|
|
@@ -57,6 +57,10 @@ export class AuthenticationExtImpl implements AuthenticationExt {
|
|
|
57
57
|
return this.proxy.$getSession(providerId, scopes, extensionId, extensionName, options);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
getAccounts(providerId: string): Thenable<readonly theia.AuthenticationSessionAccountInformation[]> {
|
|
61
|
+
return this.proxy.$getAccounts(providerId);
|
|
62
|
+
}
|
|
63
|
+
|
|
60
64
|
registerAuthenticationProvider(id: string, label: string, provider: theia.AuthenticationProvider, options?: theia.AuthenticationProviderOptions): theia.Disposable {
|
|
61
65
|
if (this.authenticationProviders.get(id)) {
|
|
62
66
|
throw new Error(`An authentication provider with id '${id}' is already registered.`);
|
|
@@ -64,7 +68,7 @@ export class AuthenticationExtImpl implements AuthenticationExt {
|
|
|
64
68
|
|
|
65
69
|
this.authenticationProviders.set(id, provider);
|
|
66
70
|
|
|
67
|
-
provider.getSessions().then(sessions => { // sessions might have been restored from secret storage
|
|
71
|
+
provider.getSessions(undefined, {}).then(sessions => { // sessions might have been restored from secret storage
|
|
68
72
|
if (sessions.length > 0) {
|
|
69
73
|
this.proxy.$onDidChangeSessions(id, {
|
|
70
74
|
added: sessions,
|
|
@@ -87,10 +91,10 @@ export class AuthenticationExtImpl implements AuthenticationExt {
|
|
|
87
91
|
});
|
|
88
92
|
}
|
|
89
93
|
|
|
90
|
-
$createSession(providerId: string, scopes: string[]): Promise<theia.AuthenticationSession> {
|
|
94
|
+
$createSession(providerId: string, scopes: string[], options: theia.AuthenticationProviderSessionOptions): Promise<theia.AuthenticationSession> {
|
|
91
95
|
const authProvider = this.authenticationProviders.get(providerId);
|
|
92
96
|
if (authProvider) {
|
|
93
|
-
return Promise.resolve(authProvider.createSession(scopes));
|
|
97
|
+
return Promise.resolve(authProvider.createSession(scopes, options));
|
|
94
98
|
}
|
|
95
99
|
|
|
96
100
|
throw new Error(`Unable to find authentication provider with handle: ${providerId}`);
|
|
@@ -105,10 +109,10 @@ export class AuthenticationExtImpl implements AuthenticationExt {
|
|
|
105
109
|
throw new Error(`Unable to find authentication provider with handle: ${providerId}`);
|
|
106
110
|
}
|
|
107
111
|
|
|
108
|
-
async $getSessions(providerId: string, scopes
|
|
112
|
+
async $getSessions(providerId: string, scopes: string[] | undefined, options: theia.AuthenticationProviderSessionOptions): Promise<ReadonlyArray<theia.AuthenticationSession>> {
|
|
109
113
|
const authProvider = this.authenticationProviders.get(providerId);
|
|
110
114
|
if (authProvider) {
|
|
111
|
-
const sessions = await authProvider.getSessions(scopes);
|
|
115
|
+
const sessions = await authProvider.getSessions(scopes, options);
|
|
112
116
|
|
|
113
117
|
/* Wrap the session object received from the plugin to prevent serialization mismatches
|
|
114
118
|
e.g. if the plugin object is constructed with the help of getters they won't be serialized:
|