mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-01 17:23:35 -05:00
Merge vscode 1.67 (#20883)
* Fix initial build breaks from 1.67 merge (#2514) * Update yarn lock files * Update build scripts * Fix tsconfig * Build breaks * WIP * Update yarn lock files * Misc breaks * Updates to package.json * Breaks * Update yarn * Fix breaks * Breaks * Build breaks * Breaks * Breaks * Breaks * Breaks * Breaks * Missing file * Breaks * Breaks * Breaks * Breaks * Breaks * Fix several runtime breaks (#2515) * Missing files * Runtime breaks * Fix proxy ordering issue * Remove commented code * Fix breaks with opening query editor * Fix post merge break * Updates related to setup build and other breaks (#2516) * Fix bundle build issues * Update distro * Fix distro merge and update build JS files * Disable pipeline steps * Remove stats call * Update license name * Make new RPM dependencies a warning * Fix extension manager version checks * Update JS file * Fix a few runtime breaks * Fixes * Fix runtime issues * Fix build breaks * Update notebook tests (part 1) * Fix broken tests * Linting errors * Fix hygiene * Disable lint rules * Bump distro * Turn off smoke tests * Disable integration tests * Remove failing "activate" test * Remove failed test assertion * Disable other broken test * Disable query history tests * Disable extension unit tests * Disable failing tasks
This commit is contained in:
@@ -10,10 +10,11 @@ import Severity from 'vs/base/common/severity';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { TextEditorCursorStyle } from 'vs/editor/common/config/editorOptions';
|
||||
import { OverviewRulerLane } from 'vs/editor/common/model';
|
||||
import * as languageConfiguration from 'vs/editor/common/modes/languageConfiguration';
|
||||
import { score } from 'vs/editor/common/modes/languageSelector';
|
||||
import * as languageConfiguration from 'vs/editor/common/languages/languageConfiguration';
|
||||
import { score } from 'vs/editor/common/languageSelector';
|
||||
import * as files from 'vs/platform/files/common/files';
|
||||
import { ExtHostContext, MainContext, ExtHostLogServiceShape, UIKind, CandidatePortSource } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { ExtHostContext, MainContext, CandidatePortSource, ExtHostLogLevelServiceShape } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { UIKind } from 'vs/workbench/services/extensions/common/extensionHostProtocol';
|
||||
import { ExtHostApiCommands } from 'vs/workbench/api/common/extHostApiCommands';
|
||||
import { ExtHostClipboard } from 'vs/workbench/api/common/extHostClipboard';
|
||||
import { IExtHostCommands } from 'vs/workbench/api/common/extHostCommands';
|
||||
@@ -46,7 +47,6 @@ import { ExtHostUrls } from 'vs/workbench/api/common/extHostUrls';
|
||||
import { ExtHostWebviews } from 'vs/workbench/api/common/extHostWebview';
|
||||
import { IExtHostWindow } from 'vs/workbench/api/common/extHostWindow';
|
||||
import { IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace';
|
||||
import { throwProposedApiError, checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { ProxyIdentifier } from 'vs/workbench/services/extensions/common/proxyIdentifier';
|
||||
import { ExtensionDescriptionRegistry } from 'vs/workbench/services/extensions/common/extensionDescriptionRegistry';
|
||||
import type * as vscode from 'vscode';
|
||||
@@ -60,7 +60,7 @@ import { IExtHostDecorations } from 'vs/workbench/api/common/extHostDecorations'
|
||||
import { IExtHostTask } from 'vs/workbench/api/common/extHostTask';
|
||||
// import { IExtHostDebugService } from 'vs/workbench/api/common/extHostDebugService'; {{SQL CARBON EDIT}}
|
||||
import { IExtHostSearch } from 'vs/workbench/api/common/extHostSearch';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { ILoggerService, ILogService } from 'vs/platform/log/common/log';
|
||||
import { IURITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService';
|
||||
import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService';
|
||||
import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService';
|
||||
@@ -70,7 +70,6 @@ import { IExtHostTunnelService } from 'vs/workbench/api/common/extHostTunnelServ
|
||||
import { IExtHostApiDeprecationService } from 'vs/workbench/api/common/extHostApiDeprecationService';
|
||||
import { ExtHostAuthentication } from 'vs/workbench/api/common/extHostAuthentication';
|
||||
import { ExtHostTimeline } from 'vs/workbench/api/common/extHostTimeline';
|
||||
// import { ExtHostNotebookConcatDocument } from 'vs/workbench/api/common/extHostNotebookConcatDocument'; {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
import { IExtensionStoragePaths } from 'vs/workbench/api/common/extHostStoragePaths';
|
||||
import { IExtHostConsumerFileSystem } from 'vs/workbench/api/common/extHostFileSystemConsumer';
|
||||
import { ExtHostWebviewViews } from 'vs/workbench/api/common/extHostWebviewView';
|
||||
@@ -83,7 +82,7 @@ import { ExtHostUriOpeners } from 'vs/workbench/api/common/extHostUriOpener';
|
||||
import { IExtHostSecretState } from 'vs/workbench/api/common/exHostSecretState';
|
||||
import { IExtHostEditorTabs } from 'vs/workbench/api/common/extHostEditorTabs';
|
||||
import { IExtHostTelemetry } from 'vs/workbench/api/common/extHostTelemetry';
|
||||
// import { ExtHostNotebookKernels } from 'vs/workbench/api/common/extHostNotebookKernels'; {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
import { ExtHostNotebookKernels } from 'vs/workbench/api/common/extHostNotebookKernels'; // {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
import { TextSearchCompleteMessageType } from 'vs/workbench/services/search/common/searchExtTypes';
|
||||
// import { ExtHostNotebookRenderers } from 'vs/workbench/api/common/extHostNotebookRenderers'; {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
@@ -91,16 +90,26 @@ import { matchesScheme } from 'vs/platform/opener/common/opener';
|
||||
// import { ExtHostNotebookEditors } from 'vs/workbench/api/common/extHostNotebookEditors'; {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
// import { ExtHostNotebookDocuments } from 'vs/workbench/api/common/extHostNotebookDocuments'; {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
// import { ExtHostInteractive } from 'vs/workbench/api/common/extHostInteractive'; {{SQL CARBON EDIT}} Remove until we need it
|
||||
import { ExtHostNotebook } from 'sql/workbench/api/common/extHostNotebook';
|
||||
import { combinedDisposable } from 'vs/base/common/lifecycle';
|
||||
import { checkProposedApiEnabled, ExtensionIdentifierSet, isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { DebugConfigurationProviderTriggerKind } from 'vs/workbench/contrib/debug/common/debug';
|
||||
import { ExtHostNotebookProxyKernels } from 'vs/workbench/api/common/extHostNotebookProxyKernels';
|
||||
|
||||
import { ExtHostNotebook } from 'sql/workbench/api/common/extHostNotebook'; // {{SQL CARBON EDIT}}
|
||||
import { docCreationFailedError, functionalityNotSupportedError, invalidArgumentsError } from 'sql/base/common/locConstants';
|
||||
import { ExtHostNotebookDocumentsAndEditors } from 'sql/workbench/api/common/extHostNotebookDocumentsAndEditors';
|
||||
import { VSCodeNotebookDocument } from 'sql/workbench/api/common/notebooks/vscodeNotebookDocument';
|
||||
import { VSCodeNotebookEditor } from 'sql/workbench/api/common/notebooks/vscodeNotebookEditor';
|
||||
import { IdGenerator } from 'vs/base/common/idGenerator';
|
||||
import { VSCodeNotebookDocument } from 'sql/workbench/api/common/notebooks/vscodeNotebookDocument';
|
||||
import { convertToADSNotebookContents } from 'sql/workbench/api/common/notebooks/notebookUtils';
|
||||
import { IdGenerator } from 'vs/base/common/idGenerator';
|
||||
|
||||
export interface IExtensionRegistries {
|
||||
mine: ExtensionDescriptionRegistry;
|
||||
all: ExtensionDescriptionRegistry;
|
||||
}
|
||||
|
||||
export interface IExtensionApiFactory {
|
||||
(extension: IExtensionDescription, registry: ExtensionDescriptionRegistry, configProvider: ExtHostConfigProvider): typeof vscode;
|
||||
(extension: IExtensionDescription, extensionInfo: IExtensionRegistries, configProvider: ExtHostConfigProvider): typeof vscode;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,6 +129,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
const rpcProtocol = accessor.get(IExtHostRpcService);
|
||||
const extHostStorage = accessor.get(IExtHostStorage);
|
||||
const extensionStoragePaths = accessor.get(IExtensionStoragePaths);
|
||||
const extHostLoggerService = accessor.get(ILoggerService);
|
||||
const extHostLogService = accessor.get(ILogService);
|
||||
const extHostTunnelService = accessor.get(IExtHostTunnelService);
|
||||
const extHostApiDeprecation = accessor.get(IExtHostApiDeprecationService);
|
||||
@@ -129,7 +139,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
|
||||
// register addressable instances
|
||||
rpcProtocol.set(ExtHostContext.ExtHostFileSystemInfo, extHostFileSystemInfo);
|
||||
rpcProtocol.set(ExtHostContext.ExtHostLogService, <ExtHostLogServiceShape><any>extHostLogService);
|
||||
rpcProtocol.set(ExtHostContext.ExtHostLogLevelServiceShape, <ExtHostLogLevelServiceShape><any>extHostLoggerService);
|
||||
rpcProtocol.set(ExtHostContext.ExtHostWorkspace, extHostWorkspace);
|
||||
rpcProtocol.set(ExtHostContext.ExtHostConfiguration, extHostConfiguration);
|
||||
rpcProtocol.set(ExtHostContext.ExtHostExtensionService, extensionService);
|
||||
@@ -157,14 +167,19 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
const extHostDocumentSaveParticipant = rpcProtocol.set(ExtHostContext.ExtHostDocumentSaveParticipant, new ExtHostDocumentSaveParticipant(extHostLogService, extHostDocuments, rpcProtocol.getProxy(MainContext.MainThreadBulkEdits)));
|
||||
/* {{SQL CARBON EDIT }} Disable VS Code notebooks
|
||||
const extHostNotebook = rpcProtocol.set(ExtHostContext.ExtHostNotebook, new ExtHostNotebookController(rpcProtocol, extHostCommands, extHostDocumentsAndEditors, extHostDocuments, extensionStoragePaths));
|
||||
const extHostNotebookDocuments = rpcProtocol.set(ExtHostContext.ExtHostNotebookDocuments, new ExtHostNotebookDocuments(extHostLogService, extHostNotebook));
|
||||
const extHostNotebookDocuments = rpcProtocol.set(ExtHostContext.ExtHostNotebookDocuments, new ExtHostNotebookDocuments(extHostNotebook));
|
||||
const extHostNotebookEditors = rpcProtocol.set(ExtHostContext.ExtHostNotebookEditors, new ExtHostNotebookEditors(extHostLogService, rpcProtocol, extHostNotebook));
|
||||
const extHostNotebookKernels = rpcProtocol.set(ExtHostContext.ExtHostNotebookKernels, new ExtHostNotebookKernels(rpcProtocol, initData, extHostNotebook, extHostCommands, extHostLogService));
|
||||
const extHostNotebookProxyKernels = rpcProtocol.set(ExtHostContext.ExtHostNotebookProxyKernels, new ExtHostNotebookProxyKernels(rpcProtocol, extHostNotebookKernels, extHostLogService));
|
||||
const extHostNotebookRenderers = rpcProtocol.set(ExtHostContext.ExtHostNotebookRenderers, new ExtHostNotebookRenderers(rpcProtocol, extHostNotebook));
|
||||
*/
|
||||
// {{SQL CARBON TODO}} - need to use a ADS specific proxy
|
||||
const extHostNotebookKernels = rpcProtocol.set(ExtHostContext.ExtHostNotebookKernels, new ExtHostNotebookKernels(rpcProtocol, initData, <any>extHostNotebook, extHostCommands, extHostLogService));
|
||||
const extHostNotebookProxyKernels = rpcProtocol.set(ExtHostContext.ExtHostNotebookProxyKernels, new ExtHostNotebookProxyKernels(rpcProtocol, extHostNotebookKernels, extHostLogService));
|
||||
|
||||
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));
|
||||
const extHostEditorInsets = rpcProtocol.set(ExtHostContext.ExtHostEditorInsets, new ExtHostEditorInsets(rpcProtocol.getProxy(MainContext.MainThreadEditorInsets), extHostEditors, initData.remote));
|
||||
const extHostDiagnostics = rpcProtocol.set(ExtHostContext.ExtHostDiagnostics, new ExtHostDiagnostics(rpcProtocol, extHostLogService, extHostFileSystemInfo));
|
||||
const extHostLanguages = rpcProtocol.set(ExtHostContext.ExtHostLanguages, new ExtHostLanguages(rpcProtocol, extHostDocuments, extHostCommands.converter, uriTransformer));
|
||||
const extHostLanguageFeatures = rpcProtocol.set(ExtHostContext.ExtHostLanguageFeatures, new ExtHostLanguageFeatures(rpcProtocol, uriTransformer, extHostDocuments, extHostCommands, extHostDiagnostics, extHostLogService, extHostApiDeprecation));
|
||||
@@ -178,7 +193,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
const extHostTheming = rpcProtocol.set(ExtHostContext.ExtHostTheming, new ExtHostTheming(rpcProtocol));
|
||||
const extHostAuthentication = rpcProtocol.set(ExtHostContext.ExtHostAuthentication, new ExtHostAuthentication(rpcProtocol));
|
||||
const extHostTimeline = rpcProtocol.set(ExtHostContext.ExtHostTimeline, new ExtHostTimeline(rpcProtocol, extHostCommands));
|
||||
const extHostWebviews = rpcProtocol.set(ExtHostContext.ExtHostWebviews, new ExtHostWebviews(rpcProtocol, { remote: initData.remote }, extHostWorkspace, extHostLogService, extHostApiDeprecation));
|
||||
const extHostWebviews = rpcProtocol.set(ExtHostContext.ExtHostWebviews, new ExtHostWebviews(rpcProtocol, initData.remote, extHostWorkspace, extHostLogService, extHostApiDeprecation));
|
||||
const extHostWebviewPanels = rpcProtocol.set(ExtHostContext.ExtHostWebviewPanels, new ExtHostWebviewPanels(rpcProtocol, extHostWebviews, extHostWorkspace));
|
||||
const extHostCustomEditors = rpcProtocol.set(ExtHostContext.ExtHostCustomEditors, new ExtHostCustomEditors(rpcProtocol, extHostDocuments, extensionStoragePaths, extHostWebviews, extHostWebviewPanels));
|
||||
const extHostWebviewViews = rpcProtocol.set(ExtHostContext.ExtHostWebviewViews, new ExtHostWebviewViews(rpcProtocol, extHostWebviews));
|
||||
@@ -214,7 +229,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
// {{SQL CARBON EDIT}} Used for creating stubbed out DecorationTypes for compatibility purposes
|
||||
const DecorationTypeKeys = new IdGenerator('VSCodeNotebookEditorDecorationType');
|
||||
|
||||
return function (extension: IExtensionDescription, extensionRegistry: ExtensionDescriptionRegistry, configProvider: ExtHostConfigProvider): typeof vscode {
|
||||
return function (extension: IExtensionDescription, extensionInfo: IExtensionRegistries, configProvider: ExtHostConfigProvider): typeof vscode {
|
||||
|
||||
// Check document selectors for being overly generic. Technically this isn't a problem but
|
||||
// in practice many extensions say they support `fooLang` but need fs-access to do so. Those
|
||||
@@ -222,8 +237,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
// We only inform once, it is not a warning because we just want to raise awareness and because
|
||||
// we cannot say if the extension is doing it right or wrong...
|
||||
const checkSelector = (function () {
|
||||
let done = (!extension.isUnderDevelopment);
|
||||
function informOnce(selector: vscode.DocumentSelector) {
|
||||
let done = !extension.isUnderDevelopment;
|
||||
function informOnce() {
|
||||
if (!done) {
|
||||
extHostLogService.info(`Extension '${extension.identifier.value}' uses a document selector without scheme. Learn more about this: https://go.microsoft.com/fwlink/?linkid=872305`);
|
||||
done = true;
|
||||
@@ -233,14 +248,14 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
if (Array.isArray(selector)) {
|
||||
selector.forEach(perform);
|
||||
} else if (typeof selector === 'string') {
|
||||
informOnce(selector);
|
||||
informOnce();
|
||||
} else {
|
||||
const filter = selector as vscode.DocumentFilter; // TODO: microsoft/TypeScript#42768
|
||||
if (typeof filter.scheme === 'undefined') {
|
||||
informOnce(selector);
|
||||
informOnce();
|
||||
}
|
||||
if (!extension.enableProposedApi && typeof filter.exclusive === 'boolean') {
|
||||
throwProposedApiError(extension);
|
||||
if (typeof filter.exclusive === 'boolean') {
|
||||
checkProposedApiEnabled(extension, 'documentFiltersExclusive');
|
||||
}
|
||||
}
|
||||
return selector;
|
||||
@@ -249,14 +264,11 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
|
||||
const authentication: typeof vscode.authentication = {
|
||||
getSession(providerId: string, scopes: readonly string[], options?: vscode.AuthenticationGetSessionOptions) {
|
||||
if (options?.forceNewSession || options?.silent) {
|
||||
checkProposedApiEnabled(extension);
|
||||
}
|
||||
return extHostAuthentication.getSession(extension, providerId, scopes, options as any);
|
||||
},
|
||||
// TODO: remove this after GHPR and Codespaces move off of it
|
||||
async hasSession(providerId: string, scopes: readonly string[]) {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'authSession');
|
||||
return !!(await extHostAuthentication.getSession(extension, providerId, scopes, { silent: true } as any));
|
||||
},
|
||||
get onDidChangeSessions(): Event<vscode.AuthenticationSessionsChangeEvent> {
|
||||
@@ -293,7 +305,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
}, undefined, undefined, extension);
|
||||
},
|
||||
registerDiffInformationCommand: (id: string, callback: (diff: vscode.LineChange[], ...args: any[]) => any, thisArg?: any): vscode.Disposable => {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'diffCommand');
|
||||
return extHostCommands.registerCommand(true, id, async (...args: any[]): Promise<any> => {
|
||||
const activeTextEditor = extHostDocumentsAndEditors.activeEditor(true);
|
||||
if (!activeTextEditor) {
|
||||
@@ -327,16 +339,24 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
return extHostTerminalService.getDefaultShell(false);
|
||||
},
|
||||
get isTelemetryEnabled() {
|
||||
return extHostTelemetry.getTelemetryEnabled();
|
||||
return extHostTelemetry.getTelemetryConfiguration();
|
||||
},
|
||||
get onDidChangeTelemetryEnabled(): Event<boolean> {
|
||||
return extHostTelemetry.onDidChangeTelemetryEnabled;
|
||||
},
|
||||
get telemetryConfiguration(): vscode.TelemetryConfiguration {
|
||||
checkProposedApiEnabled(extension, 'telemetry');
|
||||
return extHostTelemetry.getTelemetryDetails();
|
||||
},
|
||||
get onDidChangeTelemetryConfiguration(): Event<vscode.TelemetryConfiguration> {
|
||||
checkProposedApiEnabled(extension, 'telemetry');
|
||||
return extHostTelemetry.onDidChangeTelemetryConfiguration;
|
||||
},
|
||||
get isNewAppInstall() {
|
||||
const installAge = Date.now() - new Date(initData.telemetryInfo.firstSessionDate).getTime();
|
||||
return isNaN(installAge) ? false : installAge < 1000 * 60 * 60 * 24; // install age is less than a day
|
||||
},
|
||||
openExternal(uri: URI, options?: { allowContributedOpeners?: boolean | string; }) {
|
||||
openExternal(uri: URI, options?: { allowContributedOpeners?: boolean | string }) {
|
||||
return extHostWindow.openUri(uri, {
|
||||
allowTunneling: !!initData.remote.authority,
|
||||
allowContributedOpeners: options?.allowContributedOpeners,
|
||||
@@ -361,7 +381,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
return getRemoteName(initData.remote.authority);
|
||||
},
|
||||
get remoteAuthority() {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'resolvers');
|
||||
return initData.remote.authority;
|
||||
},
|
||||
get uiKind() {
|
||||
@@ -373,46 +393,73 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
Object.freeze(env);
|
||||
}
|
||||
|
||||
const extensionKind = initData.remote.isRemote
|
||||
? extHostTypes.ExtensionKind.Workspace
|
||||
: extHostTypes.ExtensionKind.UI;
|
||||
|
||||
// namespace: tests
|
||||
const tests: typeof vscode.tests = {
|
||||
createTestController(provider, label) {
|
||||
return extHostTesting.createTestController(provider, label);
|
||||
createTestController(provider, label, refreshHandler?: (token: vscode.CancellationToken) => Thenable<void> | void) {
|
||||
return extHostTesting.createTestController(provider, label, refreshHandler);
|
||||
},
|
||||
createTestObserver() {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'testObserver');
|
||||
return extHostTesting.createTestObserver();
|
||||
},
|
||||
runTests(provider) {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'testObserver');
|
||||
return extHostTesting.runTests(provider);
|
||||
},
|
||||
get onDidChangeTestResults() {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'testObserver');
|
||||
return extHostTesting.onResultsChanged;
|
||||
},
|
||||
get testResults() {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'testObserver');
|
||||
return extHostTesting.results;
|
||||
},
|
||||
};
|
||||
|
||||
// namespace: extensions
|
||||
const extensionKind = initData.remote.isRemote
|
||||
? extHostTypes.ExtensionKind.Workspace
|
||||
: extHostTypes.ExtensionKind.UI;
|
||||
|
||||
const extensions: typeof vscode.extensions = {
|
||||
getExtension(extensionId: string): vscode.Extension<any> | undefined {
|
||||
const desc = extensionRegistry.getExtensionDescription(extensionId);
|
||||
if (desc) {
|
||||
return new Extension(extensionService, extension.identifier, desc, extensionKind);
|
||||
getExtension(extensionId: string, includeFromDifferentExtensionHosts?: boolean): vscode.Extension<any> | undefined {
|
||||
if (!isProposedApiEnabled(extension, 'extensionsAny')) {
|
||||
includeFromDifferentExtensionHosts = false;
|
||||
}
|
||||
const mine = extensionInfo.mine.getExtensionDescription(extensionId);
|
||||
if (mine) {
|
||||
return new Extension(extensionService, extension.identifier, mine, extensionKind, false);
|
||||
}
|
||||
if (includeFromDifferentExtensionHosts) {
|
||||
const foreign = extensionInfo.all.getExtensionDescription(extensionId);
|
||||
if (foreign) {
|
||||
return new Extension(extensionService, extension.identifier, foreign, extensionKind /* TODO@alexdima THIS IS WRONG */, true);
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
get all(): vscode.Extension<any>[] {
|
||||
return extensionRegistry.getAllExtensionDescriptions().map((desc) => new Extension(extensionService, extension.identifier, desc, extensionKind));
|
||||
const result: vscode.Extension<any>[] = [];
|
||||
for (const desc of extensionInfo.mine.getAllExtensionDescriptions()) {
|
||||
result.push(new Extension(extensionService, extension.identifier, desc, extensionKind, false));
|
||||
}
|
||||
return result;
|
||||
},
|
||||
get allAcrossExtensionHosts(): vscode.Extension<any>[] {
|
||||
checkProposedApiEnabled(extension, 'extensionsAny');
|
||||
const local = new ExtensionIdentifierSet(extensionInfo.mine.getAllExtensionDescriptions().map(desc => desc.identifier));
|
||||
const result: vscode.Extension<any>[] = [];
|
||||
for (const desc of extensionInfo.all.getAllExtensionDescriptions()) {
|
||||
const isFromDifferentExtensionHost = !local.has(desc.identifier);
|
||||
result.push(new Extension(extensionService, extension.identifier, desc, extensionKind /* TODO@alexdima THIS IS WRONG */, isFromDifferentExtensionHost));
|
||||
}
|
||||
return result;
|
||||
},
|
||||
get onDidChange() {
|
||||
return extensionRegistry.onDidChange;
|
||||
if (isProposedApiEnabled(extension, 'extensionsAny')) {
|
||||
return Event.any(extensionInfo.mine.onDidChange, extensionInfo.all.onDidChange);
|
||||
}
|
||||
return extensionInfo.mine.onDidChange;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -434,7 +481,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
return extHostLanguages.changeLanguage(document.uri, languageId);
|
||||
},
|
||||
match(selector: vscode.DocumentSelector, document: vscode.TextDocument): number {
|
||||
return score(typeConverters.LanguageSelector.from(selector), document.uri, document.languageId, true);
|
||||
return score(typeConverters.LanguageSelector.from(selector), document.uri, document.languageId, true, document.notebook?.notebookType);
|
||||
},
|
||||
registerCodeActionsProvider(selector: vscode.DocumentSelector, provider: vscode.CodeActionProvider, metadata?: vscode.CodeActionProviderMetadata): vscode.Disposable {
|
||||
return extHostLanguageFeatures.registerCodeActionProvider(extension, checkSelector(selector), provider, metadata);
|
||||
@@ -506,9 +553,16 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
return extHostLanguageFeatures.registerCompletionItemProvider(extension, checkSelector(selector), provider, triggerCharacters);
|
||||
},
|
||||
registerInlineCompletionItemProvider(selector: vscode.DocumentSelector, provider: vscode.InlineCompletionItemProvider): vscode.Disposable {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'inlineCompletions');
|
||||
return extHostLanguageFeatures.registerInlineCompletionsProvider(extension, checkSelector(selector), provider);
|
||||
},
|
||||
registerInlineCompletionItemProviderNew(selector: vscode.DocumentSelector, provider: vscode.InlineCompletionItemProviderNew): vscode.Disposable {
|
||||
checkProposedApiEnabled(extension, 'inlineCompletionsNew');
|
||||
if (provider.handleDidShowCompletionItem && !isProposedApiEnabled(extension, 'inlineCompletionsAdditions')) {
|
||||
throw new Error(`When the method "handleDidShowCompletionItem" is implemented on a provider, the usage of the proposed api 'inlineCompletionsAdditions' must be declared!`);
|
||||
}
|
||||
return extHostLanguageFeatures.registerInlineCompletionsProviderNew(extension, checkSelector(selector), provider);
|
||||
},
|
||||
registerDocumentLinkProvider(selector: vscode.DocumentSelector, provider: vscode.DocumentLinkProvider): vscode.Disposable {
|
||||
return extHostLanguageFeatures.registerDocumentLinkProvider(extension, checkSelector(selector), provider);
|
||||
},
|
||||
@@ -531,16 +585,18 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
return extHostLanguageFeatures.setLanguageConfiguration(extension, language, configuration);
|
||||
},
|
||||
getTokenInformationAtPosition(doc: vscode.TextDocument, pos: vscode.Position) {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'tokenInformation');
|
||||
return extHostLanguages.tokenAtPosition(doc, pos);
|
||||
},
|
||||
registerInlayHintsProvider(selector: vscode.DocumentSelector, provider: vscode.InlayHintsProvider): vscode.Disposable {
|
||||
checkProposedApiEnabled(extension);
|
||||
return extHostLanguageFeatures.registerInlayHintsProvider(extension, selector, provider);
|
||||
},
|
||||
createLanguageStatusItem(id: string, selector: vscode.DocumentSelector): vscode.LanguageStatusItem {
|
||||
checkProposedApiEnabled(extension);
|
||||
return extHostLanguages.createLanguageStatusItem(extension, id, selector);
|
||||
},
|
||||
registerDocumentOnDropProvider(selector: vscode.DocumentSelector, provider: vscode.DocumentOnDropProvider): vscode.Disposable {
|
||||
checkProposedApiEnabled(extension, 'textEditorDrop');
|
||||
return extHostLanguageFeatures.registerDocumentOnDropProvider(extension, selector, provider);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -596,14 +652,14 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
return extHostTerminalService.onDidChangeActiveTerminal(listener, thisArg, disposables);
|
||||
},
|
||||
onDidChangeTerminalDimensions(listener, thisArg?, disposables?) {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'terminalDimensions');
|
||||
return extHostTerminalService.onDidChangeTerminalDimensions(listener, thisArg, disposables);
|
||||
},
|
||||
onDidChangeTerminalState(listener, thisArg?, disposables?) {
|
||||
return extHostTerminalService.onDidChangeTerminalState(listener, thisArg, disposables);
|
||||
},
|
||||
onDidWriteTerminalData(listener, thisArg?, disposables?) {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'terminalDataWriteEvent');
|
||||
return extHostTerminalService.onDidWriteTerminalData(listener, thisArg, disposables);
|
||||
},
|
||||
get state() {
|
||||
@@ -622,12 +678,15 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
return <Thenable<any>>extHostMessageService.showMessage(extension, Severity.Error, message, rest[0], <Array<string | vscode.MessageItem>>rest.slice(1));
|
||||
},
|
||||
showQuickPick(items: any, options?: vscode.QuickPickOptions, token?: vscode.CancellationToken): any {
|
||||
return extHostQuickOpen.showQuickPick(items, !!extension.enableProposedApi, options, token);
|
||||
return extHostQuickOpen.showQuickPick(items, options, token);
|
||||
},
|
||||
showWorkspaceFolderPick(options?: vscode.WorkspaceFolderPickOptions) {
|
||||
return extHostQuickOpen.showWorkspaceFolderPick(options);
|
||||
},
|
||||
showInputBox(options?: vscode.InputBoxOptions, token?: vscode.CancellationToken) {
|
||||
if (options?.validateInput2) {
|
||||
checkProposedApiEnabled(extension, 'inputBoxSeverity');
|
||||
}
|
||||
return extHostQuickOpen.showInput(options, token);
|
||||
},
|
||||
showOpenDialog(options) {
|
||||
@@ -664,21 +723,18 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
withProgress<R>(options: vscode.ProgressOptions, task: (progress: vscode.Progress<{ message?: string; worked?: number }>, token: vscode.CancellationToken) => Thenable<R>) {
|
||||
return extHostProgress.withProgress(extension, options, task);
|
||||
},
|
||||
createOutputChannel(name: string): vscode.OutputChannel {
|
||||
return extHostOutputService.createOutputChannel(name, extension);
|
||||
createOutputChannel(name: string, languageId?: string): vscode.OutputChannel {
|
||||
return extHostOutputService.createOutputChannel(name, languageId, extension);
|
||||
},
|
||||
createWebviewPanel(viewType: string, title: string, showOptions: vscode.ViewColumn | { viewColumn: vscode.ViewColumn, preserveFocus?: boolean }, options?: vscode.WebviewPanelOptions & vscode.WebviewOptions): vscode.WebviewPanel {
|
||||
createWebviewPanel(viewType: string, title: string, showOptions: vscode.ViewColumn | { viewColumn: vscode.ViewColumn; preserveFocus?: boolean }, options?: vscode.WebviewPanelOptions & vscode.WebviewOptions): vscode.WebviewPanel {
|
||||
return extHostWebviewPanels.createWebviewPanel(extension, viewType, title, showOptions, options);
|
||||
},
|
||||
createWebviewTextEditorInset(editor: vscode.TextEditor, line: number, height: number, options?: vscode.WebviewOptions): vscode.WebviewEditorInset {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'editorInsets');
|
||||
return extHostEditorInsets.createWebviewEditorInset(editor, line, height, options, extension);
|
||||
},
|
||||
createTerminal(nameOrOptions?: vscode.TerminalOptions | vscode.ExtensionTerminalOptions | string, shellPath?: string, shellArgs?: string[] | string): vscode.Terminal {
|
||||
createTerminal(nameOrOptions?: vscode.TerminalOptions | vscode.ExtensionTerminalOptions | string, shellPath?: string, shellArgs?: readonly string[] | string): vscode.Terminal {
|
||||
if (typeof nameOrOptions === 'object') {
|
||||
if ('location' in nameOrOptions) {
|
||||
checkProposedApiEnabled(extension);
|
||||
}
|
||||
if ('pty' in nameOrOptions) {
|
||||
return extHostTerminalService.createExtensionTerminal(nameOrOptions);
|
||||
}
|
||||
@@ -701,7 +757,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
registerWebviewPanelSerializer: (viewType: string, serializer: vscode.WebviewPanelSerializer) => {
|
||||
return extHostWebviewPanels.registerWebviewPanelSerializer(extension, viewType, serializer);
|
||||
},
|
||||
registerCustomEditorProvider: (viewType: string, provider: vscode.CustomTextEditorProvider | vscode.CustomReadonlyEditorProvider, options: { webviewOptions?: vscode.WebviewPanelOptions, supportsMultipleEditorsPerDocument?: boolean } = {}) => {
|
||||
registerCustomEditorProvider: (viewType: string, provider: vscode.CustomTextEditorProvider | vscode.CustomReadonlyEditorProvider, options: { webviewOptions?: vscode.WebviewPanelOptions; supportsMultipleEditorsPerDocument?: boolean } = {}) => {
|
||||
return extHostCustomEditors.registerCustomEditorProvider(extension, viewType, provider, options);
|
||||
},
|
||||
registerFileDecorationProvider(provider: vscode.FileDecorationProvider) {
|
||||
@@ -711,10 +767,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
return extHostUrls.registerUriHandler(extension.identifier, handler);
|
||||
},
|
||||
createQuickPick<T extends vscode.QuickPickItem>(): vscode.QuickPick<T> {
|
||||
return extHostQuickOpen.createQuickPick(extension.identifier, !!extension.enableProposedApi);
|
||||
return extHostQuickOpen.createQuickPick(extension);
|
||||
},
|
||||
createInputBox(): vscode.InputBox {
|
||||
return extHostQuickOpen.createInputBox(extension.identifier);
|
||||
return extHostQuickOpen.createInputBox(extension);
|
||||
},
|
||||
get activeColorTheme(): vscode.ColorTheme {
|
||||
return extHostTheming.activeColorTheme;
|
||||
@@ -724,8 +780,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
},
|
||||
registerWebviewViewProvider(viewId: string, provider: vscode.WebviewViewProvider, options?: {
|
||||
webviewOptions?: {
|
||||
retainContextWhenHidden?: boolean
|
||||
}
|
||||
retainContextWhenHidden?: boolean;
|
||||
};
|
||||
}) {
|
||||
return extHostWebviewViews.registerWebviewViewProvider(extension, viewId, provider, options?.webviewOptions);
|
||||
},
|
||||
@@ -768,29 +824,16 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
}).then(editor => new VSCodeNotebookEditor(editor));
|
||||
},
|
||||
registerExternalUriOpener(id: string, opener: vscode.ExternalUriOpener, metadata: vscode.ExternalUriOpenerMetadata) {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'externalUriOpener');
|
||||
return extHostUriOpeners.registerExternalUriOpener(extension.identifier, id, opener, metadata);
|
||||
},
|
||||
get tabs() {
|
||||
checkProposedApiEnabled(extension);
|
||||
return extHostEditorTabs.tabs;
|
||||
},
|
||||
get activeTab() {
|
||||
checkProposedApiEnabled(extension);
|
||||
return extHostEditorTabs.activeTab;
|
||||
},
|
||||
get onDidChangeTabs() {
|
||||
checkProposedApiEnabled(extension);
|
||||
return extHostEditorTabs.onDidChangeTabs;
|
||||
},
|
||||
get onDidChangeActiveTab() {
|
||||
checkProposedApiEnabled(extension);
|
||||
return extHostEditorTabs.onDidChangeActiveTab;
|
||||
get tabGroups(): vscode.TabGroups {
|
||||
return extHostEditorTabs.tabGroups;
|
||||
},
|
||||
getInlineCompletionItemController<T extends vscode.InlineCompletionItem>(provider: vscode.InlineCompletionItemProvider<T>): vscode.InlineCompletionController<T> {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'inlineCompletions');
|
||||
return InlineCompletionController.get(provider);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
// namespace: workspace
|
||||
@@ -834,9 +877,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
},
|
||||
findFiles: (include, exclude, maxResults?, token?) => {
|
||||
// Note, undefined/null have different meanings on "exclude"
|
||||
return extHostWorkspace.findFiles(typeConverters.GlobPattern.from(include), typeConverters.GlobPattern.from(exclude), maxResults, extension.identifier, token);
|
||||
return extHostWorkspace.findFiles(include, exclude, maxResults, extension.identifier, token);
|
||||
},
|
||||
findTextInFiles: (query: vscode.TextSearchQuery, optionsOrCallback: vscode.FindTextInFilesOptions | ((result: vscode.TextSearchResult) => void), callbackOrToken?: vscode.CancellationToken | ((result: vscode.TextSearchResult) => void), token?: vscode.CancellationToken) => {
|
||||
checkProposedApiEnabled(extension, 'findTextInFiles');
|
||||
let options: vscode.FindTextInFilesOptions;
|
||||
let callback: (result: vscode.TextSearchResult) => void;
|
||||
|
||||
@@ -858,7 +902,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
return extHostBulkEdits.applyWorkspaceEdit(edit);
|
||||
},
|
||||
createFileSystemWatcher: (pattern, ignoreCreate, ignoreChange, ignoreDelete): vscode.FileSystemWatcher => {
|
||||
return extHostFileSystemEvent.createFileSystemWatcher(typeConverters.GlobPattern.from(pattern), ignoreCreate, ignoreChange, ignoreDelete);
|
||||
return extHostFileSystemEvent.createFileSystemWatcher(extHostWorkspace, extension, pattern, ignoreCreate, ignoreChange, ignoreDelete);
|
||||
},
|
||||
get textDocuments() {
|
||||
return extHostDocuments.getAllDocumentData().map(data => data.document);
|
||||
@@ -866,10 +910,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
set textDocuments(value) {
|
||||
throw errors.readonly();
|
||||
},
|
||||
openTextDocument(uriOrFileNameOrOptions?: vscode.Uri | string | { language?: string; content?: string; }) {
|
||||
openTextDocument(uriOrFileNameOrOptions?: vscode.Uri | string | { language?: string; content?: string }) {
|
||||
let uriPromise: Thenable<URI>;
|
||||
|
||||
const options = uriOrFileNameOrOptions as { language?: string; content?: string; };
|
||||
const options = uriOrFileNameOrOptions as { language?: string; content?: string };
|
||||
if (typeof uriOrFileNameOrOptions === 'string') {
|
||||
uriPromise = Promise.resolve(URI.file(uriOrFileNameOrOptions));
|
||||
} else if (URI.isUri(uriOrFileNameOrOptions)) {
|
||||
@@ -922,6 +966,16 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
}
|
||||
return new VSCodeNotebookDocument(doc);
|
||||
},
|
||||
onDidSaveNotebookDocument(listener, thisArg, disposables) {
|
||||
// {{SQL CARBON TODO}} - disable event
|
||||
return undefined
|
||||
//return extHostNotebookDocuments.onDidSaveNotebookDocument(listener, thisArg, disposables);
|
||||
},
|
||||
onDidChangeNotebookDocument(listener, thisArg, disposables) {
|
||||
// {{SQL CARBON TODO}} - disable event
|
||||
return undefined;
|
||||
//return extHostNotebookDocuments.onDidChangeNotebookDocument(listener, thisArg, disposables);
|
||||
},
|
||||
get onDidOpenNotebookDocument(): Event<vscode.NotebookDocument> {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.onDidOpenVSCodeNotebookDocument;
|
||||
@@ -932,7 +986,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
},
|
||||
registerNotebookSerializer(viewType: string, serializer: vscode.NotebookSerializer, options?: vscode.NotebookDocumentContentOptions, registration?: vscode.NotebookRegistrationData) {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebook.registerNotebookSerializer(viewType, serializer, options, extension.enableProposedApi ? registration : undefined);
|
||||
return extHostNotebook.registerNotebookSerializer(viewType, serializer, options, extension.enabledApiProposals ? registration : undefined);
|
||||
},
|
||||
registerNotebookContentProvider: (viewType: string, provider: vscode.NotebookContentProvider, options?: vscode.NotebookDocumentContentOptions, registration?: vscode.NotebookRegistrationData) => {
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
@@ -957,25 +1011,28 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
return extHostTask.registerTaskProvider(extension, type, provider);
|
||||
},
|
||||
registerFileSystemProvider(scheme, provider, options) {
|
||||
return extHostFileSystem.registerFileSystemProvider(extension.identifier, scheme, provider, options);
|
||||
return combinedDisposable(
|
||||
extHostFileSystem.registerFileSystemProvider(extension, scheme, provider, options),
|
||||
extHostConsumerFileSystem.addFileSystemProvider(scheme, provider)
|
||||
);
|
||||
},
|
||||
get fs() {
|
||||
return extHostConsumerFileSystem.value;
|
||||
},
|
||||
registerFileSearchProvider: (scheme: string, provider: vscode.FileSearchProvider) => {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'fileSearchProvider');
|
||||
return extHostSearch.registerFileSearchProvider(scheme, provider);
|
||||
},
|
||||
registerTextSearchProvider: (scheme: string, provider: vscode.TextSearchProvider) => {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'textSearchProvider');
|
||||
return extHostSearch.registerTextSearchProvider(scheme, provider);
|
||||
},
|
||||
registerRemoteAuthorityResolver: (authorityPrefix: string, resolver: vscode.RemoteAuthorityResolver) => {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'resolvers');
|
||||
return extensionService.registerRemoteAuthorityResolver(authorityPrefix, resolver);
|
||||
},
|
||||
registerResourceLabelFormatter: (formatter: vscode.ResourceLabelFormatter) => {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'resolvers');
|
||||
return extHostLabelService.$registerResourceLabelFormatter(formatter);
|
||||
},
|
||||
onDidCreateFiles: (listener, thisArg, disposables) => {
|
||||
@@ -997,7 +1054,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
return extHostFileSystemEvent.getOnWillRenameFileEvent(extension)(listener, thisArg, disposables);
|
||||
},
|
||||
openTunnel: (forward: vscode.TunnelOptions) => {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'resolvers');
|
||||
return extHostTunnelService.openTunnel(extension, forward).then(value => {
|
||||
if (!value) {
|
||||
throw new Error('cannot open tunnel');
|
||||
@@ -1006,26 +1063,26 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
});
|
||||
},
|
||||
get tunnels() {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'resolvers');
|
||||
return extHostTunnelService.getTunnels();
|
||||
},
|
||||
onDidChangeTunnels: (listener, thisArg?, disposables?) => {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'resolvers');
|
||||
return extHostTunnelService.onDidChangeTunnels(listener, thisArg, disposables);
|
||||
},
|
||||
registerPortAttributesProvider: (portSelector: { pid?: number, portRange?: [number, number], commandMatcher?: RegExp }, provider: vscode.PortAttributesProvider) => {
|
||||
checkProposedApiEnabled(extension);
|
||||
registerPortAttributesProvider: (portSelector: { pid?: number; portRange?: [number, number]; commandMatcher?: RegExp }, provider: vscode.PortAttributesProvider) => {
|
||||
checkProposedApiEnabled(extension, 'portsAttributes');
|
||||
return extHostTunnelService.registerPortsAttributesProvider(portSelector, provider);
|
||||
},
|
||||
registerTimelineProvider: (scheme: string | string[], provider: vscode.TimelineProvider) => {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'timeline');
|
||||
return extHostTimeline.registerTimelineProvider(scheme, provider, extension.identifier, extHostCommands.converter);
|
||||
},
|
||||
get isTrusted() {
|
||||
return extHostWorkspace.trusted;
|
||||
},
|
||||
requestWorkspaceTrust: (options?: vscode.WorkspaceTrustRequestOptions) => {
|
||||
checkProposedApiEnabled(extension);
|
||||
checkProposedApiEnabled(extension, 'workspaceTrust');
|
||||
return extHostWorkspace.requestWorkspaceTrust(options);
|
||||
},
|
||||
onDidGrantWorkspaceTrust: (listener, thisArgs?, disposables?) => {
|
||||
@@ -1098,7 +1155,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
registerDebugConfigurationProvider(debugType: string, provider: vscode.DebugConfigurationProvider, triggerKind?: vscode.DebugConfigurationProviderTriggerKind) {
|
||||
extHostLogService.warn('Debug API is disabled in Azure Data Studio');
|
||||
return undefined!;
|
||||
// return extHostDebugService.registerDebugConfigurationProvider(debugType, provider, triggerKind || extHostTypes.DebugConfigurationProviderTriggerKind.Initial); {{SQL CARBON EDIT}} Removed
|
||||
//return extHostDebugService.registerDebugConfigurationProvider(debugType, provider, triggerKind || extHostTypes.DebugConfigurationProviderTriggerKind.Initial);
|
||||
},
|
||||
registerDebugAdapterDescriptorFactory(debugType: string, factory: vscode.DebugAdapterDescriptorFactory) {
|
||||
extHostLogService.warn('Debug API is disabled in Azure Data Studio');
|
||||
@@ -1174,17 +1231,13 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
createNotebookController(id: string, notebookType: string, label: string, handler?, rendererScripts?: vscode.NotebookRendererScript[]) {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
let getDocHandler = (notebookUri: URI) => extHostNotebookDocumentsAndEditors.getDocument(notebookUri.toString())?.document;
|
||||
return extHostNotebook.createNotebookController(extension, id, notebookType, label, getDocHandler, handler, extension.enableProposedApi ? rendererScripts : undefined);
|
||||
return extHostNotebook.createNotebookController(extension, id, notebookType, label, getDocHandler, handler, extension.enabledApiProposals ? rendererScripts : undefined);
|
||||
},
|
||||
registerNotebookCellStatusBarItemProvider: (notebookType: string, provider: vscode.NotebookCellStatusBarItemProvider) => {
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(functionalityNotSupportedError);
|
||||
// return extHostNotebook.registerNotebookCellStatusBarItemProvider(extension, notebookType, provider);
|
||||
},
|
||||
get onDidSaveNotebookDocument(): Event<vscode.NotebookDocument> {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.onDidSaveVSCodeNotebookDocument;
|
||||
},
|
||||
createNotebookEditorDecorationType(options: vscode.NotebookDecorationRenderOptions): vscode.NotebookEditorDecorationType {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
// Returning this stub class for now, since we don't support renderer contributions yet
|
||||
@@ -1203,32 +1256,15 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
};
|
||||
return rendererMessaging;
|
||||
},
|
||||
onDidChangeNotebookDocumentMetadata(listener, thisArgs?, disposables?) {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.onDidChangeVSCodeDocumentMetadata(listener, thisArgs, disposables);
|
||||
},
|
||||
onDidChangeNotebookCells(listener, thisArgs?, disposables?) {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.onDidChangeVSCodeNotebookCells(listener, thisArgs, disposables);
|
||||
},
|
||||
onDidChangeNotebookCellExecutionState(listener, thisArgs?, disposables?) {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.onDidChangeVSCodeExecutionState(listener, thisArgs, disposables);
|
||||
},
|
||||
onDidChangeCellOutputs(listener, thisArgs?, disposables?) {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.onDidChangeVSCodeCellOutputs(listener, thisArgs, disposables);
|
||||
},
|
||||
onDidChangeCellMetadata(listener, thisArgs?, disposables?) {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.onDidChangeVSCodeCellMetadata(listener, thisArgs, disposables);
|
||||
},
|
||||
createConcatTextDocument(notebook, selector) {
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(functionalityNotSupportedError);
|
||||
// checkProposedApiEnabled(extension);
|
||||
// return new ExtHostNotebookConcatDocument(extHostNotebook, extHostDocuments, notebook, selector);
|
||||
},
|
||||
createNotebookProxyController(id: string, notebookType: string, label: string, handler: () => vscode.NotebookController | string | Thenable<vscode.NotebookController | string>) {
|
||||
//checkProposedApiEnabled(extension, 'notebookProxyController');
|
||||
return extHostNotebookProxyKernels.createNotebookProxyController(extension, id, notebookType, label, handler);
|
||||
// {{SQL CARBON TODO}}
|
||||
}
|
||||
};
|
||||
|
||||
return <typeof vscode>{
|
||||
@@ -1266,6 +1302,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
ColorThemeKind: extHostTypes.ColorThemeKind,
|
||||
CommentMode: extHostTypes.CommentMode,
|
||||
CommentThreadCollapsibleState: extHostTypes.CommentThreadCollapsibleState,
|
||||
CommentThreadState: extHostTypes.CommentThreadState,
|
||||
CompletionItem: extHostTypes.CompletionItem,
|
||||
CompletionItemKind: extHostTypes.CompletionItemKind,
|
||||
CompletionItemTag: extHostTypes.CompletionItemTag,
|
||||
@@ -1277,7 +1314,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
DebugAdapterInlineImplementation: extHostTypes.DebugAdapterInlineImplementation,
|
||||
DebugAdapterNamedPipeServer: extHostTypes.DebugAdapterNamedPipeServer,
|
||||
DebugAdapterServer: extHostTypes.DebugAdapterServer,
|
||||
DebugConfigurationProviderTriggerKind: extHostTypes.DebugConfigurationProviderTriggerKind,
|
||||
DebugConfigurationProviderTriggerKind: DebugConfigurationProviderTriggerKind,
|
||||
DebugConsoleMode: extHostTypes.DebugConsoleMode,
|
||||
DecorationRangeBehavior: extHostTypes.DecorationRangeBehavior,
|
||||
Diagnostic: extHostTypes.Diagnostic,
|
||||
@@ -1296,6 +1333,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
InlineValueVariableLookup: extHostTypes.InlineValueVariableLookup,
|
||||
InlineValueEvaluatableExpression: extHostTypes.InlineValueEvaluatableExpression,
|
||||
InlineCompletionTriggerKind: extHostTypes.InlineCompletionTriggerKind,
|
||||
InlineCompletionTriggerKindNew: extHostTypes.InlineCompletionTriggerKindNew,
|
||||
EventEmitter: Emitter,
|
||||
ExtensionKind: extHostTypes.ExtensionKind,
|
||||
ExtensionMode: extHostTypes.ExtensionMode,
|
||||
@@ -1309,7 +1347,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
FoldingRangeKind: extHostTypes.FoldingRangeKind,
|
||||
FunctionBreakpoint: extHostTypes.FunctionBreakpoint,
|
||||
InlineCompletionItem: extHostTypes.InlineSuggestion,
|
||||
InlineCompletionItemNew: extHostTypes.InlineSuggestionNew,
|
||||
InlineCompletionList: extHostTypes.InlineSuggestions,
|
||||
InlineCompletionListNew: extHostTypes.InlineSuggestionsNew,
|
||||
Hover: extHostTypes.Hover,
|
||||
IndentAction: languageConfiguration.IndentAction,
|
||||
Location: extHostTypes.Location,
|
||||
@@ -1336,6 +1376,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
SignatureHelpTriggerKind: extHostTypes.SignatureHelpTriggerKind,
|
||||
SignatureInformation: extHostTypes.SignatureInformation,
|
||||
SnippetString: extHostTypes.SnippetString,
|
||||
SnippetTextEdit: extHostTypes.SnippetTextEdit,
|
||||
SourceBreakpoint: extHostTypes.SourceBreakpoint,
|
||||
StandardTokenType: extHostTypes.StandardTokenType,
|
||||
StatusBarAlignment: extHostTypes.StatusBarAlignment,
|
||||
@@ -1368,6 +1409,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
WorkspaceEdit: extHostTypes.WorkspaceEdit,
|
||||
// proposed api types
|
||||
InlayHint: extHostTypes.InlayHint,
|
||||
InlayHintLabelPart: extHostTypes.InlayHintLabelPart,
|
||||
InlayHintKind: extHostTypes.InlayHintKind,
|
||||
RemoteAuthorityResolverError: extHostTypes.RemoteAuthorityResolverError,
|
||||
ResolvedAuthority: extHostTypes.ResolvedAuthority,
|
||||
@@ -1394,6 +1436,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
TestTag: extHostTypes.TestTag,
|
||||
TestRunProfileKind: extHostTypes.TestRunProfileKind,
|
||||
TextSearchCompleteMessageType: TextSearchCompleteMessageType,
|
||||
DataTransfer: extHostTypes.DataTransfer,
|
||||
DataTransferItem: extHostTypes.DataTransferItem,
|
||||
CoveredCount: extHostTypes.CoveredCount,
|
||||
FileCoverage: extHostTypes.FileCoverage,
|
||||
StatementCoverage: extHostTypes.StatementCoverage,
|
||||
@@ -1401,6 +1445,15 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
FunctionCoverage: extHostTypes.FunctionCoverage,
|
||||
WorkspaceTrustState: extHostTypes.WorkspaceTrustState,
|
||||
LanguageStatusSeverity: extHostTypes.LanguageStatusSeverity,
|
||||
QuickPickItemKind: extHostTypes.QuickPickItemKind,
|
||||
InputBoxValidationSeverity: extHostTypes.InputBoxValidationSeverity,
|
||||
TabInputText: extHostTypes.TextTabInput,
|
||||
TabInputTextDiff: extHostTypes.TextDiffTabInput,
|
||||
TabInputCustom: extHostTypes.CustomEditorTabInput,
|
||||
TabInputNotebook: extHostTypes.NotebookEditorTabInput,
|
||||
TabInputNotebookDiff: extHostTypes.NotebookDiffEditorTabInput,
|
||||
TabInputWebview: extHostTypes.WebviewEditorTabInput,
|
||||
TabInputTerminal: extHostTypes.TerminalEditorTabInput
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user