• livingcoder@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    10 months ago

    Every so often rust-analyzer in VS Code doesn’t use the latest code after a cargo update and the only way I’ve found to fix it is a cargo clean. This means that I have to wait 5 minutes for the next build, painful. Just because of one project update. I would LOVE a faster build.

    Extra info: the updates come from my dependencies that utilize my private repositories via a git = "[path]". The rust-analyzer is pulling from a cache or older version for some reason and I don’t know where it is or why.

    • Vorpal@programming.dev
      link
      fedilink
      arrow-up
      5
      ·
      10 months ago

      Two tips that work for me:

      • After cargo add I have to sometimes run the “restart rust-analyzer” command from the vscode command pallette (exact wording may be off, I’m on my phone as of writing this comment). Much faster than cargo build.
      • Consider using sccache to speed up rebuilds. It helps a lot, though uses a bit of disk space. But disk space is cheap nowadays (as long as you aren’t stuck with a laptop with soldered SSD, in which case you know what not to buy next time).
    • Miaou@jlai.lu
      link
      fedilink
      arrow-up
      1
      ·
      9 months ago

      Having 30min+ incremental compile times here (C++), I envy your situation ahah