Files
vscode-extension-samples/lsp-log-streaming-sample
dependabot[bot] 3c2d67e305 Bump ws from 6.2.1 to 6.2.2 in /lsp-log-streaming-sample/client
Bumps [ws](https://github.com/websockets/ws) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/6.2.1...6.2.2)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-22 16:37:12 +00:00
..
2020-05-29 14:20:07 -07:00
2020-05-29 14:13:32 -07:00
2018-10-23 22:25:13 -07:00
2022-02-09 11:44:13 -08:00
2021-02-22 09:58:22 -08:00
2020-05-06 12:14:11 -07:00

LSP Example for Log Streaming

This is a repository adapted from lsp-sample to demonstrate

Demo

demo

Synopsis

  • With vscode-languageclient@5.1.0-next.9, you can specify a JSON log output format with [langId].trace.server as follows:
    "languageServerExample.trace.server": {
      "format": "json", // or "text"
      "verbosity": "verbose" // or "off" | "messages"
    }
    
  • A webview build of the LSP Inspector can be downloaded here: https://marketplace.visualstudio.com/items?itemName=octref.lsp-inspector-webview
  • When using the Webview LSP Inspector, it will open a WebSocket Server taking incoming connection that sends logs following this format.
  • You can stream the JSON log of any Language Server using vscode-languageclient to the LSP Inspector, and it will show a live view of the LSP connection.

Running the Sample

  • Install the LSP Inspector Webview extension
  • Compile and Run this Extension
    • npm install
    • npm run compile
    • F5 to run the extension
  • Add the following setting:
    "languageServerExample.trace.server": {
      "format": "json",
      "verbosity": "verbose"
    },
    
  • Open a txt file so this Language Server gets activated
  • Run command "LSP Inspector: Start LSP Inspector"
  • Run command "Start Stream Logs into languageServerExample.port"
  • As you are typing, doing auto-completion, many messages should show up in the inspector, such as
    • textDocument/didChange
    • textDocument/completion
    • textDocument/publishDiagnostics