@@ -2728,6 +2728,65 @@ namespace ts.projectSystem {
2728
2728
arguments : { projectFileName : projectName }
2729
2729
} ) . response ;
2730
2730
assert . isTrue ( diags . length === 0 ) ;
2731
+
2732
+ session . executeCommand ( < server . protocol . SetCompilerOptionsForInferredProjectsRequest > {
2733
+ type : "request" ,
2734
+ command : server . CommandNames . CompilerOptionsForInferredProjects ,
2735
+ seq : 3 ,
2736
+ arguments : { options : { module : ModuleKind . CommonJS } }
2737
+ } ) ;
2738
+ const diagsAfterUpdate = session . executeCommand ( < server . protocol . CompilerOptionsDiagnosticsRequest > {
2739
+ type : "request" ,
2740
+ command : server . CommandNames . CompilerOptionsDiagnosticsFull ,
2741
+ seq : 4 ,
2742
+ arguments : { projectFileName : projectName }
2743
+ } ) . response ;
2744
+ assert . isTrue ( diagsAfterUpdate . length === 0 ) ;
2745
+ } ) ;
2746
+
2747
+ it ( "for external project" , ( ) => {
2748
+ const f1 = {
2749
+ path : "/a/b/f1.js" ,
2750
+ content : "function test1() { }"
2751
+ } ;
2752
+ const host = createServerHost ( [ f1 , libFile ] ) ;
2753
+ const session = createSession ( host ) ;
2754
+ const projectService = session . getProjectService ( ) ;
2755
+ const projectFileName = "/a/b/project.csproj" ;
2756
+ const externalFiles = toExternalFiles ( [ f1 . path ] ) ;
2757
+ projectService . openExternalProject ( < protocol . ExternalProject > {
2758
+ projectFileName,
2759
+ rootFiles : externalFiles ,
2760
+ options : { }
2761
+ } ) ;
2762
+
2763
+ checkNumberOfProjects ( projectService , { externalProjects : 1 } ) ;
2764
+
2765
+ const diags = session . executeCommand ( < server . protocol . CompilerOptionsDiagnosticsRequest > {
2766
+ type : "request" ,
2767
+ command : server . CommandNames . CompilerOptionsDiagnosticsFull ,
2768
+ seq : 2 ,
2769
+ arguments : { projectFileName }
2770
+ } ) . response ;
2771
+ assert . isTrue ( diags . length === 0 ) ;
2772
+
2773
+ session . executeCommand ( < server . protocol . OpenExternalProjectRequest > {
2774
+ type : "request" ,
2775
+ command : server . CommandNames . OpenExternalProject ,
2776
+ seq : 3 ,
2777
+ arguments : {
2778
+ projectFileName,
2779
+ rootFiles : externalFiles ,
2780
+ options : { module : ModuleKind . CommonJS }
2781
+ }
2782
+ } ) ;
2783
+ const diagsAfterUpdate = session . executeCommand ( < server . protocol . CompilerOptionsDiagnosticsRequest > {
2784
+ type : "request" ,
2785
+ command : server . CommandNames . CompilerOptionsDiagnosticsFull ,
2786
+ seq : 4 ,
2787
+ arguments : { projectFileName }
2788
+ } ) . response ;
2789
+ assert . isTrue ( diagsAfterUpdate . length === 0 ) ;
2731
2790
} ) ;
2732
2791
} ) ;
2733
2792
0 commit comments