Skip to content

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 28 Jun 18:26
· 23 commits to main since this release
a7460c6

Breaking

  • Flattened settings structure.

    Previously crates-lsp configuration settings all lived in a nested lsp object within the initialization parameters:

    vim.lsp.config['crates'] = {
      cmd = { 'crates-lsp' },
      filetypes = { 'toml' },
      root_markers = { 'Cargo.toml', '.git' },
      init_options = {
        lsp = {
          inlay_hints = false
        }
      }
    }

    Since all settings are necessarily LSP settings, this didn't really make sense.

    All settings now live in the root initialization parameters object:

    vim.lsp.config['crates'] = {
      cmd = { 'crates-lsp' },
      filetypes = { 'toml' },
      root_markers = { 'Cargo.toml', '.git' },
      init_options = {
        inlay_hints = false
      }
    }

Added

  • files configuration option, allowing you to limit the files crates-lsp should activate for, without relying on the lsp client which might not be able to filter. Solves #20.

    Note:

    • If not specified, this option defaults to Cargo.toml.
    • Uses exact matching on the entire filename. Partial matches, patterns, globbing, regex is not supported.

    Example (nvim):

    vim.lsp.config['crates'] = {
      cmd = { 'crates-lsp' },
      filetypes = { 'toml' },
      root_markers = { 'Cargo.toml', '.git' },
      init_options = {
        files = { 'Cargo.toml', 'AlternativeCargoFilename.toml']
      }
    }