typescript-tools.nvim icon indicating copy to clipboard operation
typescript-tools.nvim copied to clipboard

Diagnostic on all workspace

Open adelin-b opened this issue 2 years ago • 8 comments

#Feature: get diagnostic from the whole workspace

Null ls implemented a way to get all error from the workspace, which is to run tsc --noEmit and parsing the result.

It's not very efficient and take a while. However launching in watch mode is instantaneous. Would it be possible to have the diagnostic instance running in watch mode here.

Thank you.

adelin-b avatar Jun 22 '23 15:06 adelin-b

It is possible tsserver has dedicated method for that, but as far as I know it is slow also and that's why vscode don't enable this by default. We can implement that and hide this behind some setting, just like vscode does it.

pmizio avatar Jun 22 '23 15:06 pmizio

It is possible tsserver has dedicated method for that, but as far as I know it is slow also and that's why vscode don't enable this by default. We can implement that and hide this behind some setting, just like vscode does it.

I wouldn't call that slow as this is the fastest update there is in the typescript ecosystem.

I just tried with tsc :

time npx tsc --noEmit --incremental
src/domains/assets/components/AssetsGallery/index.tsx:23:9 - error TS1005: ',' expected.

23 const A ssetsGallery = ({
           ~~~~~~~~~~~~


Found 1 error in src/domains/assets/components/AssetsGallery/index.tsx:23

npx tsc --noEmit --incremental  6,16s user 0,45s system 194% cpu 3,393 total

So running this command after editing a file would take 6 seconds

While if I update a file and watch

3sec

I takes 3 seconds to update.

@adelin-b For tsc I am using dmmulroy/tsc.nvim: A Neovim plugin for seamless, asynchronous project-wide TypeScript type-checking using the TypeScript compiler (tsc) and it works great.

And Im currently using null-ls that does this onsave https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#tsc So im looking for something more efficient and faster.

adelin-b avatar Jun 22 '23 16:06 adelin-b

It is definitely doable, we will see how it will perform. But it isn't highest priority right now. We have few plugin breaking bugs to fix 🙂

pmizio avatar Jun 22 '23 16:06 pmizio

I am currently using none-ls/null-ls's TSC diagnostics, which allows the global (workspace) diagnostics. Because it is using tsserver, it is not compatible with typescript-tools. Not sure about this implementation, but this might help you implementing it.

https://github.com/jose-elias-alvarez/null-ls.nvim

tpatalas avatar Oct 27 '23 20:10 tpatalas

Sorry I missed your comment @tpatalas. I know like you see I tried to implement that but current plugin architecture cannot provide efficient implementation without loosing performance. I had this in mind in refactors.

pmizio avatar Nov 08 '23 09:11 pmizio

Sorry I missed your comment @tpatalas. I know like you see I tried to implement that but current plugin architecture cannot provide efficient implementation without loosing performance. I had this in mind in refactors.

Performance is truly matter! Thank you for your effort

tpatalas avatar Nov 13 '23 19:11 tpatalas

Is it currently planned?

GuillaumeDesforges avatar Feb 07 '25 18:02 GuillaumeDesforges