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

Support using a seperate output channel for trace messages #444

Merged
merged 4 commits into from Jan 9, 2019

Conversation

Projects
None yet
2 participants
@DJMcNab
Copy link
Contributor

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

This comment has been minimized.

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

@@ -2367,6 +2368,8 @@ export abstract class BaseLanguageClient {
private _initializeResult: InitializeResult | undefined;
private _outputChannel: OutputChannel | undefined;
private _disposeOutputChannel: boolean;
private _traceOutputChannel: OutputChannel | undefined;
private _disposeTraceOutputChannel: boolean;

This comment has been minimized.

@dbaeumer

dbaeumer Jan 8, 2019

Member

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.

DJMcNab added some commits Jan 8, 2019

@dbaeumer dbaeumer merged commit eba5131 into Microsoft:master Jan 9, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla All CLA requirements met.
Details

@DJMcNab DJMcNab deleted the DJMcNab:trace_output_channel branch Feb 10, 2019

bors bot added a commit to rust-analyzer/rust-analyzer that referenced this pull request Feb 10, 2019

Merge #776
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