Merge branch 'main' into multirange-formatting

This commit is contained in:
Johannes Rieken
2023-03-30 16:33:11 +02:00
committed by GitHub
1547 changed files with 48899 additions and 28605 deletions

View File

@@ -51,7 +51,7 @@ import { IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace';
import { ProxyIdentifier } from 'vs/workbench/services/extensions/common/proxyIdentifier';
import { ExtensionDescriptionRegistry } from 'vs/workbench/services/extensions/common/extensionDescriptionRegistry';
import type * as vscode from 'vscode';
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
import { ExtensionIdentifierSet, IExtensionDescription } from 'vs/platform/extensions/common/extensions';
import { ExtHostEditorInsets } from 'vs/workbench/api/common/extHostCodeInsets';
import { ExtHostLabelService } from 'vs/workbench/api/common/extHostLabelService';
import { getRemoteName } from 'vs/platform/remote/common/remoteHosts';
@@ -91,12 +91,15 @@ import { ExtHostNotebookEditors } from 'vs/workbench/api/common/extHostNotebookE
import { ExtHostNotebookDocuments } from 'vs/workbench/api/common/extHostNotebookDocuments';
import { ExtHostInteractive } from 'vs/workbench/api/common/extHostInteractive';
import { combinedDisposable } from 'vs/base/common/lifecycle';
import { checkProposedApiEnabled, ExtensionIdentifierSet, isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';
import { checkProposedApiEnabled, isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';
import { DebugConfigurationProviderTriggerKind } from 'vs/workbench/contrib/debug/common/debug';
import { IExtHostLocalizationService } from 'vs/workbench/api/common/extHostLocalizationService';
import { EditSessionIdentityMatch } from 'vs/platform/workspace/common/editSessions';
import { ExtHostProfileContentHandlers } from 'vs/workbench/api/common/extHostProfileContentHandler';
import { ExtHostQuickDiff } from 'vs/workbench/api/common/extHostQuickDiff';
import { ExtHostInteractiveSession } from 'vs/workbench/api/common/extHostInteractiveSession';
import { ExtHostInteractiveEditor } from 'vs/workbench/api/common/extHostInteractiveEditor';
import { ExtHostNotebookDocumentSaveParticipant } from 'vs/workbench/api/common/extHostNotebookDocumentSaveParticipant';
export interface IExtensionRegistries {
mine: ExtensionDescriptionRegistry;
@@ -166,6 +169,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
const extHostNotebookEditors = rpcProtocol.set(ExtHostContext.ExtHostNotebookEditors, new ExtHostNotebookEditors(extHostLogService, extHostNotebook));
const extHostNotebookKernels = rpcProtocol.set(ExtHostContext.ExtHostNotebookKernels, new ExtHostNotebookKernels(rpcProtocol, initData, extHostNotebook, extHostCommands, extHostLogService));
const extHostNotebookRenderers = rpcProtocol.set(ExtHostContext.ExtHostNotebookRenderers, new ExtHostNotebookRenderers(rpcProtocol, extHostNotebook));
const extHostNotebookDocumentSaveParticipant = rpcProtocol.set(ExtHostContext.ExtHostNotebookDocumentSaveParticipant, new ExtHostNotebookDocumentSaveParticipant(extHostLogService, extHostNotebook, rpcProtocol.getProxy(MainContext.MainThreadBulkEdits)));
const extHostEditors = rpcProtocol.set(ExtHostContext.ExtHostEditors, new ExtHostEditors(rpcProtocol, extHostDocumentsAndEditors));
const extHostTreeViews = rpcProtocol.set(ExtHostContext.ExtHostTreeViews, new ExtHostTreeViews(rpcProtocol.getProxy(MainContext.MainThreadTreeViews), extHostCommands, extHostLogService));
const extHostEditorInsets = rpcProtocol.set(ExtHostContext.ExtHostEditorInsets, new ExtHostEditorInsets(rpcProtocol.getProxy(MainContext.MainThreadEditorInsets), extHostEditors, initData.remote));
@@ -191,6 +195,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
const extHostUriOpeners = rpcProtocol.set(ExtHostContext.ExtHostUriOpeners, new ExtHostUriOpeners(rpcProtocol));
const extHostProfileContentHandlers = rpcProtocol.set(ExtHostContext.ExtHostProfileContentHandlers, new ExtHostProfileContentHandlers(rpcProtocol));
rpcProtocol.set(ExtHostContext.ExtHostInteractive, new ExtHostInteractive(rpcProtocol, extHostNotebook, extHostDocumentsAndEditors, extHostCommands, extHostLogService));
const extHostInteractiveEditor = rpcProtocol.set(ExtHostContext.ExtHostInteractiveEditor, new ExtHostInteractiveEditor(rpcProtocol, extHostDocuments, extHostLogService));
const extHostInteractiveSession = rpcProtocol.set(ExtHostContext.ExtHostInteractiveSession, new ExtHostInteractiveSession(rpcProtocol, extHostLogService));
// Check that no named customers are missing
const expected = Object.values<ProxyIdentifier<any>>(ExtHostContext);
@@ -243,6 +249,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
getSession(providerId: string, scopes: readonly string[], options?: vscode.AuthenticationGetSessionOptions) {
return extHostAuthentication.getSession(extension, providerId, scopes, options as any);
},
getSessions(providerId: string, scopes: readonly string[]) {
checkProposedApiEnabled(extension, 'getSessions');
return extHostAuthentication.getSessions(extension, providerId, scopes);
},
// TODO: remove this after GHPR and Codespaces move off of it
async hasSession(providerId: string, scopes: readonly string[]) {
checkProposedApiEnabled(extension, 'authSession');
@@ -336,9 +346,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
get isNewAppInstall() {
return isNewAppInstall(initData.telemetryInfo.firstSessionDate);
},
createTelemetryLogger(sender: vscode.TelemetrySender): vscode.TelemetryLogger {
createTelemetryLogger(sender: vscode.TelemetrySender, options?: vscode.TelemetryLoggerOptions): vscode.TelemetryLogger {
ExtHostTelemetryLogger.validateSender(sender);
return extHostTelemetry.instantiateLogger(extension, sender);
return extHostTelemetry.instantiateLogger(extension, sender, options);
},
openExternal(uri: URI, options?: { allowContributedOpeners?: boolean | string }) {
return extHostWindow.openUri(uri, {
@@ -946,6 +956,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
onDidChangeNotebookDocument(listener, thisArg, disposables) {
return extHostNotebookDocuments.onDidChangeNotebookDocument(listener, thisArg, disposables);
},
onWillSaveNotebookDocument(listener, thisArg, disposables) {
checkProposedApiEnabled(extension, 'notebookDocumentWillSave');
return extHostNotebookDocumentSaveParticipant.getOnWillSaveNotebookDocumentEvent(extension)(listener, thisArg, disposables);
},
get onDidOpenNotebookDocument(): Event<vscode.NotebookDocument> {
return extHostNotebook.onDidOpenNotebookDocument;
},
@@ -1208,6 +1222,33 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
}
};
// namespace: interactive
const interactive: typeof vscode.interactive = {
// IMPORTANT
// this needs to be updated whenever the API proposal changes
_version: 1,
registerInteractiveEditorSessionProvider(provider: vscode.InteractiveEditorSessionProvider) {
checkProposedApiEnabled(extension, 'interactive');
return extHostInteractiveEditor.registerProvider(extension, provider);
},
registerInteractiveSessionProvider(id: string, provider: vscode.InteractiveSessionProvider) {
checkProposedApiEnabled(extension, 'interactive');
return extHostInteractiveSession.registerInteractiveSessionProvider(extension, id, provider);
},
addInteractiveRequest(context: vscode.InteractiveSessionRequestArgs) {
checkProposedApiEnabled(extension, 'interactive');
return extHostInteractiveSession.addInteractiveSessionRequest(context);
},
sendInteractiveRequestToProvider(providerId: string, message: vscode.InteractiveSessionDynamicRequest) {
checkProposedApiEnabled(extension, 'interactive');
return extHostInteractiveSession.sendInteractiveRequestToProvider(providerId, message);
},
get onDidPerformUserAction() {
return extHostInteractiveSession.onDidPerformUserAction;
}
};
return <typeof vscode>{
version: initData.version,
// namespaces
@@ -1217,6 +1258,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
debug,
env,
extensions,
interactive,
l10n,
languages,
notebooks,
@@ -1243,6 +1285,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
ColorPresentation: extHostTypes.ColorPresentation,
ColorThemeKind: extHostTypes.ColorThemeKind,
CommentMode: extHostTypes.CommentMode,
CommentState: extHostTypes.CommentState,
CommentThreadCollapsibleState: extHostTypes.CommentThreadCollapsibleState,
CommentThreadState: extHostTypes.CommentThreadState,
CompletionItem: extHostTypes.CompletionItem,
@@ -1410,7 +1453,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
TabInputInteractiveWindow: extHostTypes.InteractiveWindowInput,
TelemetryTrustedValue: TelemetryTrustedValue,
LogLevel: LogLevel,
EditSessionIdentityMatch: EditSessionIdentityMatch
EditSessionIdentityMatch: EditSessionIdentityMatch,
InteractiveSessionVoteDirection: extHostTypes.InteractiveSessionVoteDirection,
InteractiveSessionCopyKind: extHostTypes.InteractiveSessionCopyKind,
InteractiveEditorResponseFeedbackKind: extHostTypes.InteractiveEditorResponseFeedbackKind
};
};
}