{"id":16406853,"url":"https://github.com/terror/just-lsp","last_synced_at":"2026-05-21T04:07:02.387Z","repository":{"id":107011850,"uuid":"458562978","full_name":"terror/just-lsp","owner":"terror","description":"A language server for just","archived":false,"fork":false,"pushed_at":"2022-02-18T01:19:20.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T09:37:17.789Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terror.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-12T15:38:05.000Z","updated_at":"2023-03-07T18:35:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"eedbfb6a-8e61-404d-ac8e-36248d4cc3ca","html_url":"https://github.com/terror/just-lsp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terror%2Fjust-lsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terror%2Fjust-lsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terror%2Fjust-lsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terror%2Fjust-lsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terror","download_url":"https://codeload.github.com/terror/just-lsp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240380779,"owners_count":19792361,"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-10-11T06:11:10.342Z","updated_at":"2026-05-21T04:07:02.372Z","avatar_url":"https://github.com/terror.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"## just-lsp\n\n[![release](https://img.shields.io/github/release/terror/just-lsp.svg?label=release\u0026style=flat\u0026labelColor=282c34\u0026logo=github)](https://github.com/terror/just-lsp/releases/latest)\n[![crates.io](https://shields.io/crates/v/just-lsp.svg)](https://crates.io/crates/just-lsp)\n[![CI](https://github.com/terror/just-lsp/actions/workflows/ci.yaml/badge.svg)](https://github.com/terror/just-lsp/actions/workflows/ci.yaml)\n[![codecov](https://codecov.io/gh/terror/just-lsp/graph/badge.svg?token=7CH4XDXO7Z)](https://codecov.io/gh/terror/just-lsp)\n[![downloads](https://img.shields.io/github/downloads/terror/just-lsp/total.svg)](https://github.com/terror/just-lsp/releases)\n[![dependency status](https://deps.rs/repo/github/terror/just-lsp/status.svg)](https://deps.rs/repo/github/terror/just-lsp)\n\n`just-lsp` is a server implementation of the\n[language server protocol](https://microsoft.github.io/language-server-protocol/)\nfor [just](https://github.com/casey/just), the command runner.\n\n\u003cimg width=\"1667\" alt=\"demo\" src=\"screenshot.png\" /\u003e\n\n`just-lsp` brings rich editor support to your justfiles, including:\n\n- Completions for recipe names, variables, and all builtins: attributes,\n  constants, functions, and settings.\n\n- Hover docs for whatever's under your cursor: recipe definitions, parameter\n  declarations, variable assignments, and the full builtin reference.\n\n- Jump to definition for recipes, aliases, parameters, assignments, and builtin\n  constants.\n\n- Diagnostics on every change, catching syntax errors, unknown recipes, bad\n  dependencies, indentation issues, and more. See\n  [`docs/diagnostics.md`](docs/diagnostics.md) for the full list of rules.\n\n- Rename and find references for recipes, aliases, variables, and parameters,\n  scope-aware so refactors don't accidentally rewrite unrelated identifiers.\n\n- Run any recipe directly from your editor via a code action, with optional\n  argument prompting before `just` is invoked.\n\n- Semantic highlighting, folding, and formatting via `just --fmt --unstable`.\n\nIf you need help with `just-lsp` please feel free to open an issue or ping me on\n[Discord](https://discord.gg/ezYScXR). Feature requests and bug reports are\nalways welcome!\n\n## Installation\n\n`just-lsp` should run on any system, including Linux, MacOS, and the BSDs.\n\nThe easiest way to install it is by using\n[cargo](https://doc.rust-lang.org/cargo/index.html), the Rust package manager:\n\n```bash\ncargo install just-lsp\n```\n\nOtherwise, see below for the complete package list:\n\n#### Cross-platform\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003ePackage Manager\u003c/th\u003e\n      \u003cth\u003ePackage\u003c/th\u003e\n      \u003cth\u003eCommand\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca href=https://www.rust-lang.org\u003eCargo\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=https://crates.io/crates/just-lsp\u003ejust-lsp\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003ecargo install just-lsp\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca href=https://brew.sh\u003eHomebrew\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=https://github.com/terror/homebrew-tap\u003eterror/tap/just-lsp\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003ebrew install terror/tap/just-lsp\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n#### Linux\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eOperating System\u003c/th\u003e\n      \u003cth\u003ePackage Manager\u003c/th\u003e\n      \u003cth\u003ePackage\u003c/th\u003e\n      \u003cth\u003eCommand\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca href=https://www.archlinux.org\u003eArch\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=https://wiki.archlinux.org/title/Pacman\u003epacman\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=https://archlinux.org/packages/extra/x86_64/just-lsp/\u003ejust-lsp\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003epacman -S just-lsp\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n![just-lsp package version table](https://repology.org/badge/vertical-allrepos/just-lsp.svg)\n\n### Mason\n\nYou can also install the server via\n[mason](https://github.com/williamboman/mason.nvim), the Neovim plugin that\nallows you to easily manage external editor tooling such as LSP servers, DAP\nservers, etc.\n\nSimply invoke `:Mason` in your editor, and find `just-lsp` in the dropdown to\ninstall it.\n\n### Pre-built binaries\n\nPre-built binaries for Linux, MacOS, and Windows can be found on\n[the releases page](https://github.com/terror/just-lsp/releases).\n\n## Usage\n\n### CLI\n\nRunning `just-lsp` with no arguments starts the language server over\nstdin/stdout.\n\n#### `analyze`\n\nThe `analyze` subcommand runs the diagnostic engine on a justfile and prints any\nwarnings or errors to stderr, without starting the language server:\n\n```bash\njust-lsp analyze [PATH]\n```\n\nWhen `PATH` is omitted it searches the current directory and its ancestors for a\nfile named `justfile`. The exit code is non-zero if any error-severity\ndiagnostic is found.\n\n### Editor Integration\n\n`just-lsp` can be used with any LSP client, this section documents integration\nwith some of the more popular ones.\n\n### Neovim\n\n`nvim-lspconfig` exposes its server definitions to the builtin\n[`vim.lsp.config`](https://neovim.io/doc/user/lsp.html#lsp-config) API, so the\nold `require('lspconfig').just.setup()` pattern is deprecated. With Nvim 0.11.3+\nand the latest nvim-lspconfig installed, enabling `just-lsp` looks like:\n\n```lua\nvim.lsp.enable('just')\n```\n\nIf you need to override the default command, capabilities, or hooks, define (or\nextend) the config before enabling it:\n\n```lua\nvim.lsp.config('just', {\n  cmd = { '/path/to/just-lsp' }, -- only needed when the binary is not on $PATH\n  on_attach = function(client, bufnr)\n    -- add your mappings or buffer-local options\n  end,\n  capabilities = require('cmp_nvim_lsp').default_capabilities(),\n})\n\nvim.lsp.enable('just')\n```\n\n`vim.lsp.config` automatically merges your overrides with the upstream config\nshipped inside nvim-lspconfig's `lsp/just.lua`.\n\n`capabilities` describe what features your client supports (completion snippets,\nfolding ranges, etc.). The helper from `cmp-nvim-lsp` augments the defaults so\ncompletion-related capabilities line up with `nvim-cmp`. If you do not use\n`nvim-cmp`, you can omit the field or build your own table.\n\n### Visual Studio Code\n\nA third-party [**Visual Studio Code**](https://code.visualstudio.com/) extension\nis maintained over at https://github.com/nefrob/vscode-just, written by\n[@nefrob](https://github.com/nefrob). Follow the instructions in that repository\nto get it setup on your system.\n\n### Zed\n\nA third-party [**Zed**](https://zed.dev/) extension is maintained over at\nhttps://github.com/jackTabsCode/zed-just, written by\n[@jackTabsCode](https://github.com/jackTabsCode) \u0026\n[@mattrobenolt](https://github.com/mattrobenolt). Follow the instructions in\nthat repository to get it setup on your system.\n\n## Configuration\n\n`just-lsp` accepts configuration through the LSP `initializationOptions` object,\nsent from your editor when the server starts.\n\n### Rules\n\nIndividual diagnostic rules can be configured under the `rules` key. Each rule\nis keyed by its code (see [`docs/diagnostics.md`](docs/diagnostics.md)) and\naccepts either a level string or a table with a `level` field:\n\n```json\n{\n  \"rules\": {\n    \"unused-variables\": \"off\",\n    \"unused-parameters\": { \"level\": \"error\" }\n  }\n}\n```\n\nSupported levels are `error`, `warning`, `information` (or `info`), `hint`, and\n`off`. Setting a rule to `off` suppresses it entirely; any other level overrides\nthe rule's default severity. Rules that are not listed retain their default\nbehavior.\n\n#### Neovim\n\nPass the configuration table via the `init_options` field:\n\n```lua\nvim.lsp.config('just', {\n  init_options = {\n    rules = {\n      ['unused-variables'] = 'off',\n      ['unused-parameters'] = { level = 'warning' },\n    },\n  },\n})\n\nvim.lsp.enable('just')\n```\n\n## Development\n\nI use [Neovim](https://neovim.io/) to work on this project, and I load the\ndevelopment build of this server to test out my changes instantly. This section\ndescribes a development setup using Neovim as the LSP client, for other clients\nyou would need to look up their respective documentation.\n\nFirst, clone the repository and build the project:\n\n```\ngit clone https://github.com/terror/just-lsp\ncd just-lsp\ncargo build\n```\n\nAdd this to your editor configuration:\n\n```lua\nlocal dev_cmd = '/path/to/just-lsp/target/debug/just-lsp'\n\nlocal on_attach = function(client, bufnr)\n  -- Add your implementation here\nend\n\nlocal capabilities = require('cmp_nvim_lsp').default_capabilities()\n\nvim.lsp.config('just_dev', {\n  cmd = { dev_cmd },\n  filetypes = { 'just' },\n  root_dir = function(fname)\n    return vim.fs.root(fname, { '.git', 'justfile' })\n  end,\n  on_attach = on_attach,\n  capabilities = capabilities,\n})\n\nvim.lsp.enable('just_dev')\n```\n\nThis uses a separate config name (`just_dev`) so you can switch between the\nlocal development build and the stock `just` config. Replace `dev_cmd` with the\nabsolute path to your freshly built binary.\n\n`on_attach` is a function that gets called after an LSP client attaches to a\nbuffer,\n[mine](https://github.com/terror/dotfiles/blob/0cc595de761d27d99367ad0ea98920b7718be4fb/etc/nvim/lua/config.lua#L207)\njust sets up a few mappings:\n\n```lua\nlocal on_attach = function(client, bufnr)\n  -- ...\n  map('n', '\u003cleader\u003ear', '\u003ccmd\u003elua vim.lsp.buf.rename()\u003cCR\u003e')\n  map('n', '\u003cleader\u003es', '\u003ccmd\u003elua vim.lsp.buf.format({ async = true })\u003cCR\u003e')\n  -- ...\nend\n```\n\nAs in the basic example above, we use `cmp_nvim_lsp.default_capabilities()` so\nthat the dev build inherits completion-related capabilities from `nvim-cmp`.\nSwap in your own table if you use a different completion plugin.\n\n**n.b.** This setup requires the\n[nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) plugin (and\noptionally [cmp-nvim-lsp](https://github.com/hrsh7th/cmp-nvim-lsp) for the\ncapabilities helper).\n\n### Extending the parser\n\n`just-lsp` vendors the\n[`tree-sitter-just`](https://github.com/terror/just-lsp/tree/master/vendor/tree-sitter-just)\nparser in `vendor/tree-sitter-just`. After changing the grammar or query files,\nrebuild and test the parser with the following commands:\n\n```bash\njust -f vendor/tree-sitter-just/justfile gen\ncd vendor/tree-sitter-just \u0026\u0026 tree-sitter test\ncargo test\n```\n\n**n.b.** `just update-parser` will run all of the above for you.\n\nThe generate step updates the parser artifacts under\n`vendor/tree-sitter-just/src/`. Commit those files together with any updated\ncorpora in `vendor/tree-sitter-just/test/corpus` so downstream tooling sees your\nchanges.\n\n## Prior Art\n\nCheck out [just](https://github.com/casey/just), the command runner.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterror%2Fjust-lsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterror%2Fjust-lsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterror%2Fjust-lsp/lists"}