mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
Enable passing TSServer plugins to TSServer on web
For #140455 This does not actually enable this feature but a first step for it. Requires work on the TS side to actually get working
This commit is contained in:
@@ -237,23 +237,21 @@ export class TypeScriptServerSpawner {
|
||||
}
|
||||
}
|
||||
|
||||
if (!isWeb()) {
|
||||
const pluginPaths = this._pluginPathsProvider.getPluginPaths();
|
||||
const pluginPaths = isWeb() ? [] : this._pluginPathsProvider.getPluginPaths();
|
||||
|
||||
if (pluginManager.plugins.length) {
|
||||
args.push('--globalPlugins', pluginManager.plugins.map(x => x.name).join(','));
|
||||
if (pluginManager.plugins.length) {
|
||||
args.push('--globalPlugins', pluginManager.plugins.map(x => x.name).join(','));
|
||||
|
||||
const isUsingBundledTypeScriptVersion = currentVersion.path === this._versionProvider.defaultVersion.path;
|
||||
for (const plugin of pluginManager.plugins) {
|
||||
if (isUsingBundledTypeScriptVersion || plugin.enableForWorkspaceTypeScriptVersions) {
|
||||
pluginPaths.push(plugin.path);
|
||||
}
|
||||
const isUsingBundledTypeScriptVersion = currentVersion.path === this._versionProvider.defaultVersion.path;
|
||||
for (const plugin of pluginManager.plugins) {
|
||||
if (isUsingBundledTypeScriptVersion || plugin.enableForWorkspaceTypeScriptVersions) {
|
||||
pluginPaths.push(isWeb() ? plugin.uri.toString() : plugin.uri.path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pluginPaths.length !== 0) {
|
||||
args.push('--pluginProbeLocations', pluginPaths.join(','));
|
||||
}
|
||||
if (pluginPaths.length !== 0) {
|
||||
args.push('--pluginProbeLocations', pluginPaths.join(','));
|
||||
}
|
||||
|
||||
if (configuration.npmLocation && !isWeb()) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as arrays from './arrays';
|
||||
import { Disposable } from './dispose';
|
||||
|
||||
export interface TypeScriptServerPlugin {
|
||||
readonly path: string;
|
||||
readonly uri: vscode.Uri;
|
||||
readonly name: string;
|
||||
readonly enableForWorkspaceTypeScriptVersions: boolean;
|
||||
readonly languages: ReadonlyArray<string>;
|
||||
@@ -17,7 +17,7 @@ export interface TypeScriptServerPlugin {
|
||||
|
||||
namespace TypeScriptServerPlugin {
|
||||
export function equals(a: TypeScriptServerPlugin, b: TypeScriptServerPlugin): boolean {
|
||||
return a.path === b.path
|
||||
return a.uri.toString() === b.uri.toString()
|
||||
&& a.name === b.name
|
||||
&& a.enableForWorkspaceTypeScriptVersions === b.enableForWorkspaceTypeScriptVersions
|
||||
&& arrays.equals(a.languages, b.languages);
|
||||
@@ -76,7 +76,7 @@ export class PluginManager extends Disposable {
|
||||
plugins.push({
|
||||
name: plugin.name,
|
||||
enableForWorkspaceTypeScriptVersions: !!plugin.enableForWorkspaceTypeScriptVersions,
|
||||
path: extension.extensionPath,
|
||||
uri: extension.extensionUri,
|
||||
languages: Array.isArray(plugin.languages) ? plugin.languages : [],
|
||||
configNamespace: plugin.configNamespace,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user