typescript-language-server icon indicating copy to clipboard operation
typescript-language-server copied to clipboard

feat: workspace diagnostics poc

Open entropitor opened this issue 3 years ago • 5 comments

Proof of concept of the workspace diagnostics feature

Proof of concept of #361

entropitor avatar Jan 05 '22 12:01 entropitor

Nice.

Likely this would need to run in a separate tsserver process as we can't allow a complication that could take minutes block all other functionality.

In vscode this feature is controlled through the typescript.tsserver.experimental.enableProjectDiagnostics setting, I believe. Though not sure how they've implemented it exactly. Would have to investigate it when I have some time.

rchl avatar Jan 05 '22 21:01 rchl

Quick check of typescript-language-features logs in VSCode shows that on every change it sends diagnostics for all files. Even files within node_modules. A bit inefficient if you ask me but might not be an issue in practice.

Still, it's dubbed as an "experimental" feature there so likely not fully optimized yet.

rchl avatar Jan 05 '22 22:01 rchl

Yeah, if you have some pointers, I might have some time to implement this as it would benefit me greatly. Not sure how to best go from here 😄 I've already increased the delay to 1000 and then I didn't notice any performance problems myself. But I haven't used it a lot yet, if I clear the build cache, it might become unresponsive in the beginning. Potentially some debouncing (does the delay do this?) + separate process could help

Do you suggest using a seperate tsClient? Because I think it might use some of the configuration, ... so that might not fully work

entropitor avatar Jan 05 '22 22:01 entropitor

Without looking too deep into it, I think it should be implement with an additional tsClient. It would still receive the same initial configuration.

rchl avatar Jan 06 '22 08:01 rchl

Any chance this can be merged? This feature would be greatly appreciated.

dimas-cyriaco avatar Apr 12 '22 13:04 dimas-cyriaco

#585 will get us a step closer to this feature but there will still be a bunch more code that will have to be ported and adapted from VSCode.

I'll close this PR as it's not the right way to do it.

rchl avatar Sep 11 '22 19:09 rchl

I'll close this PR as it's not the right way to do it.

@rchl as your linked PR has been merged, is there any follow up issue or PR for this I could follow?

weilbith avatar Jun 18 '23 06:06 weilbith

There is a bunch of work to be done to make that work and I can't justify working on that at the moment.

Some in-progress, non-working changes are on the https://github.com/typescript-language-server/typescript-language-server/tree/feat/project-diagnostics branch.

rchl avatar Jun 18 '23 17:06 rchl