version-lsp

Crates.ioversion-lsp
lib.rsversion-lsp
version0.4.0
created_at2026-01-18 09:26:34.329191+00
updated_at2026-01-18 09:26:34.329191+00
descriptionA Language Server Protocol implementation for package version management
homepagehttps://github.com/skanehira/version-lsp
repositoryhttps://github.com/skanehira/version-lsp
max_upload_size
id2052115
size609,716
skanehira (skanehira)

documentation

README

GitHub Repo stars GitHub GitHub all releases GitHub CI Status GitHub Release Status

version-lsp

A Language Server Protocol (LSP) implementation that provides version checking diagnostics for package dependency files.

Image from Gyazo Image from Gyazo
Image from Gyazo Image from Gyazo

Features

  • Detects outdated package versions and shows update suggestions
  • Reports errors for non-existent versions
  • Supports version ranges (e.g., ^1.0.0, ~1.0.0, >=1.0.0)
  • Caches version information locally for fast response

Supported Files

File Registry
package.json npm
pnpm-workspace.yaml npm
Cargo.toml crates.io
go.mod Go Proxy
pyproject.toml PyPI
.github/workflows/*.yaml/.github/actions/*/*.yaml GitHub Releases
deno.json / deno.jsonc JSR

pnpm Catalogs

Supports pnpm catalogs defined in pnpm-workspace.yaml:

# Single catalog
catalog:
  react: ^18.2.0
  lodash: ^4.17.21

# Named catalogs
catalogs:
  react17:
    react: ^17.0.2
  react18:
    react: ^18.2.0

Installation

From GitHub Releases

Download the latest binary from GitHub Releases.

From Source

cargo install --git https://github.com/skanehira/version-lsp

Using Nix Flake

If you have Nix with flakes enabled:

# Enter development shell with Rust toolchain
nix develop

# Build the package
nix build

# Run directly from flake
nix run github:skanehira/version-lsp

Editor Setup

Neovim (vim.lsp)

Available in Neovim >= 0.11

vim.lsp.config('version_lsp', {
  cmd = { 'version-lsp' },
  filetypes = { 'json', 'jsonc', 'toml', 'gomod', 'yaml' },
  root_markers = { '.git' },
  settings = {
    ["version-lsp"] = {
      -- See 'Configuration Options' section below for details
    },
  },
})

vim.lsp.enable('version_lsp')

Neovim (nvim-lspconfig)

local lspconfig = require('lspconfig')
local configs = require('lspconfig.configs')

if not configs.version_lsp then
  configs.version_lsp = {
    default_config = {
      cmd = { 'version-lsp' },
      filetypes = { 'json', 'jsonc', 'toml', 'gomod', 'yaml' },
      root_dir = function(fname)
        return lspconfig.util.find_git_ancestor(fname)
      end,
      settings = {},
    },
  }
end

lspconfig.version_lsp.setup({
  settings = {
    ["version-lsp"] = {
      cache = {
        refreshInterval = 86400000,  -- 24 hours (milliseconds)
      },
      registries = {
        npm = { enabled = true },
        crates = { enabled = true },
        goProxy = { enabled = true },
        pypi = { enabled = true },
        github = { enabled = true },
        pnpmCatalog = { enabled = true },
        jsr = { enabled = true },
      },
      ignorePrerelease = true,  -- Ignore prerelease versions (default: true)
    },
  },
})

Configuration Options

Option Type Default Description
cache.refreshInterval number 86400000 Cache refresh interval in milliseconds (default: 24 hours)
registries.npm.enabled boolean true Enable npm registry checks
registries.crates.enabled boolean true Enable crates.io registry checks
registries.goProxy.enabled boolean true Enable Go Proxy registry checks
registries.pypi.enabled boolean true Enable PyPI registry checks
registries.github.enabled boolean true Enable GitHub Releases checks
registries.pnpmCatalog.enabled boolean true Enable pnpm catalog checks
registries.jsr.enabled boolean true Enable JSR registry checks
ignorePrerelease boolean true Ignore prerelease versions (alpha, beta, rc, etc.)

Data Storage

version-lsp stores its cache database at:

  • Linux/macOS: $XDG_DATA_HOME/version-lsp/versions.db or ~/.local/share/version-lsp/versions.db
  • Fallback: ./version-lsp/versions.db

License

MIT

Commit count: 153

cargo fmt