VS Code-compatible editors: optional clean obsolete extension directories
needs informationA-step
## Checklist
- [x] I have searched the issue tracker for relevant or duplicate issues.
VS Code-compatible editors record obsolete extension directories in `.obsolete` files under their extension roots:
```text
~/.cursor/extensions/.obsolete
~/.vscode/extensions/.obsolete
~/.vscode-insiders/extensions/.obsolete
```
Example:
```text
obsolete entry: anthropic.claude-code-2.1.142-darwin-arm64
active manifest: ~/.cursor/extensions/anthropic.claude-code-2.1.143-darwin-arm64
```
Would Topgrade accept an opt-in cleanup after successful VS Code-compatible extension updates?
Requested behavior:
1. For each VS Code-compatible editor variant Topgrade updates, find that variant's extension root.
2. Read that root's `.obsolete` file, if present.
3. Delete only existing direct child directories named by that file.
4. Leave `.obsolete` itself intact.
5. Skip or warn if the relevant editor is running.
Topgrade currently appears to have a shared `[vscode]` config for VS Code-compatible editors, not a Cursor-specific config section. Possible new config shape:
```toml
[vscode]
cleanup_obsolete_extensions = true
```
or per variant:
```toml
[cursor]
cleanup_obsolete_extensions = true
[vscode_insiders]
cleanup_obsolete_extensions = true
```
Alternatively, this could be gated behind Topgrade's existing global cleanup flag:
```toml
[misc]
cleanup = true
```
Safety: use `.obsolete` as the editor's source of truth rather than sorting versions, reject path traversal, and only delete direct children of the relevant extension root.
<!-- Assuming that someone else implements the feature,
please state if you know how to test it from a side branch of Topgrade. -->
- [x] I am able and willing to implement this feature myself
1 条评论