valentjn / ltex-ls

LTeX Language Server: LSP language server for LanguageTool :mag::heavy_check_mark: with support for LaTeX :mortar_board:, Markdown :pencil:, and others
https://valentjn.github.io/ltex
Mozilla Public License 2.0
716 stars 33 forks source link

"Unknown command '_ltex.*', ignoring" #282

Open rynoV opened 7 months ago

rynoV commented 7 months ago

Thanks for making this tool!

I'm trying to setup ltex-ls 15.2.0 in emacs with eglot, and it seems to be failing on commands that use external config files: disableRules, addToDictionary, hideFalsePositives. Apart from that it seems to be working, and replacement commands work as expected.

Is this expected? If so, do you have any pointers on setting these things up outside of vscode?

rynoV commented 7 months ago

I tried adding file paths for the various external files but this doesn't seem to do the trick. My settings look like this:

{
  "ltex-ls": {
    "language": "en-CA",
    "dictionary": {
      "en-US": [
        ":~/scripts/ltex-ls-15.2.0/dictionary"
      ],
      "en-CA": [
        ":~/scripts/ltex-ls-15.2.0/dictionary"
      ]
    },
    "disabledRules": {
      "en-US": [
        ":~/scripts/ltex-ls-15.2.0/disabledRules"
      ],
      "en-CA": [
        ":~/scripts/ltex-ls-15.2.0/disabledRules"
      ]
    },
    "enabledRules": {
      "en-US": [
        ":~/scripts/ltex-ls-15.2.0/enabledRules"
      ],
      "en-CA": [
        ":~/scripts/ltex-ls-15.2.0/enabledRules"
      ]
    },
    "hiddenFalsePositives": {
      "en-US": [
        ":~/scripts/ltex-ls-15.2.0/hiddenFalsePositives"
      ],
      "en-CA": [
        ":~/scripts/ltex-ls-15.2.0/hiddenFalsePositives"
      ]
    }
  }
}
weakish commented 5 months ago

duplicate of #157

External files are located on the machine of the client, and managed by the client. When a client reads a config like [":~/scripts/ltex-ls-15.2.0/dictionary"], it read the file and send the word list to ltex-ls. ltex-ls itself does not understand the special :/path/string syntax and does not read external files on the client side. I myself find that it will be easier to understand this design if I image that ltex-ls is running on a remote machine and does not have access to the dictionary file at the local machine.