Skip to content

Enable LanguageClient Tracing Option #4902

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

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,25 +287,22 @@ your logs for any sensitive information you would not like to share online!**

#### Provide Language Server Protocol payload logs

The extension works mostly from exchanging messages with [PowerShell Editor Services][].
A lot of the features of the PowerShell extension actually come from Visual Studio Code directly interacting with the [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) process via a [Language Server Protocol client](https://code.visualstudio.com/api/language-extensions/language-server-extension-guide#logging-support-for-language-server).
In some cases, getting to the bottom of a bug will require looking at the payloads of
these messages. To do this:
these messages. To enable viewing these messages:

* Add the following setting to your settings file:

```json
"powershell editor services.trace.server":"verbose"
"powershell.trace.server":"verbose"
```

> While VS Code will not recognize and highlight it, it is a valid option and enables
> tracer logs on the server.

* Restart VS Code and reproduce the issue.

* Go into the "Output" panel (<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>U</kbd> or
<kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>U</kbd>).

* In the drop down on the right, select "PowerShell Editor Services".
* In the drop down on the right, select "PowerShell Editor Services Client".

* Copy the entire contents of the Output panel and paste it into the GitHub issue in the
browser. At this point, you may delete the setting if you want.
Expand Down
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,16 @@
"type": "boolean",
"default": false,
"markdownDescription": "Show buttons in the editor's title bar for moving the terminals pane (with the PowerShell Extension Terminal) around."
},
"powershell.trace.server": {
"type": "string",
"enum": [
"off",
"messages",
"verbose"
],
"default": "off",
"description": "Traces the communication between VS Code and the PowerShell Editor Services language server. **This setting is only meant for extension developers!**"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ export class SessionManager implements Middleware {
middleware: this,
};

const languageClient = new LanguageClient("PowerShell Editor Services", connectFunc, clientOptions);
const languageClient = new LanguageClient("powershell", "PowerShell Editor Services Client", connectFunc, clientOptions);

// This enables handling Semantic Highlighting messages in PowerShell Editor Services
// TODO: We should only turn this on in preview.
Expand Down