Skip to content

Commit 505b861

Browse files
author
Andrew Hall
committed
Use builtInComponent
1 parent eafcab6 commit 505b861

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

src/lsptoolshost/extensions/builtInComponents.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ export const componentInfo: { [key: string]: ComponentInfo } = {
3232
optionName: 'razorDevKit',
3333
componentDllPaths: ['Microsoft.VisualStudio.DevKit.Razor.dll'],
3434
},
35+
razorExtension: {
36+
defaultFolderName: '.razorExtension',
37+
optionName: 'razorExtension',
38+
componentDllPaths: ['Microsoft.VisualStudioCode.RazorExtension.dll'],
39+
},
3540
};
3641

3742
export function getComponentPaths(componentName: string, options: LanguageServerOptions | undefined): string[] {

src/lsptoolshost/server/roslynLanguageServer.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -615,12 +615,9 @@ export class RoslynLanguageServer {
615615
path.join(razorPath, 'Targets', 'Microsoft.NET.Sdk.Razor.DesignTime.targets')
616616
);
617617

618-
const razorExtensionPath =
619-
razorOptions.razorExtensionPath === ''
620-
? path.join(context.extension.extensionPath, '.razorExtension')
621-
: razorOptions.razorExtensionPath;
622-
623-
additionalExtensionPaths.push(path.join(razorExtensionPath, 'Microsoft.VisualStudioCode.RazorExtension.dll'));
618+
getComponentPaths('razorExtension', languageServerOptions).forEach((path) =>
619+
additionalExtensionPaths.push(path)
620+
);
624621

625622
// Get the brokered service pipe name from C# Dev Kit (if installed).
626623
// We explicitly call this in the LSP server start action instead of awaiting it
@@ -969,6 +966,7 @@ export class RoslynLanguageServer {
969966
additionalExtensionPaths.push(path)
970967
);
971968
}
969+
972970
return args;
973971
}
974972

src/shared/options.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ export interface RazorOptions {
8888
readonly razorDevMode: boolean;
8989
readonly razorPluginPath: string;
9090
readonly razorServerPath: string;
91-
92-
// Folder that contains Microsoft.VisualStudioCode.RazorExtension.dll
93-
readonly razorExtensionPath: string;
9491
}
9592

9693
class CommonOptionsImpl implements CommonOptions {
@@ -433,9 +430,6 @@ class RazorOptionsImpl implements RazorOptions {
433430
public get razorServerPath() {
434431
return readOption<string>('razor.languageServer.directory', '');
435432
}
436-
public get razorExtensionPath() {
437-
return readOption<string>('razor.extension.path', '');
438-
}
439433
}
440434

441435
export const commonOptions: CommonOptions = new CommonOptionsImpl();

tasks/projectPaths.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const devKitDependenciesDirectory = path.join(rootPath, componentInfo.ros
2020
export const xamlToolsDirectory = path.join(rootPath, componentInfo.xamlTools.defaultFolderName);
2121
export const razorLanguageServerDirectory = path.join(rootPath, '.razor');
2222
export const razorDevKitDirectory = path.join(rootPath, componentInfo.razorDevKit.defaultFolderName);
23-
export const razorExtensionDirectory = path.join(rootPath, '.razorExtension');
23+
export const razorExtensionDirectory = path.join(rootPath, componentInfo.razorExtension.defaultFolderName);
2424

2525
export const codeExtensionPath = commandLineOptions.codeExtensionPath || rootPath;
2626

0 commit comments

Comments
 (0)