mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
Remove sending of extension URI
This commit is contained in:
@@ -95,12 +95,7 @@ export async function startClient(context: ExtensionContext, newLanguageClient:
|
||||
const languageParticipants = getLanguageParticipants();
|
||||
context.subscriptions.push(languageParticipants);
|
||||
|
||||
const extensionUri = {
|
||||
scheme: context.extensionUri.scheme,
|
||||
path: context.extensionUri.path,
|
||||
};
|
||||
|
||||
let client: Disposable | undefined = await startClientWithParticipants(languageParticipants, newLanguageClient, outputChannel, runtime, extensionUri);
|
||||
let client: Disposable | undefined = await startClientWithParticipants(languageParticipants, newLanguageClient, outputChannel, runtime);
|
||||
|
||||
const promptForLinkedEditingKey = 'html.promptForLinkedEditing';
|
||||
if (extensions.getExtension('formulahendry.auto-rename-tag') !== undefined && (context.globalState.get(promptForLinkedEditingKey) !== false)) {
|
||||
@@ -133,7 +128,7 @@ export async function startClient(context: ExtensionContext, newLanguageClient:
|
||||
const oldClient = client;
|
||||
client = undefined;
|
||||
await oldClient.dispose();
|
||||
client = await startClientWithParticipants(languageParticipants, newLanguageClient, outputChannel, runtime, extensionUri);
|
||||
client = await startClientWithParticipants(languageParticipants, newLanguageClient, outputChannel, runtime);
|
||||
}
|
||||
}, 2000);
|
||||
});
|
||||
@@ -147,7 +142,7 @@ export async function startClient(context: ExtensionContext, newLanguageClient:
|
||||
};
|
||||
}
|
||||
|
||||
async function startClientWithParticipants(languageParticipants: LanguageParticipants, newLanguageClient: LanguageClientConstructor, outputChannel: OutputChannel, runtime: Runtime, extensionUri: { scheme: string; path: string }): Promise<AsyncDisposable> {
|
||||
async function startClientWithParticipants(languageParticipants: LanguageParticipants, newLanguageClient: LanguageClientConstructor, outputChannel: OutputChannel, runtime: Runtime): Promise<AsyncDisposable> {
|
||||
|
||||
const toDispose: Disposable[] = [];
|
||||
|
||||
@@ -163,7 +158,6 @@ async function startClientWithParticipants(languageParticipants: LanguagePartici
|
||||
configurationSection: ['html', 'css', 'javascript', 'js/ts'], // the settings to synchronize
|
||||
},
|
||||
initializationOptions: {
|
||||
extensionUri: extensionUri,
|
||||
embeddedLanguages,
|
||||
handledSchemas: ['file'],
|
||||
provideFormatter: false, // tell the server to not provide formatting capability and ignore the `html.format.enable` setting.
|
||||
|
||||
@@ -153,9 +153,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
|
||||
get folders() { return workspaceFolders; }
|
||||
};
|
||||
|
||||
const extensionUri = initializationOptions?.extensionUri;
|
||||
|
||||
languageModes = getLanguageModes(initializationOptions?.embeddedLanguages || { css: true, javascript: true }, workspace, params.capabilities, fileSystemProvider, extensionUri);
|
||||
languageModes = getLanguageModes(initializationOptions?.embeddedLanguages || { css: true, javascript: true }, workspace, params.capabilities, fileSystemProvider);
|
||||
|
||||
const dataPaths: string[] = initializationOptions?.dataPaths || [];
|
||||
fetchHTMLDataProviders(dataPaths, customDataRequestService).then(dataProviders => {
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
SymbolInformation, SymbolKind, CompletionItem, Location, SignatureHelp, SignatureInformation, ParameterInformation,
|
||||
Definition, TextEdit, TextDocument, Diagnostic, DiagnosticSeverity, Range, CompletionItemKind, Hover,
|
||||
DocumentHighlight, DocumentHighlightKind, CompletionList, Position, FormattingOptions, FoldingRange, FoldingRangeKind, SelectionRange,
|
||||
LanguageMode, Settings, SemanticTokenData, Workspace, DocumentContext, CompletionItemData, isCompletionItemData, Uri, FILE_PROTOCOL
|
||||
LanguageMode, Settings, SemanticTokenData, Workspace, DocumentContext, CompletionItemData, isCompletionItemData, FILE_PROTOCOL
|
||||
} from './languageModes';
|
||||
import { getWordAtText, isWhitespaceOnly, repeat } from '../utils/strings';
|
||||
import { HTMLDocumentRegions } from './embeddedSupport';
|
||||
@@ -104,7 +104,7 @@ const ignoredErrors = [
|
||||
2792, /* Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option */
|
||||
];
|
||||
|
||||
export function getJavaScriptMode(documentRegions: LanguageModelCache<HTMLDocumentRegions>, languageId: 'javascript' | 'typescript', workspace: Workspace, extensionUri?: Uri): LanguageMode {
|
||||
export function getJavaScriptMode(documentRegions: LanguageModelCache<HTMLDocumentRegions>, languageId: 'javascript' | 'typescript', workspace: Workspace): LanguageMode {
|
||||
const jsDocuments = getLanguageModelCache<TextDocument>(10, 60, document => documentRegions.get(document).getEmbeddedDocument(languageId));
|
||||
|
||||
const host = getLanguageServiceHost(languageId === 'javascript' ? ts.ScriptKind.JS : ts.ScriptKind.TS);
|
||||
@@ -315,9 +315,6 @@ export function getJavaScriptMode(documentRegions: LanguageModelCache<HTMLDocume
|
||||
range: convertRange(jsDocument, d.textSpan)
|
||||
};
|
||||
} else {
|
||||
if (!extensionUri) {
|
||||
return undefined;
|
||||
}
|
||||
const libUri = `${FILE_PROTOCOL}://${languageId}/${d.fileName}`;
|
||||
const content = await host.loadLibrary(d.fileName);
|
||||
if (!content) {
|
||||
|
||||
@@ -109,14 +109,9 @@ export interface LanguageModeRange extends Range {
|
||||
attributeValue?: boolean;
|
||||
}
|
||||
|
||||
export interface Uri {
|
||||
scheme: string;
|
||||
path: string;
|
||||
}
|
||||
|
||||
export const FILE_PROTOCOL = 'html-server';
|
||||
|
||||
export function getLanguageModes(supportedLanguages: { [languageId: string]: boolean }, workspace: Workspace, clientCapabilities: ClientCapabilities, requestService: FileSystemProvider, extensionUri?: Uri): LanguageModes {
|
||||
export function getLanguageModes(supportedLanguages: { [languageId: string]: boolean }, workspace: Workspace, clientCapabilities: ClientCapabilities, requestService: FileSystemProvider): LanguageModes {
|
||||
const htmlLanguageService = getHTMLLanguageService({ clientCapabilities, fileSystemProvider: requestService });
|
||||
const cssLanguageService = getCSSLanguageService({ clientCapabilities, fileSystemProvider: requestService });
|
||||
|
||||
@@ -131,8 +126,8 @@ export function getLanguageModes(supportedLanguages: { [languageId: string]: boo
|
||||
modes['css'] = getCSSMode(cssLanguageService, documentRegions, workspace);
|
||||
}
|
||||
if (supportedLanguages['javascript']) {
|
||||
modes['javascript'] = getJavaScriptMode(documentRegions, 'javascript', workspace, extensionUri);
|
||||
modes['typescript'] = getJavaScriptMode(documentRegions, 'typescript', workspace, extensionUri);
|
||||
modes['javascript'] = getJavaScriptMode(documentRegions, 'javascript', workspace);
|
||||
modes['typescript'] = getJavaScriptMode(documentRegions, 'typescript', workspace);
|
||||
}
|
||||
return {
|
||||
async updateDataProviders(dataProviders: IHTMLDataProvider[]): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user