{"id":30450307,"url":"https://github.com/mathiaspius/crates-lsp","last_synced_at":"2025-08-23T13:26:55.304Z","repository":{"id":185936243,"uuid":"673943960","full_name":"MathiasPius/crates-lsp","owner":"MathiasPius","description":"Language Server implementation for Cargo.toml","archived":false,"fork":false,"pushed_at":"2025-06-27T22:41:50.000Z","size":198,"stargazers_count":27,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-27T23:27:52.234Z","etag":null,"topics":["cargo","crates","lapce","lsp","lsp-server","rust"],"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/MathiasPius.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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,"zenodo":null}},"created_at":"2023-08-02T19:25:47.000Z","updated_at":"2025-06-27T22:41:53.000Z","dependencies_parsed_at":"2024-01-11T00:51:56.878Z","dependency_job_id":"4892f56d-24b4-439b-a39a-8d7e962e6170","html_url":"https://github.com/MathiasPius/crates-lsp","commit_stats":null,"previous_names":["mathiaspius/crates-lsp"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/MathiasPius/crates-lsp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathiasPius%2Fcrates-lsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathiasPius%2Fcrates-lsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathiasPius%2Fcrates-lsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathiasPius%2Fcrates-lsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MathiasPius","download_url":"https://codeload.github.com/MathiasPius/crates-lsp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathiasPius%2Fcrates-lsp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271749048,"owners_count":24814115,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cargo","crates","lapce","lsp","lsp-server","rust"],"created_at":"2025-08-23T13:26:47.283Z","updated_at":"2025-08-23T13:26:55.286Z","avatar_url":"https://github.com/MathiasPius.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crates-lsp\nLanguage Server implementation targeted specifically towards the `Cargo.toml`\nfile of Rust projects, providing auto-completion for crate versions and\nin-editor hints when the selected crate versions are out of date.\n\nProject is heavily inspired by the [crates](https://github.com/serayuzgur/crates) plugin for VSCode.\n\n# Usage\n\nIn order to use `crates-lsp`, you must:\n1. Install the `crates-lsp` binary somewhere on your machine.\n2. Configure your editor to use the `crates-lsp` binary as a Language Server.\n\n\n## 1. Installing crates-lsp\nYou can either download the pre-built `crates-lsp` binary from a [release](https://github.com/MathiasPius/crates-lsp/releases/latest),\nor if you have Cargo (the Rust build tool) installed, you can build and install it yourself directly from [crates.io](https://crates.io/crates/crates-lsp):\n\n```bash\ncargo install --locked crates-lsp\n```\n\n## 2. Configuring your editor\nThis step is highly dependent on which editor you are using, see the guides below for known example configurations.\n\nIn most cases, these require `crates-lsp` to be available in your `$PATH`, or for you to specify the full path to it.\n\n### [Neovim](https://neovim.io/)\n```lua\nvim.lsp.config['crates'] = {\n  cmd = { 'crates-lsp' },\n  filetypes = { 'toml' },\n  root_markers = { 'Cargo.toml', '.git' },\n  init_options = {\n    -- Configuration options go here\n  }\n}\n```\n\n### [Helix](https://helix-editor.com/)\n```toml\n[language-servers.crates-lsp]\nexcept-features = [\"format\"]\n# config = {} # Configuration options go here\n\n[[language]]\nname = \"toml\"\nlanguage-servers = [ \"crates-lsp\", \"taplo\" ]\nformatter = { command = \"taplo\", args = [\"fmt\", \"-\"] }\n```\nSee the [Languages](https://docs.helix-editor.com/languages.html#languages) section of the Helix wiki, if you're unsure of where to put this.\n\nSee [Lsp](https://neovim.io/doc/user/lsp.html) section of the Neovim wiki, if you're unsure of where to put this.\n\n# Configuration\n`crates-lsp` has the following configuration options, which can be passed in from your editor (See [Usage](#usage) section above):\n\n| Option    | Type   | Default | Description |\n|-----------|--------|---------|-------------|\n| `cache_directory` | `string/path` | OS-specific `crates-lsp` cache directory | Directory in which to cache information about available crate versions, to avoid constantly querying crates.io. Uses the OS-specific cache directory. See [directories-rs](https://codeberg.org/dirs/directories-rs) |\n| `files` | `[string]` | `[\"Cargo.toml\"]` | List of exact filenames for which `crates-lsp` should provide feedback. Avoids `crates-lsp` throwing errors if you happen to open a `toml` file with a `[dependencies]` section, which does not contain Rust package names. |\n| `use_api` | `bool` | `false` | If true, uses the [Crates API](https://crates.io/data-access#api) instead of the [Crate Index](https://crates.io/data-access#crate-index). There are almost no reasons to ever enable this, and doing so puts a lot more strain on the services provided by crates.io. Please don't! |\n| `inlay_hints` | `bool` | `true` | If false, disables inlay hints. |\n| `up_to_date_hint` | `string` | `✓` | Text of inlay hint to show, when package is up to date. |\n| `needs_update_hint` | `string` | ` {}` | Text of inlay hint to show next to packages which should be updated. Any appearance of `{}` within the string, will be replaced by the newer version, which the package should be updated to. |\n| `diagnostics` | `bool` | `true` | If false, disables diagnostics. |\n| `unknown_dep_severity` | `int` | `2` (WARNING) | Sets severity of diagnostics indicating that a package could not be looked up. See [Diagnostic Severity](#diagnostic-severity) |\n| `needs_update_severity` | `int` | `3` (INFO) | Sets severity of diagnostics indicating that a package needs to be updated. See [Diagnostic Severity](#diagnostic-severity) |\n| `up_to_date_severity` | `int` | `4` (HINT) | Sets severity of diagnostics indicating that a package is up to date. See [Diagnostic Severity](#diagnostic-severity) |\n\n## Diagnostic Severity\nInteger indicating the severity to use when `crates-lsp` conveys a *diagnostic* about packages, such as: *Needs Update*, *Unknown Package*, or *Up To Date*. The following severities are available:\n\n* `1` ERROR\n* `2` WARNING\n* `3` INFORMATION\n* `4` HINT\n\n## Examples\nThese examples *only* showcase configuration options, and are not complete examples!\n\n### [Neovim](https://neovim.io/)\nThe `init_options` field contains the `crates-lsp` configuration options.\n```lua\nvim.lsp.config['crates'] = {\n  init_options = {\n    inlay_hints = false,      -- Disable inlay hints entirely\n    needs_update_severity = 1 -- Report necessary updates as ERRORs\n  }\n}\n```\n\n### [Helix](https://helix-editor.com/)\n```toml\n[language-server.crates-lsp]\n# Disable inlay hints, Report necessary updates as ERRORs\nconfig = { inlay_hints = false, needs_update_severity = 1 } \n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathiaspius%2Fcrates-lsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathiaspius%2Fcrates-lsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathiaspius%2Fcrates-lsp/lists"}