Skip to content

Commit befc04e

Browse files
committed
Minor updates to handle an error case and PR comments
1 parent ab97842 commit befc04e

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,10 @@
423423
"integrity": "9944EBD6EE06BD595BCADD3057CD9BEF4105C3A3952DAE03E54F3114E2E6661F"
424424
},
425425
{
426-
"id": "RoslynCopilotLanguageServer",
426+
"id": "RoslynCopilot",
427427
"description": "Language server for Roslyn Copilot integration (Windows)",
428428
"url": "https://roslynomnisharp.blob.core.windows.net/releases/1.39.12/omnisharp-linux-musl-arm64-net6.0-1.39.12.zip",
429-
"installPath": ".roslyncopilotlanguageserver",
429+
"installPath": ".roslyncopilot",
430430
"platforms": [
431431
"win32",
432432
"linux",
@@ -437,7 +437,7 @@
437437
"x86_64",
438438
"arm64"
439439
],
440-
"installTestPath": "./.roslyncopilotlanguageserver/Microsoft.VisualStudio.Copilot.Roslyn.LanguageServer.dll",
440+
"installTestPath": "./.roslyncopilot/Microsoft.VisualStudio.Copilot.Roslyn.LanguageServer.dll",
441441
"integrity": "9944EBD6EE06BD595BCADD3057CD9BEF4105C3A3952DAE03E54F3114E2E6661F"
442442
},
443443
{

src/lsptoolshost/server/roslynLanguageServer.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import * as path from 'path';
88
import * as cp from 'child_process';
99
import * as uuid from 'uuid';
1010
import * as net from 'net';
11+
import * as fs from 'fs';
1112
import * as util from '../../common';
1213
import {
1314
LanguageClientOptions,
@@ -106,11 +107,10 @@ export class RoslynLanguageServer {
106107
private static _processId: number | undefined;
107108

108109
/**
109-
* The folder name for the Roslyn Copilot language server extension.
110+
* The folder name for the Roslyn Copilot language server dll.
110111
*/
111-
private static readonly _copilotLanguageServerExtensionDirName = '.roslyncopilotlanguageserver';
112-
private static readonly _copilotLanguageServerExtensionAssemblyName =
113-
'Microsoft.VisualStudio.Copilot.Roslyn.LanguageServer.dll';
112+
private static readonly _copilotLanguageServerDllDirName = '.roslyncopilot';
113+
private static readonly _copilotLanguageServerDllName = 'Microsoft.VisualStudio.Copilot.Roslyn.LanguageServer.dll';
114114

115115
/**
116116
* The solution file previously opened; we hold onto this so we can send this back over if the server were to be relaunched for any reason, like some other configuration
@@ -1083,20 +1083,19 @@ export class RoslynLanguageServer {
10831083
await exports.setupTelemetryEnvironmentAsync(env);
10841084
}
10851085

1086-
const copilotServerExtensionfolder = path.join(
1086+
const copilotServerExtensionFullPath = path.join(
10871087
util.getExtensionPath(),
1088-
RoslynLanguageServer._copilotLanguageServerExtensionDirName
1088+
RoslynLanguageServer._copilotLanguageServerDllDirName,
1089+
RoslynLanguageServer._copilotLanguageServerDllName
10891090
);
10901091

1091-
if (copilotServerExtensionfolder) {
1092-
const copilotServerExtensionFullPath = path.join(
1093-
copilotServerExtensionfolder,
1094-
RoslynLanguageServer._copilotLanguageServerExtensionAssemblyName
1095-
);
1092+
if (fs.existsSync(copilotServerExtensionFullPath)) {
10961093
additionalExtensionPaths.push(copilotServerExtensionFullPath);
10971094
channel.trace(
1098-
`CSharp DevKit contributes Copilot langauge server extension: ${copilotServerExtensionFullPath}`
1095+
`CSharp DevKit contributes Copilot language server extension: ${copilotServerExtensionFullPath}`
10991096
);
1097+
} else {
1098+
channel.debug(`Copilot language server extension not found at: ${copilotServerExtensionFullPath}`);
11001099
}
11011100
}
11021101

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export async function activate(
7878
requiredPackageIds.push('OmniSharp');
7979
}
8080
if (csharpDevkitExtension) {
81-
requiredPackageIds.push('RoslynCopilotLanguageServer');
81+
requiredPackageIds.push('RoslynCopilot');
8282
}
8383

8484
const networkSettingsProvider = vscodeNetworkSettingsProvider(vscode);

0 commit comments

Comments
 (0)