PyvesB / eclipse-solargraph

:gem: Ruby development tools for Eclipse.
https://marketplace.eclipse.org/content/ruby-solargraph
Eclipse Public License 2.0
30 stars 6 forks source link

[improvement] syntax checking / diagnostics enabled by default #20

Closed pldavid2 closed 2 years ago

pldavid2 commented 2 years ago

Excerpt from @PyvesB comment here https://github.com/PyvesB/eclipse-solargraph/issues/19#issuecomment-1038188992

Solargraph gem code shows diagnostics are disabled by default: https://github.com/castwide/solargraph/blob/2ea80efdb5f02744b74f5af98c67174a55ab7c41/lib/solargraph/language_server/host.rb#L632

It seems that these should be enabled without users having to worry about turning them on explicitly. Adding a config override in the plugin seems like a good idea, if someone really wants to disable them, they can always create a Solargraph configuration file in their workspace and specify reporters: [].

PyvesB commented 2 years ago

Thanks for opening a dedicated issue for this @pldavid2!

Would you like to contribute the fix by any chance? According to my experimentations from earlier, I believe that the only thing that's required is to override the getInitializationOptions method in the SolargraphStreamConnectionProvider class, and simply return a map containing a key "diagnostics" with a value of true. No worries if you're not up for that. 😉

pldavid2 commented 2 years ago

Oh my knowledge of solar and eclipse plugins is very limited :worried: If you don't mind i prefer to wait you have some time to check it, but don't hurry at all :wink:

PyvesB commented 2 years ago

Done! Will release as part of version 1.0.0 with some other improvements. :)

pldavid2 commented 2 years ago

Great work, thank you! This is a great addition! :clap: :clap: :clap:

PS: For the record, I notice that sometimes diagnostics seems to hang. I mean I make a change in the code and diagnostics on the file are not updated anymore, although I set cache false on rubocop file. But I don't think it's a problem with the plugin but from solargraph, as checking the eclipse log I'm not seeing any log line there or exception thrown.

PyvesB commented 2 years ago

But I don't think it's a problem with the plugin but from solargraph

You're probably right on this one. If you've got a precise set of steps to reproduce, feel free to share, I can take a closer look.