Support using a seperate output channel for trace messages#444
Merged
dbaeumer merged 4 commits intomicrosoft:masterfrom Jan 9, 2019
Merged
Support using a seperate output channel for trace messages#444dbaeumer merged 4 commits intomicrosoft:masterfrom
dbaeumer merged 4 commits intomicrosoft:masterfrom
Conversation
Member
|
@DJMcNab thanks for the PR. I would like to request one change. Instead of having both a name and a channel we should support having a channel only. The reason why we have this for the normal output channel is API compatibility. In a first version you could only specify a name and not a concrete channel. |
dbaeumer
reviewed
Jan 8, 2019
client/src/client.ts
Outdated
| private _outputChannel: OutputChannel | undefined; | ||
| private _disposeOutputChannel: boolean; | ||
| private _traceOutputChannel: OutputChannel | undefined; | ||
| private _disposeTraceOutputChannel: boolean; |
Member
There was a problem hiding this comment.
I think we don't need this boolean. Since the creator of the client passes in a channel in the constructor the client never owns the channel and therefore never disposes it. The channel should be disposed by the extension itself since it created it.
bors bot
added a commit
to rust-lang/rust-analyzer
that referenced
this pull request
Feb 10, 2019
776: Add support for a seperate output channel for trace messages r=DJMcNab a=DJMcNab See microsoft/vscode-languageserver-node#444 I am just working on testing this now, but I think it should work. Co-authored-by: DJMcNab <36049421+djmcnab@users.noreply.github.com>
matklad
pushed a commit
to matklad/vscode-rust
that referenced
this pull request
Jul 13, 2020
776: Add support for a seperate output channel for trace messages r=DJMcNab a=DJMcNab See microsoft/vscode-languageserver-node#444 I am just working on testing this now, but I think it should work. Co-authored-by: DJMcNab <36049421+djmcnab@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows setting
traceOutputChannelNamein theLanguageClientOptionsto use a different output channel. Otherwise, this falls back onto the default output channel.traceOutputChannelcan also be set directly.Just a note: The current formatting settings are not actually consistently applied on all of the files, so I have been caught out by format on save whilst creating this PR.
TODO: test this - I couldn't get
npmto work properly (it was giving me really obtuse error messages) when I tried to install my local copy of the client into an extension. (@matklad, how did you do it?)TODO: determine if the output channel should be automatically shown. My inclination is to say not, but I'm not sure.