-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Test: LSP Inspector JSON log output and streaming #57310
Comments
Seems to work when I set "json.trace.server": {
"verbosity": "verbose",
"format": "json"
} The warning in the settings editor is expected according to Dirk. |
@octref I would appreciate if you could take a bit more time to make it possible/easier for a tester to test the second part (LSP inspector). Pointing to commits is not ideal, how would a real extension author discover how to do this? At the minimum I suggest to provide a sample in our |
The version to use should simply be |
I couldn't get the streaming to work. I added the code and the following setting but in the extension I always got that no socket is open.
I would highly recommend to consider https://github.com/octref/vscode-lsp-inspector/issues/1 since a socket transport looks very complicated to set up. |
The referenced commit does not work for me. It first complained about the connection not being open and after working around that it now fails parsing JSON in the webview. Not sure what schema it would expect. https://github.com/octref/vscode-lsp-inspector/issues/1 sounds like a good idea. |
@bpasero Thanks for the feedback. I should have provided more detailed instructions and a sample. Also I shouldn't test "changing your code to add WebSocket support" without writing documentation first. However, one issue is this page (https://code.visualstudio.com/docs/extensions/example-language-server) is already a 5000 words essay. I really want to avoid adding anything too specific to it, but meanwhile our extensibility doc is already a kitchen-sink and I want to avoid making it messier. I'll open another issue to suggest improving organization of our extensibility doc. It seems you are all able to test the JSON output part, so here is an updated description for testing the LSP Inspector: Preparation
Streaming
Check that
The Commits on branch
|
@octref this is very cool, I verified it works on macOS. One question: wouldn't it make sense that the LSP library is providing this functionality out of the box instead of asking each extension to create and setup a websocket connection? I wonder if you need an extra library for this or if you could not just use node.js directly (to prevent the extra dependency)? |
@bpasero There is no native WebSocket object in Node. However the
If we do end up adding WebSocket support built-in for the LS library, |
Testing microsoft/language-server-protocol-inspector#8 and microsoft/language-server-protocol-inspector#5.
Complexity: 3
This PR comment explains the high level change: microsoft/vscode-languageserver-node#366 (comment)
JSON Log output: Language Servers that use https://github.com/Microsoft/vscode-languageserver-node have the ability to use
[langId].trace.server
option to direct logs to an Output Channel, see: https://code.visualstudio.com/docs/extensions/example-language-server#_logging-support-for-language-serverIn the past you have the setting
[langId].trace.server: "off" | "message" | "verbose"
. Now the format is:Test JSON log:
next
version ofvscode-languageclient
andvscode-languageserver
vscode-languageserver-node
[langId].trace.server
options and make sure they still work.text
output andjson
options work as you would expect.Test Streaming:
Start LSP Inspector
, it would open the LSP Inspector in a webview in VS Code. The LSP Inspector starts a websocket server listening to incoming connections that could send in the logs.vscode-languageserver-node
, to redirect the logs throughoutputChannel
to the LSP Inspector UI through websocket connection. You can follow the example here: https://github.com/octref/vscode-language-server-template/pull/1/filesThe text was updated successfully, but these errors were encountered: