Skip to content

frederik-uni/cargotom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CargoTom[l]

Config

"lsp": {
  "cargo-tom": {
    "initialization_options": {
      /// Search
      "per_page": 25,
      /// What features should be displayed on hover
      /// All, UnusedOpt, Features,
      "feature_display_mode": "UnusedOpt",
      "hide_docs_info_message": false,
      /// Sort toml on format
      "sort_format": false,
      /// Use stable versions in completions
      "stable_version": true,
      /// Offline mode uses https://github.com/frederik-uni/crates.io-dump-minfied for search
      /// The order is non existent feel free to contribute
      "offline": false,
    }
  },
  // ...
}

Features

Code actions

  • Add self as dependency
  • Open LSP docs(first line)
  • Open LSP issues(first line)
  • Open Cargo.toml docs(first line)
  • "Make Workspace dependency" => This will generate { workspace = true } for the dependency
  • "Expand dependency specification" => This will convert from "0.1.0" to { version = "0.1.0" }
  • "Collapse dependency specification" => This will convert from { version = "0.1.0" } to "0.1.0
  • "Open Docs" => opens docs.rs/...
  • "Open Homepage" => opens ???...
  • "Open crates.io" => opens crates.io/...
  • "Open Src code" => opens src code on github
  • "Upgrade" => will upgrade the dependency version to the latest version
  • "Upgrade All" => will upgrade every dependency version to the latest version
  • "Update All" => will run cargo update
  • toggle optional dependency
  • make dependency optional if in feature
  • fix missing in workspace

Inlay Hint

  • used version in Cargo.lock

Hover

  • available versions
  • available features
  • crate description(README)
  • Static

Code completion

  • static manifest suggestions
    • fix path detection
    • default value
  • dependency
    • name
      • filter existing
      • add workspace crates
      • sort
      • starts_with_segment, treat - and _ the same
    • dependency version
    • dependency features
    • dependency workspace
    • key when version after the key crate = "0.1.0" => crate = {ve"0.1.0" to crate = { version = "0.1.0" }
  • features
    • local features default = ["feature1", "feature2"]
    • optional dependencies dep:serde
    • dependencies features serde?/derive

Diagnostics

  • Static format
  • Dependencies
    • check if crate exists
    • check if crate needs update
    • check if crate version exists
    • check if crate features exist
    • check for feature duplicate
    • check for dep duplicate
    • check if version is set & dep in workspace
    • better target support
  • Features
    • check for feature duplicate
    • check if dep:crate_name is optional
  • cargo-udeps

Formatter

  • enable taplo formatter
  • auto close { when content inside

Plans

  • feature suggestions for git dependencies and local dependencies
  • use local readmes if available
  • make cache persistent

About

Cargo.toml LSP

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages