mattn / efm-langserver

General purpose Language Server
MIT License
1.32k stars 59 forks source link

Language with .(dot) in the name for neovim lsp #252

Closed budimanjojo closed 11 months ago

budimanjojo commented 12 months ago

Hi, thanks for this awesome tool!

I don't think I can use something like this for my neovim with lspconfig setup:

require "lspconfig".efm.setup {
    init_options = {documentFormatting = true},
    settings = {
        languages = {
            yaml.ansible = {
                {lintCommand = "ansible-lint", lintStdin = true}
            }
        }
    }
}

The reason is because ansible-language-server requires the filetype to be ansible.yaml to work and the plugin pearofducks/ansible-vim will change the filetype to be ansible.yaml when it detects the file is ansible yaml file.

milanglacier commented 11 months ago

you can configure this in the neovim side, see the nvim-lspconfig specs of how to use get_language_id options. An example is the ltex-ls configuration.

budimanjojo commented 11 months ago

it works! thanks!