Closed fatbadfrog closed 2 months ago
I think i solve this problem. Here are key points (suppose you are using miniconda and kickstart):
return { require("lspconfig").textlsp.setup({ cmd = { "/home/ffw/miniconda3/bin/textlsp" }, (very important, use the textlsp installed by miniconda, not Mason. For me textlsp installed by Mason has some problems.) settings = { textLSP = { analysers = { languagetool = { enabled = false, }, ollama = { enabled = true, check_text = { on_open = false, on_save = true, on_change = false, }, model = "phi3:mini", -- smaller but faster model -- model = "phi3:14b-instruct", -- more accurate max_token = 50, }, gramformer = { -- gramformer dependency needs to be installed manually enabled = false, gpu = false, check_text = { on_open = false, on_save = false, on_change = false, }, }, hf_checker = { enabled = false, gpu = false, quantize = 32, model = "pszemraj/flan-t5-large-grammar-synthesis", min_length = 40, check_text = { on_open = false, on_save = false, on_change = false, }, }, hf_instruction_checker = { enabled = true, gpu = false, quantize = 32, model = "grammarly/coedit-large", min_length = 40, check_text = { on_open = false, on_save = false, on_change = false, }, }, hf_completion = { enabled = true, gpu = false, quantize = 32, model = "bert-base-multilingual-cased", topk = 5, }, }, }, }, }), }
Now everything should be all right. Textlsp analyzer is enabled according to yourself. For me, ollama, hf_instruction_checker and hf_completion is enabled. But I feel hf_instruction_checker is not good.
It is great for providing such excellent module. But when I followed the intructions in README, only languagetool can work correctly in the Neovim. I have installed ollamma manually. It seemed that ollamma and hf_checker can run normally if I tested it under terminal. However, in the neovim, it can not work. I use nvm-lspconfig to set textlsp. When I put the settings provided in the README in require("lspconfig").textlsp.setup({}) , it can not take effect. For example, even I set 'enabled = false' in languagetool section, the languagetool can still lanuch and analyze my latex code. Could you help me solving this problem?
languagetool works in my neovim.
code action also work