-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to TypeScript server for tsconfig.json files. #2450
Conversation
file F, the server will check whether F is configured by a tsconfig.json file. If so, the project specified by the tsconfig.json file becomes the LS context for F.
in directory configured by tsconfig.json, but file not part of the configured project.
// TODO: pass true for file exiplicitly opened | ||
var info = this.openFile(normRootFilename, false); | ||
if (ts.sys.fileExists(rootFilename)) { | ||
var info = this.openFile(rootFilename, clientFileName == rootFilename); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ===
@@ -484,44 +508,77 @@ module ts.server { | |||
this.printProjects(); | |||
} | |||
|
|||
gcConfiguredProjects() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleanConfiguredProjects or updateConfiguredProjects
Just a few comments. looks good to me, but i would rather have the findConfigFile logic shared with tsc.ts before it goes in. |
👍 |
Add support to TypeScript server for tsconfig.json files.
When a file F is opened by the host, the server will now check whether F is configured by a tsconfig.json file and, if so, use the specified project as the context for F.
Still TODO, monitor tsconfig.json files for changes and update configuration. For now, programmers will need to restart their editor to pick up the tsconfig.json file changes.