Git Product home page Git Product logo

Comments (10)

clason avatar clason commented on September 2, 2024 1

Well, if nothing else, texlab and vim-lsp are excellent stress tests for each other 😁

from texlab.

pfoerster avatar pfoerster commented on September 2, 2024

Building after save is now disabled by default. We never intended it to be enabled by default. One can opt-in/opt-out using the workspace/configuration request. Unfortunately, vim-lsp does not seem to support this request (yet). A list of all settings can be found on our website.

from texlab.

clason avatar clason commented on September 2, 2024

Thank you! I'll be happy to open an issue about that on vim-lsp.

(It seems that the promise of LSP interoperability quickly turns to dust once you leave the beaten path between VS Code and TypeScript servers...)

from texlab.

clason avatar clason commented on September 2, 2024

Hmm... vim-lsp claims to support configuration: https://github.com/prabirshrestha/vim-lsp/blob/d542bbc5a3b0b2d78552a11f4edfee1c55fc3796/doc/vim-lsp.txt#L552

Is that not enough, or is that simply not working (properly)?

from texlab.

pfoerster avatar pfoerster commented on September 2, 2024

Hmm, I think they support the initialziationOptions field of the InitializeParams interface (see https://microsoft.github.io/language-server-protocol/specification#initialize). However, this is not the same as the workspace/configuration request. vim-lsp responds with a "method not found" error if TexLab sends this request (which it does not do anymore if the client does not support it).
The log from issue #22 shows that vim-lsp does not support this request:

Thu 27 Jun 2019 02:40:55 PM CEST:["--->", 5, "texlab", {"method": "textDocument/formatting", "on_notification": "---funcref---", "sync": 0, "params": {"options": {"insertSpaces": true, "tabSize": 8}, "textDocument": {"uri": "file:///home/clason/Dropbox/tex/NonsmoothBook/nonsmooth.bib"}}}]
Thu 27 Jun 2019 02:40:55 PM CEST:["<---", 5, {"method": "workspace/configuration", "jsonrpc": "2.0", "id": 1, "params": {"items": [{"section": "bibtex.formatting"}]}}]
Thu 27 Jun 2019 02:40:55 PM CEST:["--->", 5, "texlab", {"id": 1, "error": {"code": -32601, "message": "Method not found"}}]
Thu 27 Jun 2019 02:40:55 PM CEST:["<---(stderr)", 5, "texlab", ["TRACE - Received message:", "{\"id\": 2, \"jsonrpc\": \"2.0\", \"method\": \"textDocument/formatting\", \"params\": {\"options\": {\"insertSpaces\": true, \"tabSize\": 8}, \"textDocument\": {\"uri\": \"file:///home/clason/Dropbox/tex/NonsmoothBook/nonsmooth.bib\"}}}", "TRACE - Sent message:", "Content-Length: 112\r", "\r", "{\"jsonrpc\":\"2.0\",\"method\":\"workspace/configuration\",\"params\":{\"items\":[{\"section\":\"bibtex.formatting\"}]},\"id\":1}", ""]]
Thu 27 Jun 2019 02:40:55 PM CEST:["invalid response id. ignoring message", {"id": null, "jsonrpc": "2.0", "error": {"code": -32700, "message": "Could not parse the input"}}]
Thu 27 Jun 2019 02:40:55 PM CEST:["<---(stderr)", 5, "texlab", ["TRACE - Received message:", "{\"id\": 1, \"jsonrpc\": \"2.0\", \"error\": {\"code\": -32601, \"message\": \"Method not found\"}}", "TRACE - Sent message:", "Content-Length: 89\r", "\r", "{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32700,\"message\":\"Could not parse the input\"},\"id\":null}", ""]]

from texlab.

clason avatar clason commented on September 2, 2024

Thanks, reported up(down?)stream: prabirshrestha/vim-lsp#426

from texlab.

clason avatar clason commented on September 2, 2024

Is there some standardized way for client and server to announce the version of the protocol they are supporting? Looking at the changelog, the specification gets so much churn, I wonder how LSP is actually supposed to work in practice...

from texlab.

pfoerster avatar pfoerster commented on September 2, 2024

Both client and server send a list of capabilities they support when initializing the connection.
See the ClientCapabilities and ServerCapabilities interfaces for more information (https://microsoft.github.io/language-server-protocol/specification#initialize).

from texlab.

clason avatar clason commented on September 2, 2024

Ah, ok, that makes sense! So this was not working because vim-lsp (still) does not send properly formatted json 2.0 messages.

from texlab.

pfoerster avatar pfoerster commented on September 2, 2024

Yeah, we falsely assumed that all clients support the workspace/configuration request.
After requesting the configuration, vim-lsp does not send a properly formatted JSONRPC-2.0 message, which in turn crashes our server.

from texlab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.