Skip to content

Commit ac2f9c3

Browse files
committed
Revert extra config settings for dynamic log configuration for now
1 parent d1a66de commit ac2f9c3

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

package.json

+1-7
Original file line numberDiff line numberDiff line change
@@ -953,11 +953,6 @@
953953
"default": [],
954954
"markdownDescription": "An array of strings that enable experimental features in the PowerShell extension. **No flags are currently available!**"
955955
},
956-
"powershell.developer.traceLsp": {
957-
"type": "boolean",
958-
"default": false,
959-
"markdownDescription": "Traces the LSP communication between VS Code and the PowerShell Editor Services [LSP Server](https://microsoft.github.io/language-server-protocol/). The output will be logged and also visible in the Output pane, where the verbosity is configurable. **For extension developers and issue troubleshooting only!**"
960-
},
961956
"powershell.developer.traceDap": {
962957
"type": "boolean",
963958
"default": false,
@@ -971,8 +966,7 @@
971966
"verbose"
972967
],
973968
"default": "off",
974-
"markdownDescription": "Traces the communication between VS Code and the PowerShell Editor Services [LSP Server](https://microsoft.github.io/language-server-protocol/). The output will be logged and also visible in the Output pane, where the verbosity is configurable. **For extension developers and issue troubleshooting only!**",
975-
"markdownDeprecationMessage": "Please use the `powershell.developer.traceLsp` setting instead and control verbosity via the Output Window settings."
969+
"markdownDescription": "Traces the communication between VS Code and the PowerShell Editor Services [LSP Server](https://microsoft.github.io/language-server-protocol/). The output will be logged and also visible in the Output pane, where the verbosity is configurable. **For extension developers and issue troubleshooting only!**"
976970
},
977971
"powershell.developer.waitForSessionFileTimeoutSeconds": {
978972
"type": "number",

src/logging.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,13 @@ export class Logger implements ILogger {
138138
* HACK: This is for legacy compatability and can be removed when https://github.com/microsoft/vscode-languageserver-node/issues/1116 is merged and replaced with a normal LogOutputChannel. We don't use a middleware here because any direct logging calls like client.warn() and server-initiated messages would not be captured by middleware.
139139
*/
140140
export class LanguageClientOutputChannelAdapter implements LogOutputChannel {
141-
private channel: LogOutputChannel;
141+
private _channel: LogOutputChannel | undefined;
142+
private get channel(): LogOutputChannel {
143+
if (!this._channel) {
144+
this._channel = window.createOutputChannel(this.channelName, {log: true});
145+
}
146+
return this._channel;
147+
}
142148

143149
/**
144150
* Creates an instance of the logging class.
@@ -147,10 +153,9 @@ export class LanguageClientOutputChannelAdapter implements LogOutputChannel {
147153
* @param parser - A function that parses a log message and returns a tuple containing the parsed message and its log level, or undefined if the log should be filtered.
148154
*/
149155
constructor(
150-
channelName: string,
156+
private channelName: string,
151157
private parser: (message: string) => [string, LogLevel] | undefined = LanguageClientOutputChannelAdapter.omnisharpLspParser.bind(this)
152158
) {
153-
this.channel = window.createOutputChannel(channelName, {log: true});
154159
}
155160

156161
public appendLine(message: string): void {
@@ -198,7 +203,8 @@ export class LanguageClientOutputChannelAdapter implements LogOutputChannel {
198203

199204
// #region Passthru Implementation
200205
public get name(): string {
201-
return this.channel.name;
206+
// prevents the window from being created unless we get a log request
207+
return this.channelName;
202208
}
203209
public get logLevel(): LogLevel {
204210
return this.channel.logLevel;

0 commit comments

Comments
 (0)