{"id":20259890,"url":"https://github.com/influxdata/flux-lsp","last_synced_at":"2025-04-09T16:05:14.057Z","repository":{"id":37080056,"uuid":"215152222","full_name":"influxdata/flux-lsp","owner":"influxdata","description":"Implementation of Language Server Protocol for the flux language","archived":false,"fork":false,"pushed_at":"2024-11-19T07:45:01.000Z","size":1627,"stargazers_count":29,"open_issues_count":22,"forks_count":5,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-04-09T16:04:54.447Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/influxdata.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-14T21:54:21.000Z","updated_at":"2025-03-27T12:43:56.000Z","dependencies_parsed_at":"2023-02-12T06:00:23.748Z","dependency_job_id":"8f733f08-2415-48f9-bb70-882e317dddb1","html_url":"https://github.com/influxdata/flux-lsp","commit_stats":{"total_commits":491,"total_committers":24,"mean_commits":"20.458333333333332","dds":0.6741344195519348,"last_synced_commit":"d90e193df50c919c23ec1ccc5472d22254cf7f1f"},"previous_names":[],"tags_count":104,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/influxdata%2Fflux-lsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/influxdata%2Fflux-lsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/influxdata%2Fflux-lsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/influxdata%2Fflux-lsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/influxdata","download_url":"https://codeload.github.com/influxdata/flux-lsp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065289,"owners_count":21041871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T11:17:09.369Z","updated_at":"2025-04-09T16:05:14.037Z","avatar_url":"https://github.com/influxdata.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flux LSP\n\n[![LICENSE](https://img.shields.io/github/license/influxdata/flux-lsp.svg)](https://github.com/influxdata/flux-lsp/blob/master/LICENSE)\n[![Slack Status](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack\u0026style=social)](https://www.influxdata.com/slack)\n\nAn implementation of the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) for the [Flux language](https://github.com/influxdata/flux).\n\n# LSP Development\n\n* LSP development requires rust version of 1.40.0 or newer.\n* run tests with `cargo test`\n\n# Installing command line server\n\n```\ncargo install --locked --git https://github.com/influxdata/flux-lsp\n```\n\nNOTE: previously, `flux-lsp` was installed via `npm`. If you have installed `flux-lsp`\nwith this method, please remove that version before installing this one.\n\nThis will allow you to run an LSP instance with the command `flux-lsp`. Like other\ncommand-line lsp servers, communication with the lsp server is via stdin/stdout. To use\nthis utility in your editor of choice, you'll need to use a plugin that supports\ncommand-line lsp servers.\n\nIf you find a plugin for your editor that doesn't work with `flux-lsp`, please file a bug.\n\n# Vim setup\n\nThere are a lot of plugins that are capable of running language servers. This section will cover the one we use or know about.\n\nIn 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:\n\n```vimrc\n\" Flux file type\nau BufRead,BufNewFile *.flux        set filetype=flux\n```\n\n### with neovim-lspconfig\n\nRequires [neovim-lspconfig](https://github.com/neovim/nvim-lspconfig)\n\nin your init.vim\n\n```vimrc\nrequire'lspconfig'.flux_lsp.setup{}\n```\n\nSee [here](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#flux_lsp) for more details.\n\n### with vim-lsp\nRequires [vim-lsp](https://github.com/prabirshrestha/vim-lsp)\n\nin your .vimrc\n\n```vimrc\nlet g:lsp_diagnostics_enabled = 1\n\nif executable('flux-lsp')\n    au User lsp_setup call lsp#register_server({\n        \\ 'name': 'flux lsp',\n        \\ 'cmd': {server_info-\u003e[\u0026shell, \u0026shellcmdflag, 'flux-lsp']},\n        \\ 'whitelist': ['flux'],\n        \\ })\nendif\n\nautocmd FileType flux nmap gd \u003cplug\u003e(lsp-definition)\n```\n\n### with vim-coc\n\nRequires [vim-coc](https://github.com/neoclide/coc.nvim). `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`.\n\n```json\n{\n  \"languageserver\": {\n      \"flux\": {\n        \"command\": \"flux-lsp\",\n        \"filetypes\": [\"flux\"]\n      }\n  }\n}\n```\nIf you need to debug what flux-lsp is doing, you can configure it to log to `/tmp/fluxlsp`:\n\n```json\n{\n  \"languageserver\": {\n      \"flux\": {\n        \"command\": \"flux-lsp\",\n        \"args\": [\"-l\", \"/tmp/fluxlsp\"],\n        \"filetypes\": [\"flux\"]\n      }\n  }\n}\n```\n\n### with webpack\n\nThis 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:\n\n```javascript\nimport('@influxdata/flux-lsp-browser')\n    .then(({Server}) =\u003e {\n        let server = new Server(false);\n        // The LSP server is now ready to use\n    });\n\n```\n\nAlso ensure that the wasm file is not being parsed by any file loader plugins, as this will interfere with it's proper instantiation.\n\n\n# Supported LSP features\n\n- completionItem/resolve\n- initialize\n- shutdown\n- textDocument/completion\n- textDocument/definition\n- textDocument/didChange\n- textDocument/didOpen\n- textDocument/didSave\n- textDocument/documentHighlight\n- textDocument/documentSymbol\n- textDocument/foldingRange\n- textDocument/hover\n- textDocument/references\n- textDocument/rename\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfluxdata%2Fflux-lsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfluxdata%2Fflux-lsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfluxdata%2Fflux-lsp/lists"}