加快vscode(及vscode衍生品cursor、windsurf)启动速度

步骤:

  1. 打开命令面板 (Cmnd + Shift + P)
  2. 输入 “Preferences: Configure Runtime Arguments”
  3. 添加: “disable-hardware-acceleration”: true
  4. 重启

解决rust-analyzer卡住问题

  1. rm -rf ~/.cargo/.package-cache
  2. vi ~/.cargo/config.toml
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
[source.crates-io]
replace-with = 'rsproxy-sparse'

[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"

# 稀疏索引,要求 cargo >= 1.68
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"

[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"

[net]
git-fetch-with-cli = true
  1. 创建或修改 .vscode/settings.json 文件
1
2
3
4
5
6
7
8
9
{
    "rust-analyzer.checkOnSave.command": "check",
    "rust-analyzer.checkOnSave.extraArgs": ["--target-dir", "target/rust-analyzer"],
    "rust-analyzer.cargo.buildScripts.enable": false,
    "rust-analyzer.procMacro.enable": false,
    "rust-analyzer.cargo.features": [],
    "rust-analyzer.diagnostics.disabled": ["unresolved-proc-macro"],
    "rust-analyzer.check.extraArgs": ["--target-dir", "target/rust-analyzer"]
}
  1. 执行cargo clean