Skip to content
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

tsserver: tsconfig.json not honored for files that already exist in workspace #3244

Closed
dbaeumer opened this issue May 21, 2015 · 4 comments
Closed
Labels
API Relates to the public API for TypeScript Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@dbaeumer
Copy link
Member

TS workspace
create a file foo.ts

export function foo(): number {
return 10;
}

Observe: the tsserver complains about missing module option
Add a tsconfig.json to it:

{
"compilerOptions": {
"sourceMap": true,
"module": "commonjs"
}
}

Switch back to foo.ts and observe that the error is still visible.

You need to restart tsserver so that the server recognizes the tsconfig.json file.

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript API Relates to the public API for TypeScript labels May 21, 2015
@mhegazy
Copy link
Contributor

mhegazy commented May 21, 2015

The issue is we are not adding file watchers on failed lookups, i.e. if you are looking at a file a\b\c\d.ts we will look for a\b\c\tsconfig.json, a\b\tsconfig.json, a\tsconfig.json and tsconfig.json. if non was found the file is deemed as a loose file. now to make this scenario work,. we need to add a directory watcher on each directory in the lookup chain, and ensure that if a tsconfig.json ever showed up the context is recomputed.

@mhegazy
Copy link
Contributor

mhegazy commented Jun 13, 2015

I have chatted with @jrieken and @egamma about this, and we need a new command to force the server to reload all projects. The host would fire this whenever a tsconfig file is added.

@mhegazy
Copy link
Contributor

mhegazy commented Aug 12, 2015

@hoanhtien is looking on adding either a directory watcher or a new command to allow for updating the project strucutre

@mhegazy mhegazy assigned zhengbli and unassigned hoanhtien Aug 19, 2015
@zhengbli
Copy link
Contributor

#4023 added a new command called "ReloadProjects", which can be called explicitly to reload the projects for all opened files. Can you give it a try?

@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Aug 20, 2015
@mhegazy mhegazy closed this as completed Aug 20, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API Relates to the public API for TypeScript Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

5 participants