From 0fd0648d4da9e4eee8f616e207ca4980f4f0d093 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Thu, 29 Jun 2023 23:23:46 -0700 Subject: [PATCH 01/10] Prototype extension API support Adds a new experimental API to the C# extension that allows other extensions to communicate with the C# language server. This API is not yet finalized and may change in the future. Relates to https://github.com/dotnet/roslyn/issues/68696. --- src/csharpExtensionExports.ts | 7 ++++ src/lsptoolshost/roslynLanguageServer.ts | 4 ++- .../roslynLanguageServerExportChannel.ts | 33 +++++++++++++++++++ src/main.ts | 13 ++++++-- 4 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 src/lsptoolshost/roslynLanguageServerExportChannel.ts diff --git a/src/csharpExtensionExports.ts b/src/csharpExtensionExports.ts index 9a6ce0a74..c6a957c1b 100644 --- a/src/csharpExtensionExports.ts +++ b/src/csharpExtensionExports.ts @@ -3,10 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as vscode from 'vscode'; import { Advisor } from './features/diagnosticsProvider'; import { EventStream } from './eventStream'; import TestManager from './features/dotnetTest'; import { GlobalBrokeredServiceContainer } from '@microsoft/servicehub-framework'; +import { RequestType } from 'vscode-languageclient/node'; export interface OmnisharpExtensionExports { initializationFinished: () => Promise; @@ -20,4 +22,9 @@ export interface CSharpExtensionExports { initializationFinished: () => Promise; logDirectory: string; profferBrokeredServices: (container: GlobalBrokeredServiceContainer) => void; + sendRequest: ( + type: RequestType, + params: Params, + token: vscode.CancellationToken + ) => Promise; } diff --git a/src/lsptoolshost/roslynLanguageServer.ts b/src/lsptoolshost/roslynLanguageServer.ts index 35f42d2b4..a90c032ed 100644 --- a/src/lsptoolshost/roslynLanguageServer.ts +++ b/src/lsptoolshost/roslynLanguageServer.ts @@ -575,7 +575,7 @@ export async function activateRoslynLanguageServer( optionProvider: OptionProvider, outputChannel: vscode.OutputChannel, reporter: TelemetryReporter -) { +): Promise { // Create a channel for outputting general logs from the language server. _channel = outputChannel; // Create a separate channel for outputting trace logs - these are incredibly verbose and make other logs very difficult to see. @@ -624,6 +624,8 @@ export async function activateRoslynLanguageServer( // Start the language server. _languageServer.start(); + + return _languageServer; } function getServerPath(options: Options, platformInfo: PlatformInformation) { diff --git a/src/lsptoolshost/roslynLanguageServerExportChannel.ts b/src/lsptoolshost/roslynLanguageServerExportChannel.ts new file mode 100644 index 000000000..1adfe69a0 --- /dev/null +++ b/src/lsptoolshost/roslynLanguageServerExportChannel.ts @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import * as vscode from 'vscode'; +import { RequestType } from 'vscode-languageclient/node'; +import { RoslynLanguageServer } from './roslynLanguageServer'; + +export class RoslynLanguageServerExport { + private _server: RoslynLanguageServer | undefined; + + constructor(private serverPromise: Promise) {} + + private async ensureServer(): Promise { + if (this._server === undefined) { + this._server = await this.serverPromise; + } + + return this._server; + } + + public async sendRequest( + type: RequestType, + params: Params, + token: vscode.CancellationToken + ): Promise { + const server = await this.ensureServer(); + // We need to recreate the type parameter to ensure that the prototypes line up. The `RequestType` we receive could have been + // from a different version. + const newType = new RequestType(type.method); + return await server.sendRequest(newType, params, token); + } +} diff --git a/src/main.ts b/src/main.ts index 5248d50b7..fa34505ed 100644 --- a/src/main.ts +++ b/src/main.ts @@ -42,7 +42,11 @@ import { installRuntimeDependencies } from './installRuntimeDependencies'; import { isValidDownload } from './packageManager/isValidDownload'; import { BackgroundWorkStatusBarObserver } from './observers/backgroundWorkStatusBarObserver'; import { getDotnetPackApi } from './dotnetPack'; -import { SolutionSnapshotProvider, activateRoslynLanguageServer } from './lsptoolshost/roslynLanguageServer'; +import { + RoslynLanguageServer, + SolutionSnapshotProvider, + activateRoslynLanguageServer, +} from './lsptoolshost/roslynLanguageServer'; import { Options } from './shared/options'; import { MigrateOptions } from './shared/migrateOptions'; import { getBrokeredServiceContainer } from './lsptoolshost/services/brokeredServicesHosting'; @@ -51,6 +55,7 @@ import Descriptors from './lsptoolshost/services/descriptors'; import { GlobalBrokeredServiceContainer } from '@microsoft/servicehub-framework'; import { CSharpExtensionExports, OmnisharpExtensionExports } from './csharpExtensionExports'; import { csharpDevkitExtensionId, getCSharpDevKit } from './utils/getCSharpDevKit'; +import { RoslynLanguageServerExport } from './lsptoolshost/roslynLanguageServerExportChannel'; export async function activate( context: vscode.ExtensionContext @@ -114,7 +119,7 @@ export async function activate( let omnisharpLangServicePromise: Promise | undefined = undefined; let omnisharpRazorPromise: Promise | undefined = undefined; - let roslynLanguageServerPromise: Promise | undefined = undefined; + let roslynLanguageServerPromise: Promise | undefined = undefined; if (!useOmnisharpServer) { // Activate Razor. Needs to be activated before Roslyn so commands are registered in the correct order. @@ -281,6 +286,9 @@ export async function activate( if (!useOmnisharpServer) { tryGetCSharpDevKitExtensionExports(csharpLogObserver); + const languageServerExport = new RoslynLanguageServerExport( + >roslynLanguageServerPromise + ); return { initializationFinished: async () => { await coreClrDebugPromise; @@ -288,6 +296,7 @@ export async function activate( }, profferBrokeredServices: (container) => profferBrokeredServices(context, container), logDirectory: context.logUri.fsPath, + sendRequest: async (t, p, ct) => await languageServerExport.sendRequest(t, p, ct), }; } else { return { From f5750c8c2fc49a2913b301c22bc9ec9854b01731 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Sat, 1 Jul 2023 17:06:23 -0700 Subject: [PATCH 02/10] Define an export for getting the path of the LSP server being run. --- src/csharpExtensionExports.ts | 1 + src/lsptoolshost/roslynLanguageServer.ts | 19 ++++++++++++++----- .../roslynLanguageServerExportChannel.ts | 5 +++++ src/main.ts | 1 + 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/csharpExtensionExports.ts b/src/csharpExtensionExports.ts index c6a957c1b..3ae5f897a 100644 --- a/src/csharpExtensionExports.ts +++ b/src/csharpExtensionExports.ts @@ -27,4 +27,5 @@ export interface CSharpExtensionExports { params: Params, token: vscode.CancellationToken ) => Promise; + serverExecutablePath: () => Promise; } diff --git a/src/lsptoolshost/roslynLanguageServer.ts b/src/lsptoolshost/roslynLanguageServer.ts index a90c032ed..b44f52b0c 100644 --- a/src/lsptoolshost/roslynLanguageServer.ts +++ b/src/lsptoolshost/roslynLanguageServer.ts @@ -110,6 +110,11 @@ export class RoslynLanguageServer { */ private _solutionFile: vscode.Uri | undefined; + /** + * The path to the server executable that is being run, or undefined if none was. + */ + private _serverExecutablePath: string | undefined; + constructor( private platformInfo: PlatformInformation, private hostExecutableResolver: IHostExecutableResolver, @@ -360,7 +365,7 @@ export class RoslynLanguageServer { private async startServer(logLevel: string | undefined): Promise { const options = this.optionProvider.GetLatestOptions(); - const serverPath = getServerPath(options, this.platformInfo); + this._serverExecutablePath = getServerPath(options, this.platformInfo); const dotnetInfo = await this.hostExecutableResolver.getHostExecutableInfo(options); const dotnetRuntimePath = path.dirname(dotnetInfo.path); @@ -417,7 +422,7 @@ export class RoslynLanguageServer { } if (logLevel && [Trace.Messages, Trace.Verbose].includes(this.GetTraceLevel(logLevel))) { - _channel.appendLine(`Starting server at ${serverPath}`); + _channel.appendLine(`Starting server at ${this._serverExecutablePath}`); } // shouldn't this arg only be set if it's running with CSDevKit? @@ -430,13 +435,13 @@ export class RoslynLanguageServer { env: env, }; - if (serverPath.endsWith('.dll')) { + if (this._serverExecutablePath.endsWith('.dll')) { // If we were given a path to a dll, launch that via dotnet. - const argsWithPath = [serverPath].concat(args); + const argsWithPath = [this._serverExecutablePath].concat(args); childProcess = cp.spawn(dotnetExecutablePath, argsWithPath, cpOptions); } else { // Otherwise assume we were given a path to an executable. - childProcess = cp.spawn(serverPath, args, cpOptions); + childProcess = cp.spawn(this._serverExecutablePath, args, cpOptions); } return childProcess; @@ -558,6 +563,10 @@ export class RoslynLanguageServer { throw new Error(`Invalid log level ${logLevel}`); } } + + public getServerExecutablePath(): string | undefined { + return this._serverExecutablePath; + } } /** diff --git a/src/lsptoolshost/roslynLanguageServerExportChannel.ts b/src/lsptoolshost/roslynLanguageServerExportChannel.ts index 1adfe69a0..8295c06fe 100644 --- a/src/lsptoolshost/roslynLanguageServerExportChannel.ts +++ b/src/lsptoolshost/roslynLanguageServerExportChannel.ts @@ -30,4 +30,9 @@ export class RoslynLanguageServerExport { const newType = new RequestType(type.method); return await server.sendRequest(newType, params, token); } + + public async serverExecutablePath(): Promise { + const server = await this.ensureServer(); + return server.getServerExecutablePath(); + } } diff --git a/src/main.ts b/src/main.ts index fa34505ed..33ea3f1ef 100644 --- a/src/main.ts +++ b/src/main.ts @@ -297,6 +297,7 @@ export async function activate( profferBrokeredServices: (container) => profferBrokeredServices(context, container), logDirectory: context.logUri.fsPath, sendRequest: async (t, p, ct) => await languageServerExport.sendRequest(t, p, ct), + serverExecutablePath: async () => await languageServerExport.serverExecutablePath(), }; } else { return { From b8f7195f5ef55b231ec95d8b814fde997a70d73f Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Mon, 10 Jul 2023 15:36:29 -0700 Subject: [PATCH 03/10] Move the experimental APIs into an explicitly labeled `experimental` block. --- src/csharpExtensionExports.ts | 6 +++++- src/main.ts | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/csharpExtensionExports.ts b/src/csharpExtensionExports.ts index 3ae5f897a..0537a58a5 100644 --- a/src/csharpExtensionExports.ts +++ b/src/csharpExtensionExports.ts @@ -22,7 +22,11 @@ export interface CSharpExtensionExports { initializationFinished: () => Promise; logDirectory: string; profferBrokeredServices: (container: GlobalBrokeredServiceContainer) => void; - sendRequest: ( + experimental: CSharpExtensionExperimentalExports; +} + +export interface CSharpExtensionExperimentalExports { + sendServerRequest: ( type: RequestType, params: Params, token: vscode.CancellationToken diff --git a/src/main.ts b/src/main.ts index 33ea3f1ef..b803d928d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -296,8 +296,10 @@ export async function activate( }, profferBrokeredServices: (container) => profferBrokeredServices(context, container), logDirectory: context.logUri.fsPath, - sendRequest: async (t, p, ct) => await languageServerExport.sendRequest(t, p, ct), - serverExecutablePath: async () => await languageServerExport.serverExecutablePath(), + experimental: { + sendServerRequest: async (t, p, ct) => await languageServerExport.sendRequest(t, p, ct), + serverExecutablePath: async () => await languageServerExport.serverExecutablePath(), + } }; } else { return { From 5ffddb7bd088303adc62cac86703971bdc2a7645 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Mon, 10 Jul 2023 15:46:50 -0700 Subject: [PATCH 04/10] Prettier --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index b803d928d..b1a6c57b7 100644 --- a/src/main.ts +++ b/src/main.ts @@ -299,7 +299,7 @@ export async function activate( experimental: { sendServerRequest: async (t, p, ct) => await languageServerExport.sendRequest(t, p, ct), serverExecutablePath: async () => await languageServerExport.serverExecutablePath(), - } + }, }; } else { return { From b71713152224a53e999711e78a867f3fbdbc95e3 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Tue, 18 Jul 2023 16:28:00 -0700 Subject: [PATCH 05/10] Adjust settings.json for standard repo settings. --- .vscode/settings.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 0a8571292..0c125a0b2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,10 +11,14 @@ "out/": true, "vsix/": true }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, "csharp.suppressDotnetRestoreNotification": true, "typescript.tsdk": "./node_modules/typescript/lib", "mocha.enabled": true, "omnisharp.autoStart": false, "editor.formatOnSave": false, - "eslint.lintTask.enable": true -} \ No newline at end of file + "eslint.lintTask.enable": true, + "dotnet.defaultSolution": "disable" +} From b4f3a4c760de797241f419200d1dcf9ebb7e3f87 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Tue, 18 Jul 2023 16:29:30 -0700 Subject: [PATCH 06/10] Implement extension path scanning instead of exposing the location of the LSP --- src/csharpExtensionExports.ts | 1 - src/lsptoolshost/roslynLanguageServer.ts | 39 ++++++++++++++++++++++-- src/main.ts | 1 - 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/csharpExtensionExports.ts b/src/csharpExtensionExports.ts index 70dd24bfb..6613aab12 100644 --- a/src/csharpExtensionExports.ts +++ b/src/csharpExtensionExports.ts @@ -32,5 +32,4 @@ export interface CSharpExtensionExperimentalExports { params: Params, token: vscode.CancellationToken ) => Promise; - serverExecutablePath: () => Promise; } diff --git a/src/lsptoolshost/roslynLanguageServer.ts b/src/lsptoolshost/roslynLanguageServer.ts index b5e67ca40..d3b575786 100644 --- a/src/lsptoolshost/roslynLanguageServer.ts +++ b/src/lsptoolshost/roslynLanguageServer.ts @@ -120,7 +120,8 @@ export class RoslynLanguageServer { private hostExecutableResolver: IHostExecutableResolver, private optionProvider: OptionProvider, private context: vscode.ExtensionContext, - private telemetryReporter: TelemetryReporter + private telemetryReporter: TelemetryReporter, + private additionalExtensionPaths: string[] ) {} /** @@ -391,6 +392,10 @@ export class RoslynLanguageServer { args.push('--logLevel', logLevel); } + if (this.additionalExtensionPaths.length > 0) { + args.push('--additionalExtensions', `"${this.additionalExtensionPaths.join(',')}"`); + } + // Get the brokered service pipe name from C# Dev Kit (if installed). // We explicitly call this in the LSP server start action instead of awaiting it // in our activation because C# Dev Kit depends on C# activation completing. @@ -608,7 +613,15 @@ export async function activateRoslynLanguageServer( _traceChannel = vscode.window.createOutputChannel('C# LSP Trace Logs'); const hostExecutableResolver = new DotnetRuntimeExtensionResolver(platformInfo, getServerPath); - _languageServer = new RoslynLanguageServer(platformInfo, hostExecutableResolver, optionProvider, context, reporter); + const additionalExtensionPaths = scanExtensionPlugins(); + _languageServer = new RoslynLanguageServer( + platformInfo, + hostExecutableResolver, + optionProvider, + context, + reporter, + additionalExtensionPaths + ); // Register any commands that need to be handled by the extension. registerCommands(context, _languageServer, optionProvider, hostExecutableResolver); @@ -652,6 +665,28 @@ export async function activateRoslynLanguageServer( _languageServer.start(); return _languageServer; + + function scanExtensionPlugins(): string[] { + return vscode.extensions.all.flatMap((extension) => { + const loadPaths = extension.packageJSON.contributes?.['csharpExtensionLoadPaths']; + if (loadPaths === undefined || loadPaths === null) { + _traceChannel.appendLine(`Extension ${extension.id} does not contribute csharpExtensionLoadPaths`); + return []; + } + + if (!Array.isArray(loadPaths) || loadPaths.some((loadPath) => typeof loadPath !== 'string')) { + _channel.appendLine( + `Extension ${ + extension.id + } has invalid csharpExtensionLoadPaths. Expected string array, found ${typeof loadPaths}` + ); + return []; + } + + _traceChannel.appendLine(`Extension ${extension.id} contributes csharpExtensionLoadPaths: ${loadPaths}`); + return loadPaths; + }); + } } function getServerPath(options: Options, platformInfo: PlatformInformation) { diff --git a/src/main.ts b/src/main.ts index 14a9a3afe..574223c5e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -300,7 +300,6 @@ export async function activate( determineBrowserType: BlazorDebugConfigurationProvider.determineBrowserType, experimental: { sendServerRequest: async (t, p, ct) => await languageServerExport.sendRequest(t, p, ct), - serverExecutablePath: async () => await languageServerExport.serverExecutablePath(), }, }; } else { From 24c9082a4a8fcc90a982db5f33e994a9eb2d07f9 Mon Sep 17 00:00:00 2001 From: Fred Silberberg Date: Wed, 19 Jul 2023 11:02:33 -0700 Subject: [PATCH 07/10] Remove unused function --- src/lsptoolshost/roslynLanguageServer.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/lsptoolshost/roslynLanguageServer.ts b/src/lsptoolshost/roslynLanguageServer.ts index d3b575786..8ea26d99e 100644 --- a/src/lsptoolshost/roslynLanguageServer.ts +++ b/src/lsptoolshost/roslynLanguageServer.ts @@ -585,10 +585,6 @@ export class RoslynLanguageServer { throw new Error(`Invalid log level ${logLevel}`); } } - - public getServerExecutablePath(): string | undefined { - return this._serverExecutablePath; - } } /** From 7960c60d25cad468fc7cd026666d489df4f22108 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Wed, 19 Jul 2023 11:04:26 -0700 Subject: [PATCH 08/10] Revert the rest of the serverPath changes --- src/lsptoolshost/roslynLanguageServer.ts | 15 +++++---------- .../roslynLanguageServerExportChannel.ts | 5 ----- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/lsptoolshost/roslynLanguageServer.ts b/src/lsptoolshost/roslynLanguageServer.ts index 8ea26d99e..01cbc50bb 100644 --- a/src/lsptoolshost/roslynLanguageServer.ts +++ b/src/lsptoolshost/roslynLanguageServer.ts @@ -110,11 +110,6 @@ export class RoslynLanguageServer { */ private _solutionFile: vscode.Uri | undefined; - /** - * The path to the server executable that is being run, or undefined if none was. - */ - private _serverExecutablePath: string | undefined; - constructor( private platformInfo: PlatformInformation, private hostExecutableResolver: IHostExecutableResolver, @@ -366,7 +361,7 @@ export class RoslynLanguageServer { private async startServer(logLevel: string | undefined): Promise { const options = this.optionProvider.GetLatestOptions(); - this._serverExecutablePath = getServerPath(options, this.platformInfo); + const serverPath = getServerPath(options, this.platformInfo); const dotnetInfo = await this.hostExecutableResolver.getHostExecutableInfo(options); const dotnetRuntimePath = path.dirname(dotnetInfo.path); @@ -429,7 +424,7 @@ export class RoslynLanguageServer { } if (logLevel && [Trace.Messages, Trace.Verbose].includes(this.GetTraceLevel(logLevel))) { - _channel.appendLine(`Starting server at ${this._serverExecutablePath}`); + _channel.appendLine(`Starting server at ${serverPath}`); } // shouldn't this arg only be set if it's running with CSDevKit? @@ -442,13 +437,13 @@ export class RoslynLanguageServer { env: env, }; - if (this._serverExecutablePath.endsWith('.dll')) { + if (serverPath.endsWith('.dll')) { // If we were given a path to a dll, launch that via dotnet. - const argsWithPath = [this._serverExecutablePath].concat(args); + const argsWithPath = [serverPath].concat(args); childProcess = cp.spawn(dotnetExecutablePath, argsWithPath, cpOptions); } else { // Otherwise assume we were given a path to an executable. - childProcess = cp.spawn(this._serverExecutablePath, args, cpOptions); + childProcess = cp.spawn(serverPath, args, cpOptions); } return childProcess; diff --git a/src/lsptoolshost/roslynLanguageServerExportChannel.ts b/src/lsptoolshost/roslynLanguageServerExportChannel.ts index 8295c06fe..1adfe69a0 100644 --- a/src/lsptoolshost/roslynLanguageServerExportChannel.ts +++ b/src/lsptoolshost/roslynLanguageServerExportChannel.ts @@ -30,9 +30,4 @@ export class RoslynLanguageServerExport { const newType = new RequestType(type.method); return await server.sendRequest(newType, params, token); } - - public async serverExecutablePath(): Promise { - const server = await this.ensureServer(); - return server.getServerExecutablePath(); - } } From 1390dbacea27e69275ee1bb9c51d1cbd6db568cf Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Fri, 21 Jul 2023 15:37:29 -0700 Subject: [PATCH 09/10] PR Feedback --- src/lsptoolshost/roslynLanguageServer.ts | 11 +++++------ src/main.ts | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/lsptoolshost/roslynLanguageServer.ts b/src/lsptoolshost/roslynLanguageServer.ts index 8f9f955d4..7fca465f7 100644 --- a/src/lsptoolshost/roslynLanguageServer.ts +++ b/src/lsptoolshost/roslynLanguageServer.ts @@ -413,8 +413,8 @@ export class RoslynLanguageServer { args.push('--logLevel', logLevel); } - if (this.additionalExtensionPaths.length > 0) { - args.push('--additionalExtensions', `"${this.additionalExtensionPaths.join(',')}"`); + for (const extensionPath of this.additionalExtensionPaths) { + args.push('--extension', `"${extensionPath}"`); } // Get the brokered service pipe name from C# Dev Kit (if installed). @@ -690,7 +690,7 @@ export async function activateRoslynLanguageServer( function scanExtensionPlugins(): string[] { return vscode.extensions.all.flatMap((extension) => { - const loadPaths = extension.packageJSON.contributes?.['csharpExtensionLoadPaths']; + let loadPaths = extension.packageJSON.contributes?.['csharpExtensionLoadPaths']; if (loadPaths === undefined || loadPaths === null) { _traceChannel.appendLine(`Extension ${extension.id} does not contribute csharpExtensionLoadPaths`); return []; @@ -698,13 +698,12 @@ export async function activateRoslynLanguageServer( if (!Array.isArray(loadPaths) || loadPaths.some((loadPath) => typeof loadPath !== 'string')) { _channel.appendLine( - `Extension ${ - extension.id - } has invalid csharpExtensionLoadPaths. Expected string array, found ${typeof loadPaths}` + `Extension ${extension.id} has invalid csharpExtensionLoadPaths. Expected string array, found ${loadPaths}` ); return []; } + loadPaths = loadPaths.map((loadPath) => path.join(extension.extensionPath, loadPath)); _traceChannel.appendLine(`Extension ${extension.id} contributes csharpExtensionLoadPaths: ${loadPaths}`); return loadPaths; }); diff --git a/src/main.ts b/src/main.ts index 80045d89b..ca502063d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -312,7 +312,7 @@ export async function activate( tryGetCSharpDevKitExtensionExports(csharpLogObserver); const languageServerExport = new RoslynLanguageServerExport( - >roslynLanguageServerPromise + roslynLanguageServerPromise! ); return { initializationFinished: async () => { From 2a92c2a9744dc57575c0fd163d5aaa00885b293c Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Fri, 21 Jul 2023 15:43:45 -0700 Subject: [PATCH 10/10] Prettier --- src/main.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index ca502063d..1ca5a16b5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -311,9 +311,7 @@ export async function activate( if (!useOmnisharpServer) { tryGetCSharpDevKitExtensionExports(csharpLogObserver); - const languageServerExport = new RoslynLanguageServerExport( - roslynLanguageServerPromise! - ); + const languageServerExport = new RoslynLanguageServerExport(roslynLanguageServerPromise!); return { initializationFinished: async () => { await coreClrDebugPromise;