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

Update when tslint.json changes #30

Open
amatiasq opened this issue May 11, 2017 · 3 comments
Open

Update when tslint.json changes #30

amatiasq opened this issue May 11, 2017 · 3 comments

Comments

@amatiasq
Copy link

amatiasq commented May 11, 2017

I had a rule causing me some trouble so I disabled it. I closed and open the offending file many times but vscode still warning about the disabled rule. It was fixed after I closed vscode itself.

@angelozerr
Copy link
Owner

angelozerr commented May 11, 2017

To fix quickly this issue, we could use fs.watch to disable the tslint cache configuration when tslint.json changed.

It will fix the case to close VSCode, but it will not revalidate the opened TypeScript files. I don't know how to force tsserver diagnostics when we are inside a plugin.

I'm not a big expert with fs.watch, but I'm afraid with lock problem (ex: user delete, move tslint.json file, is it working?)

Perhaps an another idea is to wait for TypeScript 2.4 which will implement getExternalFiles for plugin. I think getExternalFiles could be helpfull to implement the issue #4

@egamma what do you think?

@egamma
Copy link
Contributor

egamma commented May 11, 2017

@amatiasq reloading the window, or TypeScript: reload project would be a faster work around.

However, vscode-tslint reacts to tslint.json config changes automatically and we should support the tslint-language-service as well.

To fix quickly this issue, we could use fs.watch to disable the tslint cache configuration when tslint.json changed.

Watching the config file is the easy part... since TypeScript doesn't touch the tslint.json file, there are no locking concerns. The challenge is how to trigger a revalidation of the open files. I see currently no easy way to do this from inside the typescript server. The best would be when the TS server provides an API recomputeDiagnostics which revalidates the open files. We should discuss this with the TS folks.

mjbvz added a commit to mjbvz/tslint-language-service that referenced this issue Aug 21, 2018
Similar to angelozerr#30 but targeting changes to the tsconfig.json file itself
@vsviridov
Copy link

I use vim so I have to restart the whole editor for it to re-read rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants