Skip to content

Commit

Permalink
Enable LanguageClient Tracing Option
Browse files Browse the repository at this point in the history
Co-authored-by: Andy Jordan <[email protected]>

📄 Update Docs and instructions

Remove note about it being an unsupported option
  • Loading branch information
JustinGrote committed Jan 25, 2024
1 parent 6d897c8 commit d10e3c7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
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

0 comments on commit d10e3c7

Please sign in to comment.