Skip to content
Implementation of Language Server Protocol for the flux language
Rust Other
  1. Rust 98.7%
  2. Other 1.3%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.cargo
.circleci
.github
src
tests
.gitignore
.rustfmt.toml
Cargo.lock
Cargo.toml
Dockerfile feat(flux-lsp): better wasm build (#73) Dec 12, 2019
LICENSE chore(flux-lsp): Add MIT License (#45) Nov 20, 2019
Makefile
Readme.md
SECURITY.md chore(flux-lsp): Add MIT License (#45) Nov 20, 2019
build-docker-image.sh
build.sh
publish.sh
vars.sh
wasm-build.sh

Readme.md

Flux LSP

LICENSE Slack Status

An implementation of the Language Server Protocol for the Flux language.

Installing command line server

npm i -g @influxdata/flux-lsp-cli

This will allow you to run an LSP instance with the command flux-lsp

Vim setup

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:

" Flux file type
au BufRead,BufNewFile *.flux		set filetype=flux

with vim-lsp

Requires vim-lsp

in your .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 <plug>(lsp-definition)

with vim-coc

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.

{
  "languageserver": {
      "flux": {
        "command": "flux-lsp",
        "filetypes": ["flux"]
      }
  }
}

If you need to debug what flux-lsp is doing, you can configure it to log to /tmp/fluxlsp:

{
  "languageserver": {
      "flux": {
        "command": "flux-lsp",
        "args": ["-l", "/tmp/fluxlsp"],
        "filetypes": ["flux"]
      }
  }
}

Supported LSP features

  • initialize
  • shutdown
  • textDocument/definition
  • textDocument/didChange
  • textDocument/didOpen
  • textDocument/didSave
  • textDocument/foldingRange
  • textDocument/references
  • textDocument/rename
  • textDocument/completion
  • textDocument/documentSymbol
  • completionItem/resolve
You can’t perform that action at this time.