barreiroleo / ltex_extra.nvim

Provides external LTeX file handling (off-spec lsp) and other functions.
GNU General Public License v3.0
142 stars 15 forks source link

fix: wrong root_dir used #44

Closed nawordar closed 8 months ago

nawordar commented 1 year ago

I don't know how I could test it so badly, but my previous PR actually never worked. Instead of taking a resolved value of client.config.root_dir, I was using the one from server_opts, which was a function, not a string.

barreiroleo commented 1 year ago

Hi @nawordar, thanks for the PR

Looks like all those injections of root dir ends up on the path function. Probably if you define a filesystem state variable for root_dir, the LSP commands can notify of root changes and avoid the propagation of the root dir argument.

I'm not sure if this is worth it, each time that I see the filesystem module my eyes suffer.

nawordar commented 1 year ago

There can be a situation where there is more than one ltex-ls client running, each one with different root_dir. Therefore, I don't think the solution with state variable would work. I could move the catch_ltex function to a separate module (to avoid recursive imports) and call it from the path function. What do you think?

barreiroleo commented 8 months ago

Sorry for the long delay, I was very far from this repository. I think this is not worth it, I really need to rewrite this crap. I really appreciate your PR, thank you very much.