Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@influxdata/flux-lsp-node

Package Overview
Dependencies
Maintainers
18
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@influxdata/flux-lsp-node

LSP support for the flux language

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-95.12%
Maintainers
18
Weekly downloads
 
Created
Source

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

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
    });

You might also have to add this snippet to your webpack configuration's 'module.rules' array to enable wasm file parsing:

rules: [
    {
        test: /\.wasm$/,
        loader: 'file-loader',
        type: 'javascript/auto'
    },
    // ... all the rest of your loaders
]

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

FAQs

Package last updated on 27 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc