@theia/plugin-ext 1.29.0-next.6 → 1.29.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 +7 -0
- 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 +16 -16
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.js.map +1 -1
- package/lib/common/rpc-protocol.d.ts +1 -1
- package/lib/common/rpc-protocol.d.ts.map +1 -1
- package/lib/common/rpc-protocol.js +3 -3
- package/lib/common/rpc-protocol.js.map +1 -1
- package/lib/main/browser/authentication-main.d.ts +3 -6
- package/lib/main/browser/authentication-main.d.ts.map +1 -1
- package/lib/main/browser/authentication-main.js +16 -37
- package/lib/main/browser/authentication-main.js.map +1 -1
- package/lib/main/browser/comments/comment-thread-widget.d.ts +2 -0
- package/lib/main/browser/comments/comment-thread-widget.d.ts.map +1 -1
- package/lib/main/browser/comments/comment-thread-widget.js +4 -3
- package/lib/main/browser/comments/comment-thread-widget.js.map +1 -1
- package/lib/main/browser/debug/debug-main.d.ts +1 -1
- package/lib/main/browser/debug/debug-main.d.ts.map +1 -1
- package/lib/main/browser/debug/debug-main.js +20 -10
- package/lib/main/browser/debug/debug-main.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-factory.d.ts +4 -4
- package/lib/main/browser/debug/plugin-debug-session-factory.d.ts.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-factory.js.map +1 -1
- package/lib/main/browser/languages-main.d.ts +6 -1
- package/lib/main/browser/languages-main.d.ts.map +1 -1
- package/lib/main/browser/languages-main.js +15 -1
- package/lib/main/browser/languages-main.js.map +1 -1
- package/lib/main/browser/plugin-ext-frontend-module.d.ts +1 -0
- package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
- package/lib/main/browser/plugin-ext-frontend-module.js +1 -0
- package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
- package/lib/main/browser/theme-icon-override.d.ts +2 -0
- package/lib/main/browser/theme-icon-override.d.ts.map +1 -0
- package/lib/main/browser/theme-icon-override.js +217 -0
- package/lib/main/browser/theme-icon-override.js.map +1 -0
- package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.js +0 -1
- package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
- package/lib/main/browser/view/plugin-view-widget.d.ts +9 -8
- package/lib/main/browser/view/plugin-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-view-widget.js +7 -4
- package/lib/main/browser/view/plugin-view-widget.js.map +1 -1
- package/lib/main/browser/view/tree-view-decorator-service.d.ts +1 -1
- package/lib/main/browser/view/tree-view-decorator-service.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-decorator-service.js +1 -1
- package/lib/main/browser/view/tree-view-decorator-service.js.map +1 -1
- package/lib/main/node/plugin-ext-backend-module.d.ts +1 -1
- package/lib/main/node/plugin-ext-backend-module.d.ts.map +1 -1
- package/lib/main/node/plugin-ext-backend-module.js +4 -1
- package/lib/main/node/plugin-ext-backend-module.js.map +1 -1
- package/lib/main/node/plugin-localization-backend-contribution.d.ts +10 -0
- package/lib/main/node/plugin-localization-backend-contribution.d.ts.map +1 -0
- package/lib/main/node/plugin-localization-backend-contribution.js +59 -0
- package/lib/main/node/plugin-localization-backend-contribution.js.map +1 -0
- package/lib/plugin/authentication-ext.d.ts +1 -11
- package/lib/plugin/authentication-ext.d.ts.map +1 -1
- package/lib/plugin/authentication-ext.js +3 -55
- package/lib/plugin/authentication-ext.js.map +1 -1
- package/lib/plugin/languages/code-action.d.ts.map +1 -1
- package/lib/plugin/languages/code-action.js +8 -9
- package/lib/plugin/languages/code-action.js.map +1 -1
- package/lib/plugin/languages/document-highlight.d.ts.map +1 -1
- package/lib/plugin/languages/document-highlight.js +0 -1
- package/lib/plugin/languages/document-highlight.js.map +1 -1
- package/lib/plugin/languages/evaluatable-expression.d.ts +12 -0
- package/lib/plugin/languages/evaluatable-expression.d.ts.map +1 -0
- package/lib/plugin/languages/evaluatable-expression.js +41 -0
- package/lib/plugin/languages/evaluatable-expression.js.map +1 -0
- package/lib/plugin/languages/util.d.ts +2 -2
- package/lib/plugin/languages/util.d.ts.map +1 -1
- package/lib/plugin/languages/util.js +0 -2
- package/lib/plugin/languages/util.js.map +1 -1
- package/lib/plugin/languages.d.ts +3 -1
- package/lib/plugin/languages.d.ts.map +1 -1
- package/lib/plugin/languages.js +11 -0
- package/lib/plugin/languages.js.map +1 -1
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +7 -35
- package/lib/plugin/plugin-context.js.map +1 -1
- package/lib/plugin/plugin-storage.d.ts +1 -0
- package/lib/plugin/plugin-storage.d.ts.map +1 -1
- package/lib/plugin/plugin-storage.js +3 -0
- package/lib/plugin/plugin-storage.js.map +1 -1
- package/lib/plugin/preference-registry.d.ts.map +1 -1
- package/lib/plugin/preference-registry.js +5 -0
- package/lib/plugin/preference-registry.js.map +1 -1
- package/lib/plugin/preference-registry.spec.js +44 -1
- package/lib/plugin/preference-registry.spec.js.map +1 -1
- package/lib/plugin/quick-open.d.ts +5 -1
- package/lib/plugin/quick-open.d.ts.map +1 -1
- package/lib/plugin/quick-open.js +27 -4
- package/lib/plugin/quick-open.js.map +1 -1
- package/lib/plugin/type-converters.d.ts +7 -6
- package/lib/plugin/type-converters.d.ts.map +1 -1
- package/lib/plugin/type-converters.js +54 -55
- package/lib/plugin/type-converters.js.map +1 -1
- package/lib/plugin/types-impl.d.ts +13 -3
- package/lib/plugin/types-impl.d.ts.map +1 -1
- package/lib/plugin/types-impl.js +28 -10
- package/lib/plugin/types-impl.js.map +1 -1
- package/lib/plugin/workspace.d.ts.map +1 -1
- package/lib/plugin/workspace.js +6 -1
- package/lib/plugin/workspace.js.map +1 -1
- package/lib/plugin-ext-backend-electron-module.js +2 -2
- package/lib/plugin-ext-backend-electron-module.js.map +1 -1
- package/lib/plugin-ext-backend-module.js +2 -2
- package/lib/plugin-ext-backend-module.js.map +1 -1
- package/package.json +26 -26
- package/src/common/plugin-api-rpc-model.ts +10 -0
- package/src/common/plugin-api-rpc.ts +13 -15
- package/src/common/rpc-protocol.ts +5 -5
- package/src/main/browser/authentication-main.ts +17 -42
- package/src/main/browser/comments/comment-thread-widget.tsx +5 -3
- package/src/main/browser/debug/debug-main.ts +20 -12
- package/src/main/browser/debug/plugin-debug-session-factory.ts +3 -3
- package/src/main/browser/languages-main.ts +23 -1
- package/src/main/browser/plugin-ext-frontend-module.ts +1 -0
- package/src/main/browser/style/tree.css +2 -0
- package/src/main/browser/theme-icon-override.ts +221 -0
- package/src/main/browser/view/plugin-view-registry.ts +0 -1
- package/src/main/browser/view/plugin-view-widget.ts +14 -11
- package/src/main/browser/view/tree-view-decorator-service.ts +2 -2
- package/src/main/node/plugin-ext-backend-module.ts +6 -1
- package/src/main/node/plugin-localization-backend-contribution.ts +42 -0
- package/src/plugin/authentication-ext.ts +3 -70
- package/src/plugin/debug/debug-ext.ts +1 -1
- package/src/plugin/languages/code-action.ts +9 -12
- package/src/plugin/languages/document-highlight.ts +1 -2
- package/src/plugin/languages/evaluatable-expression.ts +47 -0
- package/src/plugin/languages/util.ts +2 -4
- package/src/plugin/languages.ts +15 -0
- package/src/plugin/plugin-context.ts +12 -41
- package/src/plugin/plugin-storage.ts +4 -0
- package/src/plugin/preference-registry.spec.ts +45 -1
- package/src/plugin/preference-registry.ts +5 -0
- package/src/plugin/quick-open.ts +32 -6
- package/src/plugin/type-converters.ts +58 -59
- package/src/plugin/types-impl.ts +36 -14
- package/src/plugin/workspace.ts +5 -1
- package/src/plugin-ext-backend-electron-module.ts +2 -2
- package/src/plugin-ext-backend-module.ts +2 -2
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
MarkerData,
|
|
42
42
|
SignatureHelp,
|
|
43
43
|
Hover,
|
|
44
|
+
EvaluatableExpression,
|
|
44
45
|
DocumentHighlight,
|
|
45
46
|
FormattingOptions,
|
|
46
47
|
ChainedCacheId,
|
|
@@ -84,7 +85,7 @@ import {
|
|
|
84
85
|
ProgressOptions,
|
|
85
86
|
} from '@theia/plugin';
|
|
86
87
|
import { DebuggerDescription } from '@theia/debug/lib/common/debug-service';
|
|
87
|
-
import { DebugProtocol } from 'vscode
|
|
88
|
+
import { DebugProtocol } from '@vscode/debugprotocol';
|
|
88
89
|
import { SymbolInformation } from '@theia/core/shared/vscode-languageserver-protocol';
|
|
89
90
|
import { ArgumentProcessor } from '../plugin/command-registry';
|
|
90
91
|
import * as files from '@theia/filesystem/lib/common/files';
|
|
@@ -424,7 +425,7 @@ export type Item = string | theia.QuickPickItem;
|
|
|
424
425
|
|
|
425
426
|
export interface QuickOpenExt {
|
|
426
427
|
$onItemSelected(handle: number): void;
|
|
427
|
-
$validateInput(input: string): Promise<string | null | undefined> | undefined;
|
|
428
|
+
$validateInput(input: string): Promise<string | { content: string; severity: Severity; } | null | undefined> | undefined;
|
|
428
429
|
|
|
429
430
|
$acceptOnDidAccept(sessionId: number): Promise<void>;
|
|
430
431
|
$acceptDidChangeValue(sessionId: number, changedValue: string): Promise<void>;
|
|
@@ -733,7 +734,7 @@ export interface TreeViewSelection {
|
|
|
733
734
|
treeItemId: string
|
|
734
735
|
}
|
|
735
736
|
export namespace TreeViewSelection {
|
|
736
|
-
export function is(arg:
|
|
737
|
+
export function is(arg: unknown): arg is TreeViewSelection {
|
|
737
738
|
return !!arg && typeof arg === 'object' && 'treeViewId' in arg && 'treeItemId' in arg;
|
|
738
739
|
}
|
|
739
740
|
}
|
|
@@ -779,7 +780,7 @@ export interface ScmCommandArg {
|
|
|
779
780
|
resourceStateHandle?: number
|
|
780
781
|
}
|
|
781
782
|
export namespace ScmCommandArg {
|
|
782
|
-
export function is(arg:
|
|
783
|
+
export function is(arg: unknown): arg is ScmCommandArg {
|
|
783
784
|
return !!arg && typeof arg === 'object' && 'sourceControlHandle' in arg;
|
|
784
785
|
}
|
|
785
786
|
}
|
|
@@ -795,7 +796,7 @@ export interface ScmExt {
|
|
|
795
796
|
}
|
|
796
797
|
|
|
797
798
|
export namespace TimelineCommandArg {
|
|
798
|
-
export function is(arg:
|
|
799
|
+
export function is(arg: unknown): arg is TimelineCommandArg {
|
|
799
800
|
return !!arg && typeof arg === 'object' && 'timelineHandle' in arg;
|
|
800
801
|
}
|
|
801
802
|
}
|
|
@@ -814,7 +815,7 @@ export type DecorationData = [boolean, string, string, ThemeColor];
|
|
|
814
815
|
export interface DecorationReply { [id: number]: DecorationData; }
|
|
815
816
|
|
|
816
817
|
export namespace CommentsCommandArg {
|
|
817
|
-
export function is(arg:
|
|
818
|
+
export function is(arg: unknown): arg is CommentsCommandArg {
|
|
818
819
|
return !!arg && typeof arg === 'object' && 'commentControlHandle' in arg && 'commentThreadHandle' in arg && 'text' in arg && !('commentUniqueId' in arg);
|
|
819
820
|
}
|
|
820
821
|
}
|
|
@@ -825,7 +826,7 @@ export interface CommentsCommandArg {
|
|
|
825
826
|
}
|
|
826
827
|
|
|
827
828
|
export namespace CommentsContextCommandArg {
|
|
828
|
-
export function is(arg:
|
|
829
|
+
export function is(arg: unknown): arg is CommentsContextCommandArg {
|
|
829
830
|
return !!arg && typeof arg === 'object' && 'commentControlHandle' in arg && 'commentThreadHandle' in arg && 'commentUniqueId' in arg && !('text' in arg);
|
|
830
831
|
}
|
|
831
832
|
}
|
|
@@ -836,7 +837,7 @@ export interface CommentsContextCommandArg {
|
|
|
836
837
|
}
|
|
837
838
|
|
|
838
839
|
export namespace CommentsEditCommandArg {
|
|
839
|
-
export function is(arg:
|
|
840
|
+
export function is(arg: unknown): arg is CommentsEditCommandArg {
|
|
840
841
|
return !!arg && typeof arg === 'object' && 'commentControlHandle' in arg && 'commentThreadHandle' in arg && 'commentUniqueId' in arg && 'text' in arg;
|
|
841
842
|
}
|
|
842
843
|
}
|
|
@@ -1470,6 +1471,7 @@ export interface LanguagesExt {
|
|
|
1470
1471
|
): Promise<SignatureHelp | undefined>;
|
|
1471
1472
|
$releaseSignatureHelp(handle: number, id: number): void;
|
|
1472
1473
|
$provideHover(handle: number, resource: UriComponents, position: Position, token: CancellationToken): Promise<Hover | undefined>;
|
|
1474
|
+
$provideEvaluatableExpression(handle: number, resource: UriComponents, position: Position, token: CancellationToken): Promise<EvaluatableExpression | undefined>;
|
|
1473
1475
|
$provideDocumentHighlights(handle: number, resource: UriComponents, position: Position, token: CancellationToken): Promise<DocumentHighlight[] | undefined>;
|
|
1474
1476
|
$provideDocumentFormattingEdits(handle: number, resource: UriComponents,
|
|
1475
1477
|
options: FormattingOptions, token: CancellationToken): Promise<TextEdit[] | undefined>;
|
|
@@ -1546,6 +1548,7 @@ export interface LanguagesMain {
|
|
|
1546
1548
|
$registerReferenceProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[]): void;
|
|
1547
1549
|
$registerSignatureHelpProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[], metadata: theia.SignatureHelpProviderMetadata): void;
|
|
1548
1550
|
$registerHoverProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[]): void;
|
|
1551
|
+
$registerEvaluatableExpressionProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[]): void;
|
|
1549
1552
|
$registerDocumentHighlightProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[]): void;
|
|
1550
1553
|
$registerQuickFixProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[], codeActionKinds?: string[], documentation?: CodeActionProviderDocumentation): void;
|
|
1551
1554
|
$clearDiagnostics(id: string): void;
|
|
@@ -1940,20 +1943,15 @@ export interface AuthenticationExt {
|
|
|
1940
1943
|
$getSessions(id: string, scopes?: string[]): Promise<ReadonlyArray<theia.AuthenticationSession>>;
|
|
1941
1944
|
$createSession(id: string, scopes: string[]): Promise<theia.AuthenticationSession>;
|
|
1942
1945
|
$removeSession(id: string, sessionId: string): Promise<void>;
|
|
1943
|
-
$onDidChangeAuthenticationSessions(
|
|
1944
|
-
$onDidChangeAuthenticationProviders(added: theia.AuthenticationProviderInformation[], removed: theia.AuthenticationProviderInformation[]): Promise<void>;
|
|
1945
|
-
$setProviders(providers: theia.AuthenticationProviderInformation[]): Promise<void>;
|
|
1946
|
+
$onDidChangeAuthenticationSessions(provider: theia.AuthenticationProviderInformation): Promise<void>;
|
|
1946
1947
|
}
|
|
1947
1948
|
|
|
1948
1949
|
export interface AuthenticationMain {
|
|
1949
1950
|
$registerAuthenticationProvider(id: string, label: string, supportsMultipleAccounts: boolean): void;
|
|
1950
1951
|
$unregisterAuthenticationProvider(id: string): void;
|
|
1951
|
-
$
|
|
1952
|
-
$ensureProvider(id: string): Promise<void>;
|
|
1953
|
-
$sendDidChangeSessions(providerId: string, event: AuthenticationProviderAuthenticationSessionsChangeEvent): void;
|
|
1952
|
+
$onDidChangeSessions(providerId: string, event: AuthenticationProviderAuthenticationSessionsChangeEvent): void;
|
|
1954
1953
|
$getSession(providerId: string, scopes: readonly string[], extensionId: string, extensionName: string,
|
|
1955
1954
|
options: theia.AuthenticationGetSessionOptions): Promise<theia.AuthenticationSession | undefined>;
|
|
1956
|
-
$removeSession(providerId: string, sessionId: string): Promise<void>;
|
|
1957
1955
|
}
|
|
1958
1956
|
|
|
1959
1957
|
export interface RawColorInfo {
|
|
@@ -70,9 +70,8 @@ export namespace ConnectionClosedError {
|
|
|
70
70
|
export function create(message: string = 'connection is closed'): ConnectionClosedError {
|
|
71
71
|
return Object.assign(new Error(message), { code });
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return !!error && typeof error === 'object' && 'code' in error && error['code'] === code;
|
|
73
|
+
export function is(error: unknown): error is ConnectionClosedError {
|
|
74
|
+
return !!error && typeof error === 'object' && 'code' in error && (error as ConnectionClosedError).code === code;
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
77
|
|
|
@@ -469,8 +468,9 @@ enum SerializedObjectType {
|
|
|
469
468
|
TEXT_BUFFER
|
|
470
469
|
}
|
|
471
470
|
|
|
472
|
-
function isSerializedObject(obj:
|
|
473
|
-
|
|
471
|
+
function isSerializedObject(obj: unknown): obj is SerializedObject {
|
|
472
|
+
const serializedObject = obj as SerializedObject;
|
|
473
|
+
return !!obj && typeof obj === 'object' && serializedObject.$type !== undefined && serializedObject.data !== undefined;
|
|
474
474
|
}
|
|
475
475
|
|
|
476
476
|
export const enum MessageType {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
// code copied and modified from https://github.com/microsoft/vscode/blob/1.47.3/src/vs/workbench/api/browser/mainThreadAuthentication.ts
|
|
22
22
|
|
|
23
23
|
import { interfaces } from '@theia/core/shared/inversify';
|
|
24
|
-
import { AuthenticationExt, AuthenticationMain,
|
|
24
|
+
import { AuthenticationExt, AuthenticationMain, MAIN_RPC_CONTEXT } from '../../common/plugin-api-rpc';
|
|
25
25
|
import { RPCProtocol } from '../../common/rpc-protocol';
|
|
26
26
|
import { MessageService } from '@theia/core/lib/common/message-service';
|
|
27
27
|
import { Dialog, StorageService } from '@theia/core/lib/browser';
|
|
@@ -43,28 +43,17 @@ export class AuthenticationMainImpl implements AuthenticationMain {
|
|
|
43
43
|
private readonly storageService: StorageService;
|
|
44
44
|
private readonly authenticationService: AuthenticationService;
|
|
45
45
|
private readonly quickPickService: QuickPickService;
|
|
46
|
-
private readonly extensionService: PluginManagerExt;
|
|
47
46
|
constructor(rpc: RPCProtocol, container: interfaces.Container) {
|
|
48
47
|
this.proxy = rpc.getProxy(MAIN_RPC_CONTEXT.AUTHENTICATION_EXT);
|
|
49
48
|
this.messageService = container.get(MessageService);
|
|
50
49
|
this.storageService = container.get(StorageService);
|
|
51
50
|
this.authenticationService = container.get(AuthenticationService);
|
|
52
51
|
this.quickPickService = container.get(QuickPickService);
|
|
53
|
-
this.extensionService = rpc.getProxy(MAIN_RPC_CONTEXT.HOSTED_PLUGIN_MANAGER_EXT);
|
|
54
52
|
|
|
55
53
|
this.authenticationService.onDidChangeSessions(e => {
|
|
56
|
-
this.proxy.$onDidChangeAuthenticationSessions(e.providerId, e.label);
|
|
57
|
-
});
|
|
58
|
-
this.authenticationService.onDidRegisterAuthenticationProvider(info => {
|
|
59
|
-
this.proxy.$onDidChangeAuthenticationProviders([info], []);
|
|
60
|
-
});
|
|
61
|
-
this.authenticationService.onDidUnregisterAuthenticationProvider(providerId => {
|
|
62
|
-
this.proxy.$onDidChangeAuthenticationProviders([], [providerId]);
|
|
54
|
+
this.proxy.$onDidChangeAuthenticationSessions({ id: e.providerId, label: e.label });
|
|
63
55
|
});
|
|
64
56
|
}
|
|
65
|
-
$getProviderIds(): Promise<string[]> {
|
|
66
|
-
return Promise.resolve(this.authenticationService.getProviderIds());
|
|
67
|
-
}
|
|
68
57
|
|
|
69
58
|
async $registerAuthenticationProvider(id: string, label: string, supportsMultipleAccounts: boolean): Promise<void> {
|
|
70
59
|
const provider = new AuthenticationProviderImpl(this.proxy, id, label, supportsMultipleAccounts, this.storageService, this.messageService);
|
|
@@ -230,15 +219,7 @@ export class AuthenticationMainImpl implements AuthenticationMain {
|
|
|
230
219
|
this.storageService.setData(`authentication-session-${extensionName}-${providerId}`, sessionId);
|
|
231
220
|
}
|
|
232
221
|
|
|
233
|
-
$
|
|
234
|
-
return this.extensionService.$activateByEvent(getAuthenticationProviderActivationEvent(id));
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
$removeSession(providerId: string, sessionId: string): Promise<void> {
|
|
238
|
-
return this.authenticationService.logout(providerId, sessionId);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
$sendDidChangeSessions(providerId: string, event: theia.AuthenticationProviderAuthenticationSessionsChangeEvent): void {
|
|
222
|
+
$onDidChangeSessions(providerId: string, event: theia.AuthenticationProviderAuthenticationSessionsChangeEvent): void {
|
|
242
223
|
this.authenticationService.updateSessions(providerId, event);
|
|
243
224
|
}
|
|
244
225
|
}
|
|
@@ -272,8 +253,10 @@ interface AccountUsage {
|
|
|
272
253
|
}
|
|
273
254
|
|
|
274
255
|
export class AuthenticationProviderImpl implements AuthenticationProvider {
|
|
275
|
-
|
|
276
|
-
private
|
|
256
|
+
/** map from account name to session ids */
|
|
257
|
+
private accounts = new Map<string, string[]>();
|
|
258
|
+
/** map from session id to account name */
|
|
259
|
+
private sessions = new Map<string, string>();
|
|
277
260
|
|
|
278
261
|
readonly onDidChangeSessions: theia.Event<theia.AuthenticationProviderAuthenticationSessionsChangeEvent>;
|
|
279
262
|
|
|
@@ -313,7 +296,7 @@ export class AuthenticationProviderImpl implements AuthenticationProvider {
|
|
|
313
296
|
Dialog.CANCEL);
|
|
314
297
|
|
|
315
298
|
if (result && result === nls.localizeByDefault('Sign Out') && sessionsForAccount) {
|
|
316
|
-
sessionsForAccount.forEach(sessionId => this.
|
|
299
|
+
sessionsForAccount.forEach(sessionId => this.removeSession(sessionId));
|
|
317
300
|
removeAccountUsage(this.storageService, this.id, accountName);
|
|
318
301
|
}
|
|
319
302
|
}
|
|
@@ -325,10 +308,10 @@ export class AuthenticationProviderImpl implements AuthenticationProvider {
|
|
|
325
308
|
async updateSessionItems(event: theia.AuthenticationProviderAuthenticationSessionsChangeEvent): Promise<void> {
|
|
326
309
|
const { added, removed } = event;
|
|
327
310
|
const session = await this.proxy.$getSessions(this.id);
|
|
328
|
-
const addedSessions = session.filter(s => added.some(addedSession =>
|
|
311
|
+
const addedSessions = added ? session.filter(s => added.some(addedSession => addedSession.id === s.id)) : [];
|
|
329
312
|
|
|
330
|
-
removed
|
|
331
|
-
const sessionId =
|
|
313
|
+
removed?.forEach(removedSession => {
|
|
314
|
+
const sessionId = removedSession.id;
|
|
332
315
|
if (sessionId) {
|
|
333
316
|
const accountName = this.sessions.get(sessionId);
|
|
334
317
|
if (accountName) {
|
|
@@ -347,29 +330,21 @@ export class AuthenticationProviderImpl implements AuthenticationProvider {
|
|
|
347
330
|
addedSessions.forEach(s => this.registerSession(s));
|
|
348
331
|
}
|
|
349
332
|
|
|
350
|
-
login(scopes: string[]): Promise<theia.AuthenticationSession> {
|
|
351
|
-
return this.
|
|
333
|
+
async login(scopes: string[]): Promise<theia.AuthenticationSession> {
|
|
334
|
+
return this.createSession(scopes);
|
|
352
335
|
}
|
|
353
336
|
|
|
354
337
|
async logout(sessionId: string): Promise<void> {
|
|
355
|
-
|
|
356
|
-
this.messageService.info('Successfully signed out.');
|
|
338
|
+
return this.removeSession(sessionId);
|
|
357
339
|
}
|
|
358
340
|
|
|
359
341
|
createSession(scopes: string[]): Thenable<theia.AuthenticationSession> {
|
|
360
|
-
return this.
|
|
342
|
+
return this.proxy.$createSession(this.id, scopes);
|
|
361
343
|
}
|
|
362
344
|
|
|
363
345
|
removeSession(sessionId: string): Thenable<void> {
|
|
364
|
-
return this.
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
// utility method to be backwards compatible with the old AuthenticationProviderAuthenticationSessionsChangeEvent containing only the session id string
|
|
368
|
-
private getSessionId(obj: string | theia.AuthenticationSession | undefined): string | undefined {
|
|
369
|
-
if (!obj || typeof obj === 'string') {
|
|
370
|
-
return obj;
|
|
371
|
-
}
|
|
372
|
-
return obj.id;
|
|
346
|
+
return this.proxy.$removeSession(this.id, sessionId)
|
|
347
|
+
.then(() => { this.messageService.info('Successfully signed out.'); });
|
|
373
348
|
}
|
|
374
349
|
}
|
|
375
350
|
|
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
} from '../../../common/plugin-api-rpc-model';
|
|
23
23
|
import { CommentGlyphWidget } from './comment-glyph-widget';
|
|
24
24
|
import { BaseWidget, DISABLED_CLASS } from '@theia/core/lib/browser';
|
|
25
|
-
import * as ReactDOM from '@theia/core/shared/react-dom';
|
|
26
25
|
import * as React from '@theia/core/shared/react';
|
|
27
26
|
import { MouseTargetType } from '@theia/editor/lib/browser';
|
|
28
27
|
import { CommentsService } from './comments-service';
|
|
@@ -36,6 +35,7 @@ import {
|
|
|
36
35
|
import { CommentsContextKeyService } from './comments-context-key-service';
|
|
37
36
|
import { RefObject } from '@theia/core/shared/react';
|
|
38
37
|
import * as monaco from '@theia/monaco-editor-core';
|
|
38
|
+
import { createRoot, Root } from '@theia/core/shared/react-dom/client';
|
|
39
39
|
|
|
40
40
|
/*---------------------------------------------------------------------------------------------
|
|
41
41
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -50,6 +50,7 @@ export const COMMENT_TITLE: MenuPath = ['comment-title-menu'];
|
|
|
50
50
|
export class CommentThreadWidget extends BaseWidget {
|
|
51
51
|
|
|
52
52
|
protected readonly zoneWidget: MonacoEditorZoneWidget;
|
|
53
|
+
protected readonly containerNodeRoot: Root;
|
|
53
54
|
protected readonly commentGlyphWidget: CommentGlyphWidget;
|
|
54
55
|
protected readonly contextMenu: CompositeMenuNode;
|
|
55
56
|
protected readonly commentFormRef: RefObject<CommentForm> = React.createRef<CommentForm>();
|
|
@@ -67,6 +68,7 @@ export class CommentThreadWidget extends BaseWidget {
|
|
|
67
68
|
) {
|
|
68
69
|
super();
|
|
69
70
|
this.toDispose.push(this.zoneWidget = new MonacoEditorZoneWidget(editor));
|
|
71
|
+
this.containerNodeRoot = createRoot(this.zoneWidget.containerNode);
|
|
70
72
|
this.toDispose.push(this.commentGlyphWidget = new CommentGlyphWidget(editor));
|
|
71
73
|
this.toDispose.push(this._commentThread.onDidChangeCollapsibleState(state => {
|
|
72
74
|
if (state === CommentThreadCollapsibleState.Expanded && !this.isExpanded) {
|
|
@@ -255,7 +257,7 @@ export class CommentThreadWidget extends BaseWidget {
|
|
|
255
257
|
|
|
256
258
|
protected render(): void {
|
|
257
259
|
const headHeight = Math.ceil(this.zoneWidget.editor.getOption(monaco.editor.EditorOption.lineHeight) * 1.2);
|
|
258
|
-
|
|
260
|
+
this.containerNodeRoot.render(<div className={'review-widget'}>
|
|
259
261
|
<div className={'head'} style={{ height: headHeight, lineHeight: `${headHeight}px` }}>
|
|
260
262
|
<div className={'review-title'}>
|
|
261
263
|
<span className={'filename'}>{this.getThreadLabel()}</span>
|
|
@@ -295,7 +297,7 @@ export class CommentThreadWidget extends BaseWidget {
|
|
|
295
297
|
ref={this.commentFormRef}
|
|
296
298
|
/>
|
|
297
299
|
</div>
|
|
298
|
-
</div
|
|
300
|
+
</div>);
|
|
299
301
|
}
|
|
300
302
|
}
|
|
301
303
|
|
|
@@ -34,7 +34,7 @@ import { URI as Uri } from '@theia/core/shared/vscode-uri';
|
|
|
34
34
|
import { SourceBreakpoint, FunctionBreakpoint } from '@theia/debug/lib/browser/breakpoint/breakpoint-marker';
|
|
35
35
|
import { DebugConfiguration, DebugSessionOptions } from '@theia/debug/lib/common/debug-configuration';
|
|
36
36
|
import { DebuggerDescription } from '@theia/debug/lib/common/debug-service';
|
|
37
|
-
import { DebugProtocol } from 'vscode
|
|
37
|
+
import { DebugProtocol } from '@vscode/debugprotocol';
|
|
38
38
|
import { DebugConfigurationManager } from '@theia/debug/lib/browser/debug-configuration-manager';
|
|
39
39
|
import { TerminalService } from '@theia/terminal/lib/browser/base/terminal-service';
|
|
40
40
|
import { MessageClient } from '@theia/core/lib/common/message-service-protocol';
|
|
@@ -55,6 +55,7 @@ import { ContributionProvider } from '@theia/core/lib/common';
|
|
|
55
55
|
import { DebugContribution } from '@theia/debug/lib/browser/debug-contribution';
|
|
56
56
|
import { ConnectionImpl } from '../../../common/connection';
|
|
57
57
|
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
58
|
+
import { DebugSessionOptions as TheiaDebugSessionOptions } from '@theia/debug/lib/browser/debug-session-options';
|
|
58
59
|
|
|
59
60
|
export class DebugMainImpl implements DebugMain, Disposable {
|
|
60
61
|
private readonly debugExt: DebugExt;
|
|
@@ -294,29 +295,36 @@ export class DebugMainImpl implements DebugMain, Disposable {
|
|
|
294
295
|
}
|
|
295
296
|
|
|
296
297
|
async $startDebugging(folder: WorkspaceFolder | undefined, nameOrConfiguration: string | DebugConfiguration, options: DebugSessionOptions): Promise<boolean> {
|
|
297
|
-
|
|
298
|
-
|
|
298
|
+
// search for matching options
|
|
299
|
+
let sessionOptions: TheiaDebugSessionOptions | undefined;
|
|
299
300
|
if (typeof nameOrConfiguration === 'string') {
|
|
300
301
|
for (const configOptions of this.configurationManager.all) {
|
|
301
|
-
if (configOptions.
|
|
302
|
-
|
|
302
|
+
if (configOptions.name === nameOrConfiguration) {
|
|
303
|
+
sessionOptions = configOptions;
|
|
303
304
|
}
|
|
304
305
|
}
|
|
305
306
|
} else {
|
|
306
|
-
|
|
307
|
+
sessionOptions = {
|
|
308
|
+
name: nameOrConfiguration.name,
|
|
309
|
+
configuration: nameOrConfiguration
|
|
310
|
+
};
|
|
307
311
|
}
|
|
308
312
|
|
|
309
|
-
if (!
|
|
313
|
+
if (!sessionOptions) {
|
|
310
314
|
console.error(`There is no debug configuration for ${nameOrConfiguration}`);
|
|
311
315
|
return false;
|
|
312
316
|
}
|
|
313
317
|
|
|
314
|
-
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}
|
|
318
|
+
// translate given extra data
|
|
319
|
+
const workspaceFolderUri = folder && Uri.revive(folder.uri).toString();
|
|
320
|
+
if (TheiaDebugSessionOptions.isConfiguration(sessionOptions)) {
|
|
321
|
+
sessionOptions = { ...sessionOptions, configuration: { ...sessionOptions.configuration, ...options }, workspaceFolderUri };
|
|
322
|
+
} else {
|
|
323
|
+
sessionOptions = { ...sessionOptions, ...options, workspaceFolderUri };
|
|
324
|
+
}
|
|
319
325
|
|
|
326
|
+
// start options
|
|
327
|
+
const session = await this.sessionManager.start(sessionOptions);
|
|
320
328
|
return !!session;
|
|
321
329
|
}
|
|
322
330
|
|
|
@@ -22,7 +22,7 @@ import { LabelProvider } from '@theia/core/lib/browser/label-provider';
|
|
|
22
22
|
import { MessageClient } from '@theia/core/lib/common/message-service-protocol';
|
|
23
23
|
import { OutputChannelManager } from '@theia/output/lib/browser/output-channel';
|
|
24
24
|
import { DebugPreferences } from '@theia/debug/lib/browser/debug-preferences';
|
|
25
|
-
import {
|
|
25
|
+
import { DebugConfigurationSessionOptions } from '@theia/debug/lib/browser/debug-session-options';
|
|
26
26
|
import { DebugSession } from '@theia/debug/lib/browser/debug-session';
|
|
27
27
|
import { DebugSessionConnection } from '@theia/debug/lib/browser/debug-session-connection';
|
|
28
28
|
import { TerminalWidgetOptions, TerminalWidget } from '@theia/terminal/lib/browser/base/terminal-widget';
|
|
@@ -36,7 +36,7 @@ import { PluginChannel } from '../../../common/connection';
|
|
|
36
36
|
export class PluginDebugSession extends DebugSession {
|
|
37
37
|
constructor(
|
|
38
38
|
override readonly id: string,
|
|
39
|
-
override readonly options:
|
|
39
|
+
override readonly options: DebugConfigurationSessionOptions,
|
|
40
40
|
override readonly parentSession: DebugSession | undefined,
|
|
41
41
|
protected override readonly connection: DebugSessionConnection,
|
|
42
42
|
protected override readonly terminalServer: TerminalService,
|
|
@@ -80,7 +80,7 @@ export class PluginDebugSessionFactory extends DefaultDebugSessionFactory {
|
|
|
80
80
|
super();
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
override get(sessionId: string, options:
|
|
83
|
+
override get(sessionId: string, options: DebugConfigurationSessionOptions, parentSession?: DebugSession): DebugSession {
|
|
84
84
|
const connection = new DebugSessionConnection(
|
|
85
85
|
sessionId,
|
|
86
86
|
this.connectionFactory,
|
|
@@ -66,6 +66,9 @@ import * as MonacoPath from '@theia/monaco-editor-core/esm/vs/base/common/path';
|
|
|
66
66
|
import { IRelativePattern } from '@theia/monaco-editor-core/esm/vs/base/common/glob';
|
|
67
67
|
import { EditorLanguageStatusService, LanguageStatus as EditorLanguageStatus } from '@theia/editor/lib/browser/language-status/editor-language-status-service';
|
|
68
68
|
import { LanguageSelector, RelativePattern } from '@theia/editor/lib/common/language-selector';
|
|
69
|
+
import { ILanguageFeaturesService } from '@theia/monaco-editor-core/esm/vs/editor/common/services/languageFeatures';
|
|
70
|
+
import { EvaluatableExpression, EvaluatableExpressionProvider } from '@theia/monaco-editor-core/esm/vs/editor/common/languages';
|
|
71
|
+
import { ITextModel } from '@theia/monaco-editor-core/esm/vs/editor/common/model';
|
|
69
72
|
|
|
70
73
|
/**
|
|
71
74
|
* @monaco-uplift The public API declares these functions as (languageId: string, service).
|
|
@@ -338,7 +341,26 @@ export class LanguagesMainImpl implements LanguagesMain, Disposable {
|
|
|
338
341
|
return this.proxy.$provideHover(handle, model.uri, position, token);
|
|
339
342
|
}
|
|
340
343
|
|
|
341
|
-
$
|
|
344
|
+
$registerEvaluatableExpressionProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[]): void {
|
|
345
|
+
const languageSelector = this.toLanguageSelector(selector);
|
|
346
|
+
const evaluatableExpressionProvider = this.createEvaluatableExpressionProvider(handle);
|
|
347
|
+
this.register(handle,
|
|
348
|
+
(StandaloneServices.get(ILanguageFeaturesService).evaluatableExpressionProvider.register as RegistrationFunction<EvaluatableExpressionProvider>)
|
|
349
|
+
(languageSelector, evaluatableExpressionProvider));
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
protected createEvaluatableExpressionProvider(handle: number): EvaluatableExpressionProvider {
|
|
353
|
+
return {
|
|
354
|
+
provideEvaluatableExpression: (model, position, token) => this.provideEvaluatableExpression(handle, model, position, token)
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
protected provideEvaluatableExpression(handle: number, model: ITextModel, position: monaco.Position,
|
|
359
|
+
token: monaco.CancellationToken): monaco.languages.ProviderResult<EvaluatableExpression | undefined> {
|
|
360
|
+
return this.proxy.$provideEvaluatableExpression(handle, model.uri, position, token);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
$registerDocumentHighlightProvider(handle: number, _pluginInfo: PluginInfo, selector: SerializedDocumentFilter[]): void {
|
|
342
364
|
const languageSelector = this.toLanguageSelector(selector);
|
|
343
365
|
const documentHighlightProvider = this.createDocumentHighlightProvider(handle);
|
|
344
366
|
this.register(handle, (monaco.languages.registerDocumentHighlightProvider as RegistrationFunction<monaco.languages.DocumentHighlightProvider>)
|
|
@@ -79,6 +79,7 @@ import { AuthenticationService } from '@theia/core/lib/browser/authentication-se
|
|
|
79
79
|
import { bindTreeViewDecoratorUtilities, TreeViewDecoratorService } from './view/tree-view-decorator-service';
|
|
80
80
|
import { CodeEditorWidgetUtil } from './menus/vscode-theia-menu-mappings';
|
|
81
81
|
import { PluginMenuCommandAdapter } from './menus/plugin-menu-command-adapter';
|
|
82
|
+
import './theme-icon-override';
|
|
82
83
|
|
|
83
84
|
export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
84
85
|
|