huggingface / llm.nvim

LLM powered development for Neovim
Apache License 2.0
788 stars 50 forks source link

lsp server not started properly #65

Open teto opened 1 year ago

teto commented 1 year ago

I hit the following error: https://github.com/huggingface/llm.nvim/blob/7657d65adac2901b4712f73d81d5827d7c0494f4/lua/llm/language_server.lua#L116 1/ I think the message could be improved, aka "no LSP server enabled for this buffer" 2/ LspInfo gives me:

 Client: llm-ls (id: 1, bufnr: [1, 6])
    filetypes:       
    autostart:       false
    root directory:  /home/teto/nixpkgs
    cmd:             /nix/store/ngay8qxw0bnirwsnjsk84bdcsbd2q9kc-llm-ls-0.4.0/bin/llm-ls

which means the config here https://github.com/huggingface/llm.nvim/blob/7657d65adac2901b4712f73d81d5827d7c0494f4/lua/llm/language_server.lua#L189 is probably not enough (it should autostart maybe ?). Turns out :LspStart llm-ls seems to start it (I see "codellama currently loading", I hope it's not too long took 1mn and I could accept the proposition with the binding in accept_keymap).

Interested in adding llm-ls to https://github.com/neovim/nvim-lspconfig ? ping me if you open a PR and I can review it.

teto commented 1 year ago

also the plugin spams Requesting completion for a detached buffer, check enable_suggestions_on_files' value notifications which is not a good design IMO (aka it does not scale if every plugin does the same). I believe users should go through checkhealth / :LspInfo in case it doesn't work, like for other servers.

McPatate commented 1 year ago

Interested in adding llm-ls to https://github.com/neovim/nvim-lspconfig ?

Why not though not a priority for me atm. Thanks for offering a review.

also the plugin spams

Yes, I'll remove that log as it doesn't add much value. Manual :checkhealth seems like the way to go.