neovim / nvim-lspconfig

Quickstart configs for Nvim LSP
Apache License 2.0
9.98k stars 2.04k forks source link

koka language server doesn't attach #3212

Closed MangoIV closed 2 weeks ago

MangoIV commented 2 weeks ago

Description

For some reason, the koka language server doesn't attach, I don't know if there's something wrong with the configuration (there definitely is, but that should become obvious only after it attaches) but it just never attaches. :set ft? shows koka.

Does anybody see what the issue there could be? Thanks in advance!

glepnir commented 2 weeks ago

i think the root dir detect not correct

MangoIV commented 2 weeks ago

can I just overwrite it with

lspconfig.koka.setup({
    cmd = { "koka", "--language-server", "--lsstdio" },
        root_dir = function(fname)
            return require'lspconfig.util'.find_git_ancestor(fname)
        end,
})

in my init.lua?

glepnir commented 2 weeks ago

yup.

glepnir commented 2 weeks ago

I think you can create a pr for correct root detect of koka server.

MangoIV commented 2 weeks ago

I should.

MangoIV commented 2 weeks ago

@glepnir that didn't fix the issue, it still says 0 clients attached to this buffer. Is there anything else I have to do besides setting

vim.filetype.add({
  extension = { 
    kk = "koka",
  }, 
})

in my init.lua?

glepnir commented 2 weeks ago

if set ft? dont't return koka then you need these codes.

MangoIV commented 2 weeks ago

I have set this. :set ft? returns koka. It still doesn't attach.

glepnir commented 2 weeks ago

then your project has .git folder ?

MangoIV commented 2 weeks ago

the issue was that the plugin set the filetype to kk when it should have been koka