Flux cli LSP server
npm install @influxdata/flux-lsp-cli

An implementation of the Language Server Protocol for the Flux language.
```
npm i -g @influxdata/flux-lsp-cli
The core of the flux parsing library can be found here which is compiled into WASM for consumption in this tool.
There are a lot of plugins that are capable of running language servers. This section will cover the one we use or know about.
In any case, you need to recognize the filetype. This is done looking at the file extension, in our case .flux. You should place this in your vimrc file:
`vimrc`
" Flux file type
au BufRead,BufNewFile *.flux set filetype=flux
in your .vimrc
`vimrc
let g:lsp_diagnostics_enabled = 1
if executable('flux-lsp')
au User lsp_setup call lsp#register_server({
\ 'name': 'flux lsp',
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'flux-lsp']},
\ 'whitelist': ['flux'],
\ })
endif
autocmd FileType flux nmap gd
`
Requires vim-coc. vim-coc uses a coc-settings.json file and it is located in your ~/.vim directory. In order to run the flux-lsp you need to add the flux section in the languageserver.
`json`
{
"languageserver": {
"flux": {
"command": "flux-lsp",
"filetypes": ["flux"]
}
}
}/tmp/fluxlsp
If you need to debug what flux-lsp is doing, you can configure it to log to :
`json``
{
"languageserver": {
"flux": {
"command": "flux-lsp",
"args": ["-l", "/tmp/fluxlsp"],
"filetypes": ["flux"]
}
}
}
- initialize
- shutdown
- textDocument/definition
- textDocument/didChange
- textDocument/didOpen
- textDocument/didSave
- textDocument/foldingRange
- textDocument/references
- textDocument/rename