Code Monkey home page Code Monkey logo

Comments (4)

valentjn avatar valentjn commented on May 30, 2024

The language client is already responsible to perform the necessary configuration changes, like the README says:

Some commands are handled by LTEX LS, while others must be handled by the language client. This is in contrast to the LSP specification, which recommends that the server handles all commands. However, handling of some commands by the client is necessary as these commands change the client configuration, which the LSP does not allow server-side.

For example, the documentation for _ltex.addToDictionary (the command behind Add '...' to dictionary) says:

_ltex.addToDictionary is executed by the client when it should add words to the dictionary by adding them to ltex.dictionary.

It works like this: First, the language client requests code actions from the server. If there's an unknown word, then a code action with kind quickfix.ltex.addToDictionary will be returned by LTEX LS. That code action contains the command _ltex.addToDictionary and its necessary parameters (as documented). If the user runs the code action, the language client has to implement the command _ltex.addToDictionary and do what LTEX LS expects it to do according to the docs.

In the case of VS Code, the language client vscode-ltex implements these commands, not the editor (VS Code) itself. If the language client you use doesn't implement the commands, then this is a problem of the language client and not of LTEX LS.

There's also the custom request ltex/workspaceSpecificConfiguration, which takes precedence over the configuration returned by workspace/configuration. It allows to implement file-based dictionaries, so that the “normal” configuration (whatever format the editor is using; in the case of VS Code, it's settings.json) doesn't get too cluttered.

from ltex-ls.

Ailrun avatar Ailrun commented on May 30, 2024

Oh I was confused since the documentation mentions ltex.dictionary, which has a link to VSCode specific setting. OK, I will check lsp-ltex side to make this work. Thank you for the answer.

Maybe it's worthwhile to update README to make it less confusing? What do you think?

from ltex-ls.

valentjn avatar valentjn commented on May 30, 2024

the documentation mentions ltex.dictionary, which has a link to VSCode specific setting

Again, I'm not sure what you mean. The documentation of _ltex.addToDictionary links to ltex.dictionary, but the docs of ltex.dictionary don't say anywhere that's a VS-Code-specific setting, because it isn't. Only the parts about multi-scope settings and external files are tagged as client-specific, as clearly marked with the striped line. That's because multi-scope settings and external files are implemented by the language client. Those are “bonus features” of vscode-ltex, if you will.

However, this has to be separated from the fact that _ltex.addToDictionary has to be implemented by the client. If it doesn't, then that command obviously won't work at all. IMO, the README is pretty clear about that.

I'm not sure how to make the available info any clearer. What would your proposal look like?

from ltex-ls.

Ailrun avatar Ailrun commented on May 30, 2024

Oh sorry. It was indeed my misunderstanding. Thank you for your patience on my non-sense. I will close this issue.

from ltex-ls.

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.