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