Skip to content

Diagnostics across files within a project #253

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

Closed
agreco opened this issue Aug 24, 2021 · 15 comments
Closed

Diagnostics across files within a project #253

agreco opened this issue Aug 24, 2021 · 15 comments

Comments

@agreco
Copy link

agreco commented Aug 24, 2021

Hey,

I've been using this LSP server with a lot of success on my projects.

There is one feature I think is still missing, which is the ability to use the LSP diagnostics panel to show all errors/warnings across files within a project. To determine if a project has any issues I have to compile the project from outside ST.

I raised the same issue here: sublimelsp/LSP#1803 and here: sublimelsp/LSP-typescript#73, and the advice was that type of feature would need to be handled by the LSP server in question and may not be a possible option in tsserver

Would it be possible to implement such a feature?

Hope this is enough info. I'd be glad to elaborate more if required.

Cheers

@harrysolovay
Copy link

I'd also very much like to see this feature come to life if possible. I currently use typescript-language-server in Neovim. It's a great experience––very snappy! Unfortunately, the lack of workspace diagnostics means I must regularly go to a shell and run a tsc process to ensure changes haven't broken code in other files. Project-wide diagnostic capabilities would be wonderful. Thanks for considering!

@yassinebridi
Copy link

I have never used or thought of this, this would be pretty useful.

@rchl
Copy link
Member

rchl commented Sep 6, 2021

coc-tsserver appears to implement something like that at https://github.com/neoclide/coc-tsserver/blob/master/src/server/features/watchBuild.ts. It looks like it just compiles the whole project using tsc on any change and displays the errors/warnings in certain way. The implementation is more on the client/editor side though. If this server would implement something like that, it would have to expose the errors/warnings through a normal diagnostics and then make sure that there are no duplicates and possibly handle other corner cases.

@harrysolovay
Copy link

@rchl interesting. I'm not well versed enough to make a statement as to where workspace-wide diagnostic capabilities belong, although my intuition tells me it would belong in the LS itself. That being said, I understand where you're coming from. It doesn't seem like the implementation in coc-tsserver is ideal. Thank you for looking into it!

@agreco
Copy link
Author

agreco commented Sep 10, 2021

coc-tsserver appears to implement something like that at https://github.com/neoclide/coc-tsserver/blob/master/src/server/features/watchBuild.ts. It looks like it just compiles the whole project using tsc on any change and displays the errors/warnings in certain way. The implementation is more on the client/editor side though.

@rchl That's what prompted me to bring this discussion up. Additionally IntelliJ/Webstorm is able to compile a project and display a Typescript error panel that essentially is similar to how coc-tsserver's diagnostics compiles projects and renders its results in the vim/neovim quickfix window.

@rchl
Copy link
Member

rchl commented Sep 12, 2021

The thing is that both of them do it more on the client/editor side which is more or less a requirement because the LSP spec doesn't really provide a good way to implement that. On the LSP side there are diagnostics but putting build results in the same bag doesn't quite make sense.

So I don't think this feature can really be done in this language server. Or even if can be done, it wouldn't work that well and is not really the correct way to do it IMO.

@agreco
Copy link
Author

agreco commented Sep 13, 2021

@rchl Do you think this feature request should be passed back to the sublime/LSP side of things, or another package is required to implement some sort of hybrid with the typescript-language-server to render the build results?

@rchl
Copy link
Member

rchl commented Sep 13, 2021

@agreco yes, at this point I think that that would be a correct place. Sorry for sending you back and forth. :)

@DonnieWest
Copy link
Collaborator

DonnieWest commented Sep 13, 2021

In the Neovim world, I've seen a lot of people using projects like https://github.com/iamcco/diagnostic-languageserver to implement linters via the LSP spec. It's not something I personally use, but for those replacing coc-tsserver it might be what they need

I'm not seeing pre-made configs though for tsc, which might not bode well

@rchl
Copy link
Member

rchl commented Sep 13, 2021

I'm using it for shellcheck for example but in using it for this use case, the immediate issue I see is that it would try to run compilation on each change to the document while a feature like this one should rather run on save.

@danielnehrig
Copy link

i can recommend neomake for diagnostics across a project / workspace
see attached video

screen1_recording_2021-09-20_21-49-15.mp4

@rchl
Copy link
Member

rchl commented Sep 22, 2021

@danielnehrig the video file seems to be corrupt.

@danielnehrig
Copy link

@rchl i can play it back on all of my devices (mac and linux)

@rchl
Copy link
Member

rchl commented Sep 24, 2021

Didn't work in firefox but I can watch it in Chrome.

It seems like that method works through manual invocation of a command. So in Sublime Text, for example, that could be similarly achieved through a build system.

@rchl
Copy link
Member

rchl commented Nov 3, 2021

As discussed above, a feature like that fits better on the client/editor side so I'll close this issue.

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

6 participants