File tree Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -3067,12 +3067,15 @@ namespace ts.projectSystem {
3067
3067
const projectService = createProjectService ( host ) ;
3068
3068
projectService . openClientFile ( file1 . path ) ;
3069
3069
3070
- const project = projectService . inferredProjects [ 0 ] ;
3071
- const sourceFileForFile1 = project . getSourceFile ( < Path > file1 . path ) ;
3072
- const sourceFileForModuleFile = project . getSourceFile ( < Path > moduleFile . path ) ;
3073
-
3074
- assert . isNotNull ( sourceFileForFile1 ) ;
3075
- assert . isNotNull ( sourceFileForModuleFile ) ;
3070
+ let project = projectService . inferredProjects [ 0 ] ;
3071
+ let options = project . getCompilerOptions ( ) ;
3072
+ assert . isTrue ( options . maxNodeModuleJsDepth === 2 ) ;
3073
+
3074
+ // Assert the option sticks
3075
+ projectService . setCompilerOptionsForInferredProjects ( { target : ScriptTarget . ES2016 } ) ;
3076
+ project = projectService . inferredProjects [ 0 ] ;
3077
+ options = project . getCompilerOptions ( ) ;
3078
+ assert . isTrue ( options . maxNodeModuleJsDepth === 2 ) ;
3076
3079
} ) ;
3077
3080
} ) ;
3078
3081
Original file line number Diff line number Diff line change @@ -1073,7 +1073,7 @@ namespace ts.server {
1073
1073
: new InferredProject ( this , this . documentRegistry , this . compilerOptionsForInferredProjects ) ;
1074
1074
1075
1075
if ( root . scriptKind === ScriptKind . JS || root . scriptKind === ScriptKind . JSX ) {
1076
- project . isJsInferredProject = true ;
1076
+ project . setAsJsInferredProject ( ) ;
1077
1077
}
1078
1078
1079
1079
project . addRoot ( root ) ;
Original file line number Diff line number Diff line change @@ -713,14 +713,14 @@ namespace ts.server {
713
713
} ) ( ) ;
714
714
715
715
private _isJsInferredProject = false ;
716
- set isJsInferredProject ( newValue : boolean ) {
717
- if ( newValue && ! this . _isJsInferredProject ) {
718
- this . setCompilerOptions ( this . getCompilerOptions ( ) ) ;
719
- }
720
- this . _isJsInferredProject = newValue ;
716
+
717
+ setAsJsInferredProject ( ) {
718
+ this . _isJsInferredProject = true ;
719
+ this . setCompilerOptions ( ) ;
721
720
}
722
721
723
- setCompilerOptions ( newOptions : CompilerOptions ) {
722
+ setCompilerOptions ( newOptions ?: CompilerOptions ) {
723
+ newOptions = newOptions ? newOptions : this . getCompilerOptions ( ) ;
724
724
if ( ! newOptions ) {
725
725
return ;
726
726
}
You can’t perform that action at this time.
0 commit comments