Skip to content

Commit 9f56466

Browse files
committed
Apply PR feedback
1 parent de97971 commit 9f56466

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

l10n/bundle.l10n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"Cannot load Razor language server because the directory was not found: '{0}'": "Cannot load Razor language server because the directory was not found: '{0}'",
4949
"Could not find '{0}' in or above '{1}'.": "Could not find '{0}' in or above '{1}'.",
5050
"Invalid razor.server.trace setting. Defaulting to '{0}'": "Invalid razor.server.trace setting. Defaulting to '{0}'",
51-
"Could not find Razor Language Server executable within directory '{0}'": "Could not find Razor Language Server executable within directory '{0}'",
51+
"Could not find Razor Language Server executable '{0}' within directory": "Could not find Razor Language Server executable '{0}' within directory",
5252
"Server failed to start after retrying 5 times.": "Server failed to start after retrying 5 times.",
5353
"Razor Language Server failed to start unexpectedly, please check the 'Razor Log' and report an issue.": "Razor Language Server failed to start unexpectedly, please check the 'Razor Log' and report an issue.",
5454
"Tried to send requests while server is not started.": "Tried to send requests while server is not started.",

src/razor/src/razorLanguageServerOptionsResolver.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,16 @@ export function resolveRazorLanguageServerOptions(
3535
}
3636

3737
function findLanguageServerExecutable(withinDir: string) {
38-
const isSelfContained = fs.existsSync(path.join(withinDir, 'coreclr.dll'));
39-
let fullPath = '';
40-
if (isSelfContained) {
41-
const fileName = isWindows() ? 'rzls.exe' : 'rzls';
42-
fullPath = path.join(withinDir, fileName);
43-
} else {
38+
// Prefer using executable over fallback to dll.
39+
const fileName = isWindows() ? 'rzls.exe' : 'rzls';
40+
let fullPath = path.join(withinDir, fileName);
41+
if (!fs.existsSync(fullPath)) {
4442
fullPath = path.join(withinDir, 'rzls.dll');
4543
}
4644

4745
if (!fs.existsSync(fullPath)) {
4846
throw new Error(
49-
vscode.l10n.t("Could not find Razor Language Server executable within directory '{0}'", withinDir)
47+
vscode.l10n.t("Could not find Razor Language Server executable '{0}' within directory", fullPath)
5048
);
5149
}
5250

0 commit comments

Comments
 (0)