Comments (2)
Current progress:
For this config running this language server extension: https://github.com/octref/vscode-language-server-template
"mls.trace.server": {
"format": "json",
"verbosity": "messages",
}
Log looks like this:
[LSP - 2:05:03 AM] {"type":"send-request","message":{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":8803,"rootPath":"/Users/pine/Code/work/lsp-inspector/plain","rootUri":"file:///Users/pine/Code/work/lsp-inspector/plain","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"]}},"definition":{"dynamicRegistration":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"codeAction":{"dynamicRegistration":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true},"documentLink":{"dynamicRegistration":true},"typeDefinition":{"dynamicRegistration":true},"implementation":{"dynamicRegistration":true},"colorProvider":{"dynamicRegistration":true}}},"trace":"verbose","workspaceFolders":[{"uri":"file:///Users/pine/Code/work/lsp-inspector/plain","name":"plain"}]}},"timestamp":1529658303181}
Debugger listening on ws://127.0.0.1:6006/9a9de78e-7f22-4fb0-8988-85dcb67f7321
For help see https://nodejs.org/en/docs/inspector
[LSP - 2:05:03 AM] {"type":"receive-response","message":{"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":1,"completionProvider":{"resolveProvider":true}}}},"timestamp":1529658303218}
[LSP - 2:05:03 AM] {"type":"send-notification","message":{"jsonrpc":"2.0","method":"initialized","params":{}},"timestamp":1529658303218}
[LSP - 2:05:03 AM] {"type":"send-notification","message":{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{}}},"timestamp":1529658303218}
[LSP - 2:05:03 AM] {"type":"send-notification","message":{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///Users/pine/Code/work/lsp-inspector/plain/README.md","languageId":"markdown","version":1,"text":"# LSP Inspector\n\n### Running\n\n- `yarn`\n- `yarn serve`\n\n### Demo\n\nhttp://lsp-inspector.surge.sh\n\n- A log file (log from html Language Server) is loaded by default\n- You can collect other logs and load them. For example:\n - Set `css.trace.server: \"verbose\"`\n - Copy everything inside `CSS Language Server` channel into a log file `css.log`\n - Load it from the web app\n- You can try it on a real-world log file, `./logs/vetur.log`. It contains 330k lines of log generated from 10 minutes of usage.\n\nTypeScript"}}},"timestamp":1529658303219}
For output
going to log-folder or going to websocket for streaming, we can do that later.
The motivation behind this format is:
-
The new format does not deviate much from the old one
-
They still line up with others, for example:
[Info - 2:05:03 AM] [Warn - 2:05:03 AM] [Error - 2:05:03 AM] [Trace - 2:05:03 AM] [LSP - 2:05:03 AM]
-
Putting all arguments in the same line makes it much easier for the log parser to consume real-world logs. For example as @egamma reported in #10 and here, the
Debugger Listening...Please See...
message -
As #10 mentioned, vscode-tslint is using
connection.trace
and this mixes up custom language server logs together with built-in request/response/notifications. Splitting out[LSP]
will make it easier to tell them apart.
Later I can update the LSP Inspector to handle this format of log. I suggest that for format: "json"
, we always make the log single line. This way the log parser can safely skip over lines that do not start with [LSP/Info/Warn/Error/Trace]
and not miss anything.
I can make the inspector process Info/Warn/Error/Trace as part of the visualization too. Think that would be helpful.
/cc @dbaeumer
from language-server-protocol-inspector.
https://github.com/Microsoft/language-server-protocol-inspector#log-format
At the end, I decided to decouple the streaming part from the Text/JSON format part. The config currently looks like this:
"mls.trace.server": {
"verbosity": "verbose",
"format": "json"
},
"mls.debug.log": {
"output": "websocket",
"port": 7000
},
For the very simple WebSocket streaming implementation, see octref/vscode-language-server-template@4181af8
This way we don't need to introduce another dependency for WebSocket, and users get more control of the WebSocket connection they want to do.
from language-server-protocol-inspector.
Related Issues (20)
- Add hover text to the message type icons HOT 1
- LSP website hamburger button does not work on inspector page
- Keyboard navigation for messages
- Handle search/filter/highlight in large logs more efficiently
- Continuous push to https://microsoft.github.io/language-server-protocol/inspector/
- Expanding large message crashes page HOT 1
- support for other language servers HOT 1
- Highlight query occurrences in search results
- Add a dedicated way to load Websocket stream from a file
- Initialize response messages from server does not appear in the log (using stream/websocket) HOT 5
- Debug Adapter Protocol support HOT 3
- Log Format in README.md up-to-date? HOT 2
- Specify log file format HOT 1
- LSP Inspector doesn't work HOT 1
- Newlines are ignored when streaming
- Show milliseconds in speech bubbles
- JSON log format not working
- HEADER_LENGTH is not always 21
- Is this project dead HOT 2
- Try it link dead HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from language-server-protocol-inspector.