From 53e449c90149fe5929d35c843c87128f386e179d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Jul 2015 23:33:42 -0700 Subject: [PATCH] Allow tsconfig.json to be added to fourslash test. --- src/server/editorServices.ts | 6 ++---- .../server/{projectInfo.ts => projectInfo01.ts} | 0 tests/cases/fourslash/server/projectInfo02.ts | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) rename tests/cases/fourslash/server/{projectInfo.ts => projectInfo01.ts} (100%) create mode 100644 tests/cases/fourslash/server/projectInfo02.ts 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"])