@@ -56,7 +56,7 @@ import { registerShowToastNotification } from './showToastNotification';
56
56
import { registerRazorCommands } from './razorCommands' ;
57
57
import { registerOnAutoInsert } from './onAutoInsert' ;
58
58
import { registerCodeActionFixAllCommands } from './fixAllCodeAction' ;
59
- import { commonOptions , languageServerOptions , omnisharpOptions } from '../shared/options' ;
59
+ import { commonOptions , languageServerOptions , omnisharpOptions , razorOptions } from '../shared/options' ;
60
60
import { NamedPipeInformation } from './roslynProtocol' ;
61
61
import { IDisposable } from '../disposable' ;
62
62
import { registerNestedCodeActionCommands } from './nestedCodeAction' ;
@@ -513,9 +513,16 @@ export class RoslynLanguageServer {
513
513
args . push ( '--logLevel' , logLevel ) ;
514
514
}
515
515
516
+ const razorPath =
517
+ razorOptions . razorServerPath === ''
518
+ ? path . join ( context . extension . extensionPath , '.razor' )
519
+ : razorOptions . razorServerPath ;
520
+
521
+ args . push ( '--razorSourceGenerator' , path . join ( razorPath , 'Microsoft.CodeAnalysis.Razor.Compiler.dll' ) ) ;
522
+
516
523
args . push (
517
- '--razorSourceGenerator ' ,
518
- path . join ( context . extension . extensionPath , '.razor ' , 'Microsoft.CodeAnalysis. Razor.Compiler.dll ' )
524
+ '--razorDesignTimePath ' ,
525
+ path . join ( razorPath , 'Targets ' , 'Microsoft.NET.Sdk. Razor.DesignTime.targets ' )
519
526
) ;
520
527
521
528
// Get the brokered service pipe name from C# Dev Kit (if installed).
0 commit comments