@@ -506,10 +506,6 @@ export class RoslynLanguageServer {
506
506
args . push ( '--logLevel' , logLevel ) ;
507
507
}
508
508
509
- for ( const extensionPath of additionalExtensionPaths ) {
510
- args . push ( '--extension' , extensionPath ) ;
511
- }
512
-
513
509
args . push (
514
510
'--razorSourceGenerator' ,
515
511
path . join ( context . extension . extensionPath , '.razor' , 'Microsoft.CodeAnalysis.Razor.Compiler.dll' )
@@ -540,7 +536,7 @@ export class RoslynLanguageServer {
540
536
// Set command enablement as soon as we know devkit is available.
541
537
vscode . commands . executeCommand ( 'setContext' , 'dotnet.server.activationContext' , 'RoslynDevKit' ) ;
542
538
543
- const csharpDevKitArgs = this . getCSharpDevKitExportArgs ( ) ;
539
+ const csharpDevKitArgs = this . getCSharpDevKitExportArgs ( additionalExtensionPaths ) ;
544
540
args = args . concat ( csharpDevKitArgs ) ;
545
541
546
542
await this . setupDevKitEnvironment ( dotnetInfo . env , csharpDevkitExtension ) ;
@@ -553,6 +549,10 @@ export class RoslynLanguageServer {
553
549
_wasActivatedWithCSharpDevkit = false ;
554
550
}
555
551
552
+ for ( const extensionPath of additionalExtensionPaths ) {
553
+ args . push ( '--extension' , extensionPath ) ;
554
+ }
555
+
556
556
if ( logLevel && [ Trace . Messages , Trace . Verbose ] . includes ( this . GetTraceLevel ( logLevel ) ) ) {
557
557
_channel . appendLine ( `Starting server at ${ serverPath } ` ) ;
558
558
}
@@ -806,7 +806,7 @@ export class RoslynLanguageServer {
806
806
) ;
807
807
}
808
808
809
- private static getCSharpDevKitExportArgs ( ) : string [ ] {
809
+ private static getCSharpDevKitExportArgs ( additionalExtensionPaths : string [ ] ) : string [ ] {
810
810
const args : string [ ] = [ ] ;
811
811
812
812
const clientRoot = __dirname ;
@@ -819,6 +819,14 @@ export class RoslynLanguageServer {
819
819
args . push ( '--devKitDependencyPath' , devKitDepsPath ) ;
820
820
821
821
args . push ( '--sessionId' , getSessionId ( ) ) ;
822
+
823
+ // Also include the Xaml Dev Kit extensions
824
+ const xamlBasePath = path . join ( clientRoot , '..' , '.xamlDesignTools' , 'lib' , 'netstandard2.0' ) ;
825
+ additionalExtensionPaths . push ( path . join ( xamlBasePath , 'Microsoft.VisualStudio.DesignTools.CodeAnalysis.dll' ) ) ;
826
+ additionalExtensionPaths . push (
827
+ path . join ( xamlBasePath , 'Microsoft.VisualStudio.DesignTools.CodeAnalysis.Diagnostics.dll' )
828
+ ) ;
829
+
822
830
return args ;
823
831
}
824
832
0 commit comments