Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CoC configuration #76

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,33 @@ settings = {
See [examples/nvim/init.lua](https://github.com/mrjosh/helm-ls/blob/master/examples/nvim/init.lua) for an
complete example, which also includes yaml-language-server.

#### Neovim + CoC plugin

Using the [coc.nvim](https://github.com/neoclide/coc.nvim) plugin, you don't need the previous configuration in lua. Coc will handle the configuration instead.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need the previous configuration in lua

Maybe we should restructure the readme to something like:

Neovim config

explain filetypes etc (anything that must be done for both nvim-lspconfig and coc)

nvim-lspconfig

explain setup with nvim-lspconfig

coc

explain setup with coc

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any update on this?


You only need to configure the use of `helm_ls` in the "`langageserver`" section of your `coc-settings.json` file.

Open Neovim and type the command `:CocConfig` to access the configuration file. Find the `langageserver` section, or create one if necessary, and add this configuration:


```json
"languageserver": {
"helm": {
"command": "helm_ls",
"args": ["serve"],
"filetypes": ["yaml", "helm", "helmfile"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not sure about having yaml here.

How did you setup the filetypes helm and helmfile in your config? With towolf/vim-helm?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes right.

Maybe I can remove yaml from the list. I will do it today.

"rootPatterns": ["Chart.yaml"]
}
},
```

Note that you can install `helm_ls` in a directory that is not in your PATH, and then specify the full path to the executable in the `command` field.

Save the configuration file and then, either:
- Reastart neovim
- Type `:CocRestart` in neovim to restart the language server.

Open a Helm file, and you should be able to see errors, documentation, completion, etc.

### VSCode

Expand Down