diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 91d400ff263..64ec600783a 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -803,9 +803,6 @@ namespace ts.server { } else { this.log("no config file"); } - if (configFileName) { - configFileName = getAbsolutePath(configFileName, searchPath); - } if (configFileName && (!this.configProjectIsActive(configFileName))) { var configResult = this.openConfigFile(configFileName, fileName); if (!configResult.success) { @@ -910,7 +907,8 @@ namespace ts.server { configFilename = ts.normalizePath(configFilename); // file references will be relative to dirPath (or absolute) var dirPath = ts.getDirectoryPath(configFilename); - var rawConfig: { config?: ProjectOptions; error?: Diagnostic; } = ts.readConfigFile(configFilename); + var contents = this.host.readFile(configFilename) + var rawConfig: { config?: ProjectOptions; error?: Diagnostic; } = ts.parseConfigFileText(configFilename, contents); if (rawConfig.error) { return rawConfig.error; } diff --git a/tests/cases/fourslash/server/projectInfo.ts b/tests/cases/fourslash/server/projectInfo01.ts similarity index 100% rename from tests/cases/fourslash/server/projectInfo.ts rename to tests/cases/fourslash/server/projectInfo01.ts diff --git a/tests/cases/fourslash/server/projectInfo02.ts b/tests/cases/fourslash/server/projectInfo02.ts new file mode 100644 index 00000000000..f884062fc14 --- /dev/null +++ b/tests/cases/fourslash/server/projectInfo02.ts @@ -0,0 +1,15 @@ +/// + +// @Filename: a.ts +////export var test = "test String" + +// @Filename: b.ts +////export var test2 = "test String" + +// @Filename: tsconfig.json +////{ "files": ["a.ts", "b.ts"] } + +debugger; + +goTo.file("a.ts") +verify.ProjectInfo(["lib.d.ts", "a.ts", "b.ts"])