Skip to content
Branch: master
Find file History
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
.vscode Remove all tslint recommendation per #110 Nov 26, 2018
client Remove use stricts from ts files May 31, 2019
scripts
server Remove use stricts from ts files May 31, 2019
.gitignore cp -r lsp-sample lsp-log-streaming-sample Sep 5, 2018
.vscodeignore cp -r lsp-sample lsp-log-streaming-sample Sep 5, 2018
README.md Readme: Syntax highlighting to support comments Jun 17, 2019
demo.gif Update lsp-log-streaming-sample Oct 24, 2018
package-lock.json Use latest `vscode` or `"@types/vscode"` May 10, 2019
package.json Bump tslint versions May 10, 2019
tsconfig.base.json Convert indentation to tabs for all JSON files Oct 8, 2018
tslint.json Update all lsp samples Oct 24, 2018

README.md

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
You can’t perform that action at this time.