neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.49k stars 960 forks source link

Support language level settings like vscode #1800

Closed ayroblu closed 2 years ago

ayroblu commented 4 years ago

Is your feature request related to a problem? Please describe. Vsocde allows for language level configuration like:

{
  "[python]": {
    "editor.codeActionsOnSave": {
      "source.organizeImports": false
    }
  }
}

This is not possible in coc-settings.json (well the linter complains at least)

Describe the solution you'd like Support vscode like language level configuration

Describe alternatives you've considered Manually changing it by language

Additional context

chemzqm commented 4 years ago

PR welcome.

pedromss commented 4 years ago

I was thinking on picking this up. I've seen where the config gets loaded and adding a language level settings doesn't break that loading process. Example (suggest.autoTrigger is overriden for golang):

{
    "suggest.autoTrigger": "always",
        "golang": {
          "suggest.autoTrigger": "never",
          "command": "gopls",
          "rootPatterns": [
            "go.mod",
            ".vim/",
            ".git/",
            ".hg/"
          ],
          "filetypes": [
            "go"
          ]
        }
}

Now I guess I'll check where the config actually takes effect and load different configs depending on the file type (assuming the filetype overrides the root configs)

hanleylee commented 3 years ago

I want this feature, anyone make a PR?