Skip to content
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

Consider setting suppress_stderr to v:true by default #213

Open
ainar-g opened this issue Sep 7, 2019 · 4 comments
Open

Consider setting suppress_stderr to v:true by default #213

ainar-g opened this issue Sep 7, 2019 · 4 comments

Comments

@ainar-g
Copy link
Contributor

ainar-g commented Sep 7, 2019

Some servers seem to log a lot of unnecessary stuff to stderr, most of it not needed by the users. Setting it to v:true by default in a future release it at least worth considering, in my opinion.

@ainar-g ainar-g mentioned this issue Oct 16, 2019
@natebosch
Copy link
Owner

Hiding the output makes sense for the servers that emit a bunch of noise. It wouldn't make sense for the servers which use stderr to report real problems and then stop working. It's less confusing to see that an error happened than to stop getting language features with no indication of why.

The linked python server issue is a good example. These look like serious errors and not a choice to emit logging to stderr. The fact that (some?) features continue to work after the errors may not be a solid signal that it is OK to ignore.

I do think it probably makes sense to deprecate the global config in favor of per-server config. I'm hoping that we might move in a direction where more authors publish plugins like vim-lsc-dart to centralize language config, and then those authors would be in the best position to know how to treat stderr. We still need to pick a default in that case...

Are there particular servers that you are interested in which do log noise to stderr? Do you think if we made it possible to configure this on a per-server basis you'd want to publish a plugin that does so?

@ainar-g
Copy link
Contributor Author

ainar-g commented Oct 17, 2019

I think the per-language configs we have now are mostly enough. The server I use the most is gopls, and in fact both this issue and my comment on #180 come from issues I've had with gopls and vim-lsc. I guess I could publish something like vim-lsc-gopls, but don't quote me on that just yet :-) I have already added the recommended settings to the gopls documentation.

@sam-mccall
Copy link

FWIW clangd sends its logs to stderr, and most clients we deal with redirect this to a file or capture it to an internal buffer. (I thought this was fairly standard for language servers, but might be wrong)

LSP defines ways for servers to send messages that should be user-visible, but writing to stderr isn't one of them.

My favorite behavior would be:

  • redirect stderr to a file in vim's session temp directory, so it gets cleaned up on exit
  • provide a command to open that file
  • if the language server exits unexpectedly, print a message like "foo died. Run :LSLog foo to see its stderr output"
  • if the language server writes error messages to stderr but doesn't call showMessage and doesn't exit, then they won't be shown unless the user opens the log. (No way in general to distinguish them from log messages)

@natebosch
Copy link
Owner

That sounds like a really nice behavior. I'll take a shot at implementing that.

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

3 participants