Skip to content

Support using a seperate output channel for trace messages#444

Merged
dbaeumer merged 4 commits intomicrosoft:masterfrom
DJMcNab:trace_output_channel
Jan 9, 2019
Merged

Support using a seperate output channel for trace messages#444
dbaeumer merged 4 commits intomicrosoft:masterfrom
DJMcNab:trace_output_channel

Conversation

@DJMcNab
Copy link
Contributor

@DJMcNab DJMcNab commented Dec 26, 2018

This allows setting traceOutputChannelName in the LanguageClientOptions to use a different output channel. Otherwise, this falls back onto the default output channel. traceOutputChannel can 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 npm to 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.

@dbaeumer
Copy link
Member

dbaeumer commented Jan 7, 2019

@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 dbaeumer self-assigned this Jan 7, 2019
private _outputChannel: OutputChannel | undefined;
private _disposeOutputChannel: boolean;
private _traceOutputChannel: OutputChannel | undefined;
private _disposeTraceOutputChannel: boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dbaeumer dbaeumer merged commit eba5131 into microsoft:master Jan 9, 2019
@DJMcNab DJMcNab deleted the trace_output_channel branch February 10, 2019 10:07
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>
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

Successfully merging this pull request may close these issues.

2 participants