Closed norru closed 5 years ago
@mickaelistria
I was just looking how to get compiler logs to be written in context of a different issue. A quick look at the VS Code sources reveals that the option rust-client.logToFile
simply writes the std-err output of the RLS to a file. Error messages that are enabled via the environment variable RUST_LOG
are written to std-err.
In LSP4E std-err outputs are written to the language server log. This mixes both regular LSP JSON messages with std-err outputs. For me personally, this is not a big issue, if you care for such separation, please open an issue on the LSP4E project.
stderr in the LSP logs is fine.
Although, if I understand it, the side problem here is that RUST_LOG has to be in the env of Eclipse itself (at least on Unix) and that means either setting the RUST_LOG variable for the entire xsession (which requires a restart of the session to update), starting the IDE from a command line, or creating a separate startup script to be executed from the desktop GUI. Neither of these options is nice - given that the reason for using an IDE is to have an Integrated environment.
Said that, the suggestion is acceptable as a workaround for troubleshooting - just not very user friendly.
Yes, there is no configuration to set environment variables for the RLS, they are just inherited from the parent process (which is Eclipse). This could be added in the future, I don't think it is very hard to do.
Given that the use-case (debugging Corrosion/RLS) is for advanced users and that setting the environment variable to run Eclipse IDE is trivial, I don't think this deserves a specific development. What would be good instead could be to document the various tricks to debug (logging LS messqges with LSP4E, debug RLS with the env variable, check Eclipse IDE logs...)
-- Mickael Istria Eclipse IDE https://www.eclipse.org/downloads/eclipse-packages/ developer, for Red Hat Developers https://developers.redhat.com/
I agree, as long as all these tricks are documented, it would work for the power users. If demand increases from the community, then the tricks could make their way into features.
@norru would you be interesting in adding such documentation?
@mickaelistria kind of maxed out at the moment. I'll chuck into my todo. I'd be happy to have someone else barge in.
What did you have in mind? A .md file in the repo? A blog post?
Preferably doc inside the repo.
-- Mickael Istria Eclipse IDE https://www.eclipse.org/downloads/eclipse-packages/ developer, for Red Hat Developers https://developers.redhat.com/
eclipse/corrosion#182
@mickaelistria https://github.com/itadinanta/corrosion/blob/feature/troubleshooting_guide/documentation/Troubleshooting.md
It's a draft, very WIP, will send a pull request as soon as it's in a readable state.
In a very non-surprising twist of events this is only supported in VSC as it requires a setting to be sent via a LSP client.
https://github.com/rust-lang-nursery/rls/blob/master/debugging.md
As far as I can understand, this is not the same option that we have now (which logs the LSP4E messages to file).