Skip to content

Commit 1562dc0

Browse files
committed
Add log verbosity configuration parameter
This change adds a new powershell.developer.editorServicesLogLevel configuration setting so that the user can set their desired level of log output for diagnostic purposes. Resolves PowerShell#77
1 parent 7fe7c9d commit 1562dc0

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

package.json

+5
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@
187187
"default": "../bin/Microsoft.PowerShell.EditorServices.Host.exe",
188188
"description": "Specifies the path to the PowerShell Editor Services host executable."
189189
},
190+
"powershell.developer.editorServicesLogLevel": {
191+
"type": "string",
192+
"default": "Normal",
193+
"description": "Sets the logging verbosity level for the PowerShell Editor Services host executable."
194+
},
190195
"powershell.developer.editorServicesWaitForDebugger": {
191196
"type": "boolean",
192197
"default": false,

src/main.ts

+9
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ export function activate(context: vscode.ExtensionContext): void {
6868
if (settings.developer.editorServicesWaitForDebugger) {
6969
args.push('/waitForDebugger');
7070
}
71+
if (settings.developer.editorServicesLogLevel) {
72+
args.push('/logLevel:' + settings.developer.editorServicesLogLevel)
73+
}
7174

7275
let serverPath = resolveLanguageServerPath(settings);
7376
let serverOptions = {
@@ -95,8 +98,14 @@ export function activate(context: vscode.ExtensionContext): void {
9598
serverOptions,
9699
clientOptions);
97100

101+
languageServerClient.onReady().then(
102+
() => registerFeatures(),
103+
(reason) => vscode.window.showErrorMessage("Could not start language service: " + reason));
104+
98105
languageServerClient.start();
106+
}
99107

108+
function registerFeatures() {
100109
// Register other features
101110
registerExpandAliasCommand(languageServerClient);
102111
registerShowHelpCommand(languageServerClient);

src/settings.ts

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface IScriptAnalysisSettings {
1212

1313
export interface IDeveloperSettings {
1414
editorServicesHostPath?: string;
15+
editorServicesLogLevel?: string;
1516
editorServicesWaitForDebugger?: boolean;
1617
}
1718

@@ -29,6 +30,7 @@ export function load(myPluginId: string): ISettings {
2930

3031
let defaultDeveloperSettings = {
3132
editorServicesHostPath: "../bin/Microsoft.PowerShell.EditorServices.Host.exe",
33+
editorServicesLogLevel: "Normal",
3234
editorServicesWaitForDebugger: false
3335
}
3436

0 commit comments

Comments
 (0)