0.8.40 • Published 1 year ago

@influxdata/flux-lsp-node v0.8.40

Weekly downloads
98
License
MIT
Repository
github
Last release
1 year ago

Flux LSP

LICENSE Slack Status

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

LSP Development

  • LSP development requires rust version of 1.40.0 or newer.
  • run tests with make test

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"]
      }
  }
}

with webpack

This package is distributed as a wasm file, and since wasm files cannot be included in the main bundle, you need to import the library a little differently:

import('@influxdata/flux-lsp-browser')
    .then(({Server}) => {
        let server = new Server(false);
        // The LSP server is now ready to use
    });

Also ensure that the wasm file is not being parsed by any file loader plugins, as this will interfere with it's proper instantiation.

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
0.8.40

1 year ago

0.8.38

1 year ago

0.8.37

2 years ago

0.8.39

1 year ago

0.8.36

2 years ago

0.8.34

2 years ago

0.8.33

2 years ago

0.8.35

2 years ago

0.8.30

2 years ago

0.8.32

2 years ago

0.8.31

2 years ago

0.8.29

2 years ago

0.8.25

2 years ago

0.8.21

2 years ago

0.8.20

2 years ago

0.8.27

2 years ago

0.8.26

2 years ago

0.8.28

2 years ago

0.8.19

2 years ago

0.8.16

2 years ago

0.8.18

2 years ago

0.8.17

2 years ago

0.8.14

2 years ago

0.8.15

2 years ago

0.8.9

2 years ago

0.8.12

2 years ago

0.8.11

2 years ago

0.8.13

2 years ago

0.8.10

2 years ago

0.8.8

2 years ago

0.8.7

2 years ago

0.8.6

2 years ago

0.8.5

2 years ago

0.8.4

2 years ago

0.8.1

2 years ago

0.8.3

2 years ago

0.8.2

2 years ago

0.6.9

3 years ago

0.6.10

3 years ago

0.6.12

2 years ago

0.6.11

3 years ago

0.7.2

2 years ago

0.7.4

2 years ago

0.7.0

2 years ago

0.8.0

2 years ago

0.6.8

3 years ago

0.6.7

3 years ago

0.6.6

3 years ago

0.6.4

3 years ago

0.6.3

3 years ago

0.6.2

3 years ago

0.5.99

3 years ago

0.6.0

3 years ago

0.5.53

3 years ago

0.5.52

3 years ago

0.5.51

3 years ago

0.5.49

3 years ago

0.5.48

3 years ago

0.5.43

3 years ago

0.5.44

3 years ago

0.5.41

3 years ago

0.5.42

3 years ago

0.5.47

3 years ago

0.5.45

3 years ago

0.5.46

3 years ago

0.5.40

3 years ago

0.5.39

3 years ago

0.5.38

3 years ago

0.5.37

3 years ago

0.5.35

3 years ago

0.5.34

3 years ago

0.5.33

3 years ago

0.5.32

3 years ago

0.5.31

3 years ago

0.5.30

3 years ago

0.5.29

3 years ago

0.5.28

3 years ago

0.5.27

3 years ago

0.5.26

3 years ago

0.5.25

3 years ago

0.5.24

3 years ago

0.5.23

3 years ago

0.5.22

4 years ago

0.5.21

4 years ago

0.5.20

4 years ago

0.5.19

4 years ago

0.5.18

4 years ago

0.5.17

4 years ago

0.5.16

4 years ago

0.5.11

4 years ago

0.5.10

4 years ago

0.5.9

4 years ago

0.5.8

4 years ago

0.5.7

4 years ago

0.5.6

4 years ago

0.5.5

4 years ago

0.5.4

4 years ago

0.5.3

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago