@@ -1026,10 +1026,16 @@ namespace ts.server {
10261026 // the newly opened file.
10271027 findConfigFile ( searchPath : string ) : string {
10281028 while ( true ) {
1029- const fileName = ts . combinePaths ( searchPath , "tsconfig.json" ) ;
1030- if ( this . host . fileExists ( fileName ) ) {
1031- return fileName ;
1029+ const tsconfigFileName = ts . combinePaths ( searchPath , "tsconfig.json" ) ;
1030+ if ( this . host . fileExists ( tsconfigFileName ) ) {
1031+ return tsconfigFileName ;
1032+ }
1033+
1034+ const jsconfigFileName = ts . combinePaths ( searchPath , "jsconfig.json" ) ;
1035+ if ( this . host . fileExists ( jsconfigFileName ) ) {
1036+ return jsconfigFileName ;
10321037 }
1038+
10331039 const parentPath = ts . getDirectoryPath ( searchPath ) ;
10341040 if ( parentPath === searchPath ) {
10351041 break ;
@@ -1172,15 +1178,13 @@ namespace ts.server {
11721178
11731179 configFileToProjectOptions ( configFilename : string ) : { succeeded : boolean , projectOptions ?: ProjectOptions , error ?: ProjectOpenResult } {
11741180 configFilename = ts . normalizePath ( configFilename ) ;
1175- // file references will be relative to dirPath (or absolute)
1176- const dirPath = ts . getDirectoryPath ( configFilename ) ;
11771181 const contents = this . host . readFile ( configFilename ) ;
11781182 const rawConfig : { config ?: ProjectOptions ; error ?: Diagnostic ; } = ts . parseConfigFileTextToJson ( configFilename , contents ) ;
11791183 if ( rawConfig . error ) {
11801184 return { succeeded : false , error : rawConfig . error } ;
11811185 }
11821186 else {
1183- const parsedCommandLine = ts . parseJsonConfigFileContent ( rawConfig . config , this . host , dirPath ) ;
1187+ const parsedCommandLine = ts . parseJsonConfigFileContent ( rawConfig . config , this . host , configFilename ) ;
11841188 Debug . assert ( ! ! parsedCommandLine . fileNames ) ;
11851189
11861190 if ( parsedCommandLine . errors && ( parsedCommandLine . errors . length > 0 ) ) {
0 commit comments