@codingame/monaco-vscode-extensions-service-override 1.83.8 → 1.83.9
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/assets/webWorkerExtensionHostIframe.html +123 -0
- package/extensions.d.ts +12 -13
- package/extensions.js +456 -0
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/override/vs/platform/dialogs/common/dialogs.js +8 -0
- package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +8 -0
- package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +3 -0
- package/package.json +5 -3
- package/tools/url.js +10 -0
- package/tools.js +5 -0
- package/vscode/src/vs/base/common/console.js +59 -0
- package/vscode/src/vs/base/common/prefixTree.js +131 -0
- package/vscode/src/vs/platform/files/common/watcher.js +71 -0
- package/vscode/src/vs/platform/lifecycle/common/lifecycle.js +27 -0
- package/vscode/src/vs/platform/log/browser/log.js +26 -0
- package/vscode/src/vs/platform/remote/common/managedSocket.js +98 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +31 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +35 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +330 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +174 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents.js +52 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatProvider.js +61 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSlashCommands.js +49 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +31 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +107 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +94 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +541 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +80 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +35 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +578 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +387 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +102 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +69 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +75 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +249 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +370 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +22 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +41 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +411 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +475 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +227 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +317 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +280 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +283 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +28 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +33 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +27 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +947 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +78 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +35 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +78 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +93 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +118 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +158 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +123 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +188 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +129 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +131 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +341 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +25 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +48 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +76 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadProfilContentHandlers.js +38 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +68 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +49 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +185 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +30 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +463 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +49 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +148 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +70 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +50 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +53 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +72 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +731 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +53 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +412 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +182 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +55 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +313 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +223 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +110 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +61 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +29 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +283 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +100 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +135 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +57 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +273 -0
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHost.api.impl.d.ts +2 -2
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostConfiguration.d.ts +3 -3
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostExtensionService.d.ts +3 -4
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostManagedSockets.d.ts +2 -2
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTerminalService.d.ts +19 -20
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTunnelService.d.ts +7 -8
- package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostWorkspace.d.ts +25 -26
- package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +35 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +217 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +57 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +51 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +92 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +648 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +297 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +62 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +249 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +109 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +109 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +331 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +380 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +5 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +1196 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +19 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +334 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +543 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +178 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +101 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +57 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +145 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +3 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +73 -0
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +83 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +179 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +5 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +144 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +482 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +6 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +85 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +56 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +110 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +260 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +616 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +309 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +38 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +167 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +80 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +70 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +108 -0
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +506 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +132 -0
- package/vscode/src/vs/workbench/contrib/testing/common/getComputedState.js +103 -0
- package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +28 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +25 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +336 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testingStates.js +46 -0
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +283 -0
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +273 -0
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +52 -0
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +1093 -0
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +41 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionDevOptions.js +25 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +643 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +274 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +58 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +80 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +64 -0
- package/vscode/src/vs/workbench/services/extensions/common/remoteConsoleUtil.js +49 -0
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +220 -0
- package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +5 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +79 -0
- package/vscode-proposed.d.ts +0 -3872
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHost.protocol.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostExtensionActivator.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostFileSystemInfo.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostInitDataService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostLocalizationService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostRpcService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostStoragePaths.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTypes.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostUriTransformerService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/api/worker/extHostExtensionService.d.ts +0 -0
- /package/{dist/main/vscode → vscode}/src/vs/workbench/services/search/common/queryBuilder.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ServiceIdentifier } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
2
2
|
import { IDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
-
import { CancellationToken
|
|
3
|
+
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
4
4
|
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
5
5
|
import { URI, UriComponents } from 'vscode/vscode/vs/base/common/uri';
|
|
6
6
|
import { IExtensionDescription, ExtensionIdentifier } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
@@ -12,20 +12,19 @@ import { IExtHostInitDataService } from './extHostInitDataService.js';
|
|
|
12
12
|
import { IExtHostRpcService } from './extHostRpcService.js';
|
|
13
13
|
import { IURITransformerService } from './extHostUriTransformerService.js';
|
|
14
14
|
import { IRawFileMatch2 } from 'vscode/vscode/vs/workbench/services/search/common/search';
|
|
15
|
-
import
|
|
15
|
+
import * as vscode from 'vscode';
|
|
16
16
|
import { ExtHostWorkspaceShape, IWorkspaceData } from './extHost.protocol.js';
|
|
17
|
-
import { WorkspaceFoldersChangeEvent, Uri, WorkspaceFolder, GlobPattern, CancellationToken } from 'vscode';
|
|
18
17
|
|
|
19
18
|
interface IExtHostWorkspaceProvider {
|
|
20
|
-
getWorkspaceFolder2(uri: Uri, resolveParent?: boolean): Promise<WorkspaceFolder | undefined>;
|
|
21
|
-
resolveWorkspaceFolder(uri: Uri): Promise<WorkspaceFolder | undefined>;
|
|
22
|
-
getWorkspaceFolders2(): Promise<WorkspaceFolder[] | undefined>;
|
|
19
|
+
getWorkspaceFolder2(uri: vscode.Uri, resolveParent?: boolean): Promise<vscode.WorkspaceFolder | undefined>;
|
|
20
|
+
resolveWorkspaceFolder(uri: vscode.Uri): Promise<vscode.WorkspaceFolder | undefined>;
|
|
21
|
+
getWorkspaceFolders2(): Promise<vscode.WorkspaceFolder[] | undefined>;
|
|
23
22
|
resolveProxy(url: string): Promise<string | undefined>;
|
|
24
23
|
}
|
|
25
24
|
declare class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspaceProvider {
|
|
26
25
|
readonly _serviceBrand: undefined;
|
|
27
26
|
private readonly _onDidChangeWorkspace;
|
|
28
|
-
readonly onDidChangeWorkspace: Event<WorkspaceFoldersChangeEvent>;
|
|
27
|
+
readonly onDidChangeWorkspace: Event<vscode.WorkspaceFoldersChangeEvent>;
|
|
29
28
|
private readonly _onDidGrantWorkspaceTrust;
|
|
30
29
|
readonly onDidGrantWorkspaceTrust: Event<void>;
|
|
31
30
|
private readonly _logService;
|
|
@@ -45,45 +44,45 @@ declare class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspa
|
|
|
45
44
|
waitForInitializeCall(): Promise<boolean>;
|
|
46
45
|
get workspace(): Workspace | undefined;
|
|
47
46
|
get name(): string | undefined;
|
|
48
|
-
get workspaceFile(): Uri | undefined;
|
|
47
|
+
get workspaceFile(): vscode.Uri | undefined;
|
|
49
48
|
private get _actualWorkspace();
|
|
50
|
-
getWorkspaceFolders(): WorkspaceFolder[] | undefined;
|
|
51
|
-
getWorkspaceFolders2(): Promise<WorkspaceFolder[] | undefined>;
|
|
49
|
+
getWorkspaceFolders(): vscode.WorkspaceFolder[] | undefined;
|
|
50
|
+
getWorkspaceFolders2(): Promise<vscode.WorkspaceFolder[] | undefined>;
|
|
52
51
|
updateWorkspaceFolders(extension: IExtensionDescription, index: number, deleteCount: number, ...workspaceFoldersToAdd: {
|
|
53
|
-
uri: Uri;
|
|
52
|
+
uri: vscode.Uri;
|
|
54
53
|
name?: string;
|
|
55
54
|
}[]): boolean;
|
|
56
|
-
getWorkspaceFolder(uri: Uri, resolveParent?: boolean): WorkspaceFolder | undefined;
|
|
57
|
-
getWorkspaceFolder2(uri: Uri, resolveParent?: boolean): Promise<WorkspaceFolder | undefined>;
|
|
58
|
-
resolveWorkspaceFolder(uri: Uri): Promise<WorkspaceFolder | undefined>;
|
|
55
|
+
getWorkspaceFolder(uri: vscode.Uri, resolveParent?: boolean): vscode.WorkspaceFolder | undefined;
|
|
56
|
+
getWorkspaceFolder2(uri: vscode.Uri, resolveParent?: boolean): Promise<vscode.WorkspaceFolder | undefined>;
|
|
57
|
+
resolveWorkspaceFolder(uri: vscode.Uri): Promise<vscode.WorkspaceFolder | undefined>;
|
|
59
58
|
getPath(): string | undefined;
|
|
60
|
-
getRelativePath(pathOrUri: string | Uri, includeWorkspace?: boolean): string;
|
|
59
|
+
getRelativePath(pathOrUri: string | vscode.Uri, includeWorkspace?: boolean): string;
|
|
61
60
|
private trySetWorkspaceFolders;
|
|
62
61
|
$acceptWorkspaceData(data: IWorkspaceData | null): void;
|
|
63
62
|
/**
|
|
64
63
|
* Note, null/undefined have different and important meanings for "exclude"
|
|
65
64
|
*/
|
|
66
|
-
findFiles(include: GlobPattern | undefined, exclude: GlobPattern | null | undefined, maxResults: number | undefined, extensionId: ExtensionIdentifier, token?: CancellationToken): Promise<Uri[]>;
|
|
67
|
-
findTextInFiles(query: TextSearchQuery, options: FindTextInFilesOptions, callback: (result: TextSearchResult) => void, extensionId: ExtensionIdentifier, token?: CancellationToken): Promise<TextSearchComplete>;
|
|
65
|
+
findFiles(include: vscode.GlobPattern | undefined, exclude: vscode.GlobPattern | null | undefined, maxResults: number | undefined, extensionId: ExtensionIdentifier, token?: vscode.CancellationToken): Promise<vscode.Uri[]>;
|
|
66
|
+
findTextInFiles(query: vscode.TextSearchQuery, options: vscode.FindTextInFilesOptions, callback: (result: vscode.TextSearchResult) => void, extensionId: ExtensionIdentifier, token?: vscode.CancellationToken): Promise<vscode.TextSearchComplete>;
|
|
68
67
|
$handleTextSearchResult(result: IRawFileMatch2, requestId: number): void;
|
|
69
68
|
save(uri: URI): Promise<URI | undefined>;
|
|
70
69
|
saveAs(uri: URI): Promise<URI | undefined>;
|
|
71
70
|
saveAll(includeUntitled?: boolean): Promise<boolean>;
|
|
72
71
|
resolveProxy(url: string): Promise<string | undefined>;
|
|
73
72
|
get trusted(): boolean;
|
|
74
|
-
requestWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Promise<boolean | undefined>;
|
|
73
|
+
requestWorkspaceTrust(options?: vscode.WorkspaceTrustRequestOptions): Promise<boolean | undefined>;
|
|
75
74
|
$onDidGrantWorkspaceTrust(): void;
|
|
76
75
|
private _providerHandlePool;
|
|
77
|
-
registerEditSessionIdentityProvider(scheme: string, provider: EditSessionIdentityProvider): IDisposable;
|
|
78
|
-
$getEditSessionIdentifier(workspaceFolder: UriComponents, cancellationToken: CancellationToken
|
|
79
|
-
$provideEditSessionIdentityMatch(workspaceFolder: UriComponents, identity1: string, identity2: string, cancellationToken: CancellationToken
|
|
76
|
+
registerEditSessionIdentityProvider(scheme: string, provider: vscode.EditSessionIdentityProvider): IDisposable;
|
|
77
|
+
$getEditSessionIdentifier(workspaceFolder: UriComponents, cancellationToken: CancellationToken): Promise<string | undefined>;
|
|
78
|
+
$provideEditSessionIdentityMatch(workspaceFolder: UriComponents, identity1: string, identity2: string, cancellationToken: CancellationToken): Promise<EditSessionIdentityMatch | undefined>;
|
|
80
79
|
private readonly _onWillCreateEditSessionIdentityEvent;
|
|
81
|
-
getOnWillCreateEditSessionIdentityEvent(extension: IExtensionDescription): Event<EditSessionIdentityWillCreateEvent>;
|
|
82
|
-
$onWillCreateEditSessionIdentity(workspaceFolder: UriComponents, token: CancellationToken
|
|
80
|
+
getOnWillCreateEditSessionIdentityEvent(extension: IExtensionDescription): Event<vscode.EditSessionIdentityWillCreateEvent>;
|
|
81
|
+
$onWillCreateEditSessionIdentity(workspaceFolder: UriComponents, token: CancellationToken, timeout: number): Promise<void>;
|
|
83
82
|
private readonly _canonicalUriProviders;
|
|
84
|
-
registerCanonicalUriProvider(scheme: string, provider: CanonicalUriProvider): IDisposable;
|
|
85
|
-
provideCanonicalUri(uri: URI, options: CanonicalUriRequestOptions, cancellationToken: CancellationToken
|
|
86
|
-
$provideCanonicalUri(uri: UriComponents, targetScheme: string, cancellationToken: CancellationToken
|
|
83
|
+
registerCanonicalUriProvider(scheme: string, provider: vscode.CanonicalUriProvider): IDisposable;
|
|
84
|
+
provideCanonicalUri(uri: URI, options: vscode.CanonicalUriRequestOptions, cancellationToken: CancellationToken): Promise<URI | undefined>;
|
|
85
|
+
$provideCanonicalUri(uri: UriComponents, targetScheme: string, cancellationToken: CancellationToken): Promise<UriComponents | undefined>;
|
|
87
86
|
}
|
|
88
87
|
declare const IExtHostWorkspace: ServiceIdentifier<IExtHostWorkspace>;
|
|
89
88
|
interface IExtHostWorkspace extends ExtHostWorkspace, ExtHostWorkspaceShape, IExtHostWorkspaceProvider {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { coalesce } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
2
|
+
import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
|
|
3
|
+
|
|
4
|
+
class DataTransferFileCache {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.requestIdPool = 0;
|
|
7
|
+
this.dataTransferFiles = ( new Map());
|
|
8
|
+
}
|
|
9
|
+
add(dataTransfer) {
|
|
10
|
+
const requestId = this.requestIdPool++;
|
|
11
|
+
this.dataTransferFiles.set(requestId, coalesce(Array.from(dataTransfer, ([, item]) => item.asFile())));
|
|
12
|
+
return {
|
|
13
|
+
id: requestId,
|
|
14
|
+
dispose: () => {
|
|
15
|
+
this.dataTransferFiles.delete(requestId);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
async resolveFileData(requestId, dataItemId) {
|
|
20
|
+
const files = this.dataTransferFiles.get(requestId);
|
|
21
|
+
if (!files) {
|
|
22
|
+
throw new Error('No data transfer found');
|
|
23
|
+
}
|
|
24
|
+
const file = files.find(file => file.id === dataItemId);
|
|
25
|
+
if (!file) {
|
|
26
|
+
throw new Error('No matching file found in data transfer');
|
|
27
|
+
}
|
|
28
|
+
return VSBuffer.wrap(await file.data());
|
|
29
|
+
}
|
|
30
|
+
dispose() {
|
|
31
|
+
this.dataTransferFiles.clear();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { DataTransferFileCache };
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
2
|
+
import { isMarkdownString, MarkdownString } from 'monaco-editor/esm/vs/base/common/htmlContent.js';
|
|
3
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
|
|
5
|
+
class ChatRequestModel {
|
|
6
|
+
static { this.nextId = 0; }
|
|
7
|
+
get id() {
|
|
8
|
+
return this._id;
|
|
9
|
+
}
|
|
10
|
+
get providerRequestId() {
|
|
11
|
+
return this._providerRequestId;
|
|
12
|
+
}
|
|
13
|
+
get username() {
|
|
14
|
+
return this.session.requesterUsername;
|
|
15
|
+
}
|
|
16
|
+
get avatarIconUri() {
|
|
17
|
+
return this.session.requesterAvatarIconUri;
|
|
18
|
+
}
|
|
19
|
+
constructor(session, message, _providerRequestId) {
|
|
20
|
+
this.session = session;
|
|
21
|
+
this.message = message;
|
|
22
|
+
this._providerRequestId = _providerRequestId;
|
|
23
|
+
this._id = 'request_' + ChatRequestModel.nextId++;
|
|
24
|
+
}
|
|
25
|
+
setProviderRequestId(providerRequestId) {
|
|
26
|
+
this._providerRequestId = providerRequestId;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
class Response {
|
|
30
|
+
get onDidChangeValue() {
|
|
31
|
+
return this._onDidChangeValue.event;
|
|
32
|
+
}
|
|
33
|
+
get usedContext() {
|
|
34
|
+
return this._usedContext;
|
|
35
|
+
}
|
|
36
|
+
get value() {
|
|
37
|
+
return this._responseData;
|
|
38
|
+
}
|
|
39
|
+
constructor(value) {
|
|
40
|
+
this._onDidChangeValue = ( new Emitter());
|
|
41
|
+
this._responseData = Array.isArray(value) ? value : [value];
|
|
42
|
+
this._responseParts = Array.isArray(value) ? ( value.map((v) => ('value' in v ? { string: v } : { treeData: v }))) : [{ string: value }];
|
|
43
|
+
this._responseRepr = ( this._responseParts.map((part) => {
|
|
44
|
+
if (isCompleteInteractiveProgressTreeData(part)) {
|
|
45
|
+
return '';
|
|
46
|
+
}
|
|
47
|
+
return part.string.value;
|
|
48
|
+
})).join('\n');
|
|
49
|
+
}
|
|
50
|
+
asString() {
|
|
51
|
+
return this._responseRepr;
|
|
52
|
+
}
|
|
53
|
+
updateContent(responsePart, quiet) {
|
|
54
|
+
if (typeof responsePart === 'string' || isMarkdownString(responsePart)) {
|
|
55
|
+
const responsePartLength = this._responseParts.length - 1;
|
|
56
|
+
const lastResponsePart = this._responseParts[responsePartLength];
|
|
57
|
+
if (lastResponsePart.isPlaceholder === true || isCompleteInteractiveProgressTreeData(lastResponsePart)) {
|
|
58
|
+
this._responseParts.push({ string: typeof responsePart === 'string' ? ( new MarkdownString(responsePart)) : responsePart });
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
if (isMarkdownString(responsePart)) {
|
|
62
|
+
this._responseParts[responsePartLength] = { string: ( new MarkdownString(lastResponsePart.string.value + responsePart.value, responsePart)) };
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
this._responseParts[responsePartLength] = { string: ( new MarkdownString(lastResponsePart.string.value + responsePart, lastResponsePart.string)) };
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
this._updateRepr(quiet);
|
|
69
|
+
}
|
|
70
|
+
else if ('placeholder' in responsePart) {
|
|
71
|
+
const responsePosition = this._responseParts.push({ string: ( new MarkdownString(responsePart.placeholder)), isPlaceholder: true }) - 1;
|
|
72
|
+
this._updateRepr(quiet);
|
|
73
|
+
responsePart.resolvedContent?.then((content) => {
|
|
74
|
+
if (typeof content === 'string') {
|
|
75
|
+
this._responseParts[responsePosition] = { string: ( new MarkdownString(content)), isPlaceholder: true };
|
|
76
|
+
this._updateRepr(quiet);
|
|
77
|
+
}
|
|
78
|
+
else if ('value' in content) {
|
|
79
|
+
this._responseParts[responsePosition] = { string: content, isPlaceholder: true };
|
|
80
|
+
this._updateRepr(quiet);
|
|
81
|
+
}
|
|
82
|
+
else if (content.treeData) {
|
|
83
|
+
this._responseParts[responsePosition] = { treeData: content.treeData };
|
|
84
|
+
this._updateRepr(quiet);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
else if (isCompleteInteractiveProgressTreeData(responsePart)) {
|
|
89
|
+
this._responseParts.push(responsePart);
|
|
90
|
+
this._updateRepr(quiet);
|
|
91
|
+
}
|
|
92
|
+
else if ('documents' in responsePart) {
|
|
93
|
+
this._usedContext = responsePart;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
_updateRepr(quiet) {
|
|
97
|
+
this._responseData = ( this._responseParts.map(part => {
|
|
98
|
+
if (isCompleteInteractiveProgressTreeData(part)) {
|
|
99
|
+
return part.treeData;
|
|
100
|
+
}
|
|
101
|
+
else if (part.isPlaceholder) {
|
|
102
|
+
return { ...part.string, isPlaceholder: true };
|
|
103
|
+
}
|
|
104
|
+
return part.string;
|
|
105
|
+
}));
|
|
106
|
+
this._responseRepr = ( this._responseParts.map(part => {
|
|
107
|
+
if (isCompleteInteractiveProgressTreeData(part)) {
|
|
108
|
+
return '';
|
|
109
|
+
}
|
|
110
|
+
return part.string.value;
|
|
111
|
+
})).join('\n\n');
|
|
112
|
+
if (!quiet) {
|
|
113
|
+
this._onDidChangeValue.fire();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
class ChatResponseModel extends Disposable {
|
|
118
|
+
static { this.nextId = 0; }
|
|
119
|
+
get id() {
|
|
120
|
+
return this._id;
|
|
121
|
+
}
|
|
122
|
+
get providerResponseId() {
|
|
123
|
+
return this._providerResponseId;
|
|
124
|
+
}
|
|
125
|
+
get isComplete() {
|
|
126
|
+
return this._isComplete;
|
|
127
|
+
}
|
|
128
|
+
get isCanceled() {
|
|
129
|
+
return this._isCanceled;
|
|
130
|
+
}
|
|
131
|
+
get vote() {
|
|
132
|
+
return this._vote;
|
|
133
|
+
}
|
|
134
|
+
get followups() {
|
|
135
|
+
return this._followups;
|
|
136
|
+
}
|
|
137
|
+
get response() {
|
|
138
|
+
return this._response;
|
|
139
|
+
}
|
|
140
|
+
get errorDetails() {
|
|
141
|
+
return this._errorDetails;
|
|
142
|
+
}
|
|
143
|
+
get providerId() {
|
|
144
|
+
return this.session.providerId;
|
|
145
|
+
}
|
|
146
|
+
get username() {
|
|
147
|
+
return this.agent?.metadata.fullName ?? this.session.responderUsername;
|
|
148
|
+
}
|
|
149
|
+
get avatarIconUri() {
|
|
150
|
+
return this.agent?.metadata.icon ?? this.session.responderAvatarIconUri;
|
|
151
|
+
}
|
|
152
|
+
constructor(_response, session, agent, _isComplete = false, _isCanceled = false, _vote, _providerResponseId, _errorDetails, _followups) {
|
|
153
|
+
super();
|
|
154
|
+
this.session = session;
|
|
155
|
+
this.agent = agent;
|
|
156
|
+
this._isComplete = _isComplete;
|
|
157
|
+
this._isCanceled = _isCanceled;
|
|
158
|
+
this._vote = _vote;
|
|
159
|
+
this._providerResponseId = _providerResponseId;
|
|
160
|
+
this._errorDetails = _errorDetails;
|
|
161
|
+
this._followups = _followups;
|
|
162
|
+
this._onDidChange = this._register(( new Emitter()));
|
|
163
|
+
this.onDidChange = this._onDidChange.event;
|
|
164
|
+
this._response = ( new Response(_response));
|
|
165
|
+
this._register(this._response.onDidChangeValue(() => this._onDidChange.fire()));
|
|
166
|
+
this._id = 'response_' + ChatResponseModel.nextId++;
|
|
167
|
+
}
|
|
168
|
+
updateContent(responsePart, quiet) {
|
|
169
|
+
this._response.updateContent(responsePart, quiet);
|
|
170
|
+
}
|
|
171
|
+
setProviderResponseId(providerResponseId) {
|
|
172
|
+
this._providerResponseId = providerResponseId;
|
|
173
|
+
}
|
|
174
|
+
setErrorDetails(errorDetails) {
|
|
175
|
+
this._errorDetails = errorDetails;
|
|
176
|
+
this._onDidChange.fire();
|
|
177
|
+
}
|
|
178
|
+
complete() {
|
|
179
|
+
this._isComplete = true;
|
|
180
|
+
this._onDidChange.fire();
|
|
181
|
+
}
|
|
182
|
+
cancel() {
|
|
183
|
+
this._isComplete = true;
|
|
184
|
+
this._isCanceled = true;
|
|
185
|
+
this._onDidChange.fire();
|
|
186
|
+
}
|
|
187
|
+
setFollowups(followups) {
|
|
188
|
+
this._followups = followups;
|
|
189
|
+
this._onDidChange.fire();
|
|
190
|
+
}
|
|
191
|
+
setVote(vote) {
|
|
192
|
+
this._vote = vote;
|
|
193
|
+
this._onDidChange.fire();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
class ChatWelcomeMessageModel {
|
|
197
|
+
static { this.nextId = 0; }
|
|
198
|
+
get id() {
|
|
199
|
+
return this._id;
|
|
200
|
+
}
|
|
201
|
+
constructor(session, content) {
|
|
202
|
+
this.session = session;
|
|
203
|
+
this.content = content;
|
|
204
|
+
this._id = 'welcome_' + ChatWelcomeMessageModel.nextId++;
|
|
205
|
+
}
|
|
206
|
+
get username() {
|
|
207
|
+
return this.session.responderUsername;
|
|
208
|
+
}
|
|
209
|
+
get avatarIconUri() {
|
|
210
|
+
return this.session.responderAvatarIconUri;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
function isCompleteInteractiveProgressTreeData(item) {
|
|
214
|
+
return typeof item === 'object' && !!item && 'treeData' in item;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export { ChatRequestModel, ChatResponseModel, ChatWelcomeMessageModel, Response, isCompleteInteractiveProgressTreeData };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as languages from 'monaco-editor/esm/vs/editor/common/languages.js';
|
|
2
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import { registerColor, disabledForeground, contrastBorder, listFocusOutline, transparent } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
4
|
+
|
|
5
|
+
const resolvedCommentViewIcon = registerColor('commentsView.resolvedIcon', { dark: disabledForeground, light: disabledForeground, hcDark: contrastBorder, hcLight: contrastBorder }, ( nls.localizeWithPath(
|
|
6
|
+
'vs/workbench/contrib/comments/browser/commentColors',
|
|
7
|
+
'resolvedCommentIcon',
|
|
8
|
+
'Icon color for resolved comments.'
|
|
9
|
+
)));
|
|
10
|
+
const unresolvedCommentViewIcon = registerColor('commentsView.unresolvedIcon', { dark: listFocusOutline, light: listFocusOutline, hcDark: contrastBorder, hcLight: contrastBorder }, ( nls.localizeWithPath(
|
|
11
|
+
'vs/workbench/contrib/comments/browser/commentColors',
|
|
12
|
+
'unresolvedCommentIcon',
|
|
13
|
+
'Icon color for unresolved comments.'
|
|
14
|
+
)));
|
|
15
|
+
const resolvedCommentBorder = registerColor('editorCommentsWidget.resolvedBorder', { dark: resolvedCommentViewIcon, light: resolvedCommentViewIcon, hcDark: contrastBorder, hcLight: contrastBorder }, ( nls.localizeWithPath(
|
|
16
|
+
'vs/workbench/contrib/comments/browser/commentColors',
|
|
17
|
+
'resolvedCommentBorder',
|
|
18
|
+
'Color of borders and arrow for resolved comments.'
|
|
19
|
+
)));
|
|
20
|
+
const unresolvedCommentBorder = registerColor('editorCommentsWidget.unresolvedBorder', { dark: unresolvedCommentViewIcon, light: unresolvedCommentViewIcon, hcDark: contrastBorder, hcLight: contrastBorder }, ( nls.localizeWithPath(
|
|
21
|
+
'vs/workbench/contrib/comments/browser/commentColors',
|
|
22
|
+
'unresolvedCommentBorder',
|
|
23
|
+
'Color of borders and arrow for unresolved comments.'
|
|
24
|
+
)));
|
|
25
|
+
registerColor('editorCommentsWidget.rangeBackground', { dark: ( transparent(unresolvedCommentBorder, .1)), light: ( transparent(unresolvedCommentBorder, .1)), hcDark: ( transparent(unresolvedCommentBorder, .1)), hcLight: ( transparent(unresolvedCommentBorder, .1)) }, ( nls.localizeWithPath(
|
|
26
|
+
'vs/workbench/contrib/comments/browser/commentColors',
|
|
27
|
+
'commentThreadRangeBackground',
|
|
28
|
+
'Color of background for comment ranges.'
|
|
29
|
+
)));
|
|
30
|
+
registerColor('editorCommentsWidget.rangeActiveBackground', { dark: ( transparent(unresolvedCommentBorder, .1)), light: ( transparent(unresolvedCommentBorder, .1)), hcDark: ( transparent(unresolvedCommentBorder, .1)), hcLight: ( transparent(unresolvedCommentBorder, .1)) }, ( nls.localizeWithPath(
|
|
31
|
+
'vs/workbench/contrib/comments/browser/commentColors',
|
|
32
|
+
'commentThreadActiveRangeBackground',
|
|
33
|
+
'Color of background for currently selected or hovered comment range.'
|
|
34
|
+
)));
|
|
35
|
+
const commentThreadStateBorderColors = ( new Map([
|
|
36
|
+
[languages.CommentThreadState.Unresolved, unresolvedCommentBorder],
|
|
37
|
+
[languages.CommentThreadState.Resolved, resolvedCommentBorder],
|
|
38
|
+
]));
|
|
39
|
+
const commentThreadStateIconColors = ( new Map([
|
|
40
|
+
[languages.CommentThreadState.Unresolved, unresolvedCommentViewIcon],
|
|
41
|
+
[languages.CommentThreadState.Resolved, resolvedCommentViewIcon],
|
|
42
|
+
]));
|
|
43
|
+
const commentThreadStateColorVar = '--comment-thread-state-color';
|
|
44
|
+
const commentViewThreadStateColorVar = '--comment-view-thread-state-color';
|
|
45
|
+
const commentThreadStateBackgroundColorVar = '--comment-thread-state-background-color';
|
|
46
|
+
function getCommentThreadStateColor(state, theme, map) {
|
|
47
|
+
const colorId = (state !== undefined) ? map.get(state) : undefined;
|
|
48
|
+
return (colorId !== undefined) ? theme.getColor(colorId) : undefined;
|
|
49
|
+
}
|
|
50
|
+
function getCommentThreadStateBorderColor(state, theme) {
|
|
51
|
+
return getCommentThreadStateColor(state, theme, commentThreadStateBorderColors);
|
|
52
|
+
}
|
|
53
|
+
function getCommentThreadStateIconColor(state, theme) {
|
|
54
|
+
return getCommentThreadStateColor(state, theme, commentThreadStateIconColors);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { commentThreadStateBackgroundColorVar, commentThreadStateColorVar, commentViewThreadStateColorVar, getCommentThreadStateBorderColor, getCommentThreadStateIconColor };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Button } from 'monaco-editor/esm/vs/base/browser/ui/button/button.js';
|
|
2
|
+
import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { defaultButtonStyles } from 'monaco-editor/esm/vs/platform/theme/browser/defaultStyles.js';
|
|
4
|
+
|
|
5
|
+
class CommentFormActions {
|
|
6
|
+
constructor(container, actionHandler, maxActions) {
|
|
7
|
+
this.container = container;
|
|
8
|
+
this.actionHandler = actionHandler;
|
|
9
|
+
this.maxActions = maxActions;
|
|
10
|
+
this._buttonElements = [];
|
|
11
|
+
this._toDispose = ( new DisposableStore());
|
|
12
|
+
this._actions = [];
|
|
13
|
+
}
|
|
14
|
+
setActions(menu, hasOnlySecondaryActions = false) {
|
|
15
|
+
this._toDispose.clear();
|
|
16
|
+
this._buttonElements.forEach(b => b.remove());
|
|
17
|
+
this._buttonElements = [];
|
|
18
|
+
const groups = menu.getActions({ shouldForwardArgs: true });
|
|
19
|
+
let isPrimary = !hasOnlySecondaryActions;
|
|
20
|
+
for (const group of groups) {
|
|
21
|
+
const [, actions] = group;
|
|
22
|
+
this._actions = actions;
|
|
23
|
+
for (const action of actions) {
|
|
24
|
+
const button = ( new Button(this.container, { secondary: !isPrimary, ...defaultButtonStyles }));
|
|
25
|
+
isPrimary = false;
|
|
26
|
+
this._buttonElements.push(button.element);
|
|
27
|
+
this._toDispose.add(button);
|
|
28
|
+
this._toDispose.add(button.onDidClick(() => this.actionHandler(action)));
|
|
29
|
+
button.enabled = action.enabled;
|
|
30
|
+
button.label = action.label;
|
|
31
|
+
if ((this.maxActions !== undefined) && (this._buttonElements.length >= this.maxActions)) {
|
|
32
|
+
console.warn(`An extension has contributed more than the allowable number of actions to a comments menu.`);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
triggerDefaultAction() {
|
|
39
|
+
if (this._actions.length) {
|
|
40
|
+
const lastAction = this._actions[0];
|
|
41
|
+
if (lastAction.enabled) {
|
|
42
|
+
return this.actionHandler(lastAction);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
dispose() {
|
|
47
|
+
this._toDispose.dispose();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { CommentFormActions };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
2
|
+
import { Color } from 'monaco-editor/esm/vs/base/common/color.js';
|
|
3
|
+
import { OverviewRulerLane } from 'monaco-editor/esm/vs/editor/common/model.js';
|
|
4
|
+
import { ModelDecorationOptions } from 'monaco-editor/esm/vs/editor/common/model/textModel.js';
|
|
5
|
+
import { registerColor, opaque, listInactiveSelectionBackground, editorBackground, darken, editorForeground } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
6
|
+
import { themeColorFromId } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
7
|
+
import { CommentThreadState } from 'monaco-editor/esm/vs/editor/common/languages.js';
|
|
8
|
+
|
|
9
|
+
const overviewRulerCommentingRangeForeground = registerColor('editorGutter.commentRangeForeground', { dark: opaque(listInactiveSelectionBackground, editorBackground), light: ( darken(opaque(listInactiveSelectionBackground, editorBackground), .05)), hcDark: Color.white, hcLight: Color.black }, ( nls.localizeWithPath(
|
|
10
|
+
'vs/workbench/contrib/comments/browser/commentGlyphWidget',
|
|
11
|
+
'editorGutterCommentRangeForeground',
|
|
12
|
+
'Editor gutter decoration color for commenting ranges. This color should be opaque.'
|
|
13
|
+
)));
|
|
14
|
+
const overviewRulerCommentForeground = registerColor('editorOverviewRuler.commentForeground', { dark: overviewRulerCommentingRangeForeground, light: overviewRulerCommentingRangeForeground, hcDark: overviewRulerCommentingRangeForeground, hcLight: overviewRulerCommentingRangeForeground }, ( nls.localizeWithPath(
|
|
15
|
+
'vs/workbench/contrib/comments/browser/commentGlyphWidget',
|
|
16
|
+
'editorOverviewRuler.commentForeground',
|
|
17
|
+
'Editor overview ruler decoration color for resolved comments. This color should be opaque.'
|
|
18
|
+
)));
|
|
19
|
+
const overviewRulerCommentUnresolvedForeground = registerColor('editorOverviewRuler.commentUnresolvedForeground', { dark: overviewRulerCommentForeground, light: overviewRulerCommentForeground, hcDark: overviewRulerCommentForeground, hcLight: overviewRulerCommentForeground }, ( nls.localizeWithPath(
|
|
20
|
+
'vs/workbench/contrib/comments/browser/commentGlyphWidget',
|
|
21
|
+
'editorOverviewRuler.commentUnresolvedForeground',
|
|
22
|
+
'Editor overview ruler decoration color for unresolved comments. This color should be opaque.'
|
|
23
|
+
)));
|
|
24
|
+
const editorGutterCommentGlyphForeground = registerColor('editorGutter.commentGlyphForeground', { dark: editorForeground, light: editorForeground, hcDark: Color.black, hcLight: Color.white }, ( nls.localizeWithPath(
|
|
25
|
+
'vs/workbench/contrib/comments/browser/commentGlyphWidget',
|
|
26
|
+
'editorGutterCommentGlyphForeground',
|
|
27
|
+
'Editor gutter decoration color for commenting glyphs.'
|
|
28
|
+
)));
|
|
29
|
+
registerColor('editorGutter.commentUnresolvedGlyphForeground', { dark: editorGutterCommentGlyphForeground, light: editorGutterCommentGlyphForeground, hcDark: editorGutterCommentGlyphForeground, hcLight: editorGutterCommentGlyphForeground }, ( nls.localizeWithPath(
|
|
30
|
+
'vs/workbench/contrib/comments/browser/commentGlyphWidget',
|
|
31
|
+
'editorGutterCommentUnresolvedGlyphForeground',
|
|
32
|
+
'Editor gutter decoration color for commenting glyphs for unresolved comment threads.'
|
|
33
|
+
)));
|
|
34
|
+
class CommentGlyphWidget {
|
|
35
|
+
static { this.description = 'comment-glyph-widget'; }
|
|
36
|
+
constructor(editor, lineNumber) {
|
|
37
|
+
this._commentsOptions = this.createDecorationOptions();
|
|
38
|
+
this._editor = editor;
|
|
39
|
+
this._commentsDecorations = this._editor.createDecorationsCollection();
|
|
40
|
+
this.setLineNumber(lineNumber);
|
|
41
|
+
}
|
|
42
|
+
createDecorationOptions() {
|
|
43
|
+
const unresolved = this._threadState === CommentThreadState.Unresolved;
|
|
44
|
+
const decorationOptions = {
|
|
45
|
+
description: CommentGlyphWidget.description,
|
|
46
|
+
isWholeLine: true,
|
|
47
|
+
overviewRuler: {
|
|
48
|
+
color: themeColorFromId(unresolved ? overviewRulerCommentUnresolvedForeground : overviewRulerCommentForeground),
|
|
49
|
+
position: OverviewRulerLane.Center
|
|
50
|
+
},
|
|
51
|
+
collapseOnReplaceEdit: true,
|
|
52
|
+
linesDecorationsClassName: `comment-range-glyph comment-thread${unresolved ? '-unresolved' : ''}`
|
|
53
|
+
};
|
|
54
|
+
return ModelDecorationOptions.createDynamic(decorationOptions);
|
|
55
|
+
}
|
|
56
|
+
setThreadState(state) {
|
|
57
|
+
if (this._threadState !== state) {
|
|
58
|
+
this._threadState = state;
|
|
59
|
+
this._commentsOptions = this.createDecorationOptions();
|
|
60
|
+
this._updateDecorations();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
_updateDecorations() {
|
|
64
|
+
const commentsDecorations = [{
|
|
65
|
+
range: {
|
|
66
|
+
startLineNumber: this._lineNumber, startColumn: 1,
|
|
67
|
+
endLineNumber: this._lineNumber, endColumn: 1
|
|
68
|
+
},
|
|
69
|
+
options: this._commentsOptions
|
|
70
|
+
}];
|
|
71
|
+
this._commentsDecorations.set(commentsDecorations);
|
|
72
|
+
}
|
|
73
|
+
setLineNumber(lineNumber) {
|
|
74
|
+
this._lineNumber = lineNumber;
|
|
75
|
+
this._updateDecorations();
|
|
76
|
+
}
|
|
77
|
+
getPosition() {
|
|
78
|
+
const range = (this._commentsDecorations.length > 0 ? this._commentsDecorations.getRange(0) : null);
|
|
79
|
+
return {
|
|
80
|
+
position: {
|
|
81
|
+
lineNumber: range ? range.endLineNumber : this._lineNumber,
|
|
82
|
+
column: 1
|
|
83
|
+
},
|
|
84
|
+
preference: [0 ]
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
dispose() {
|
|
88
|
+
this._commentsDecorations.clear();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { CommentGlyphWidget, overviewRulerCommentingRangeForeground };
|