Skip to content

refactor: build on @kkdev92/vscode-ext-kit 7.1.0 - #92

Merged
kkdev92 merged 1 commit into
mainfrom
chore/kit-7.1.0
Oct 3, 2026
Merged

kkdev92 merged 1 commit into
mainfrom
chore/kit-7.1.0

Conversation

@kkdev92

@kkdev92 kkdev92 commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Builds on @kkdev92/vscode-ext-kit 7.1.0: its log filter and its check for relative paths take over from this extension's own code, the hosted services release what they subscribe to through their signal, and a context key that nothing reads is no longer set.

Why

  • 7.1.0 adds filterLogger, which does what the hand-written filtered wrapper did (silent included), and checkRelativePath, which judges a relative path the same way on every platform. It also lets assertManifestMatches hold engines.vscode to the kit's floor.
  • Two hosted services kept their settings subscription in a variable outside start and disposed of it in stop. The hosted service's signal is the owner the kit offers for this: it aborts however the application ends.
  • ClipShot set the context key clipshot.enabled at activation and on every settings change, for a when clause to read. No when clause in the manifest has ever read it — the keybindings test terminalFocus only, and the paste command checks the setting itself.

Change

  • clipshot.logLevel is applied with filterLogger. The level is still read on every paste and every settings change, so a new value applies at once, as before.
  • The save-directory warnings use checkRelativePath. A drive-relative value such as C:images is now reported as not relative, and so is a leading backslash on Linux and macOS. Where an image is written is unchanged: validatePathInsideWorkspace still resolves the target through links and refuses anything outside the workspace. isAbsolutePath and containsParentTraversal, which only the warnings used, and validateRelativePath, which nothing called, are removed with their tests.
  • The clipshot.enabled context key is no longer set. A keybinding of your own can test the setting as config.clipshot.enabled.
  • The configuration and terminal-shortcut services release their subscription through context.signal; the terminal service, which subscribes after an await, does not subscribe if the application stopped meanwhile. The notice that the terminal skip list was written goes through the kit's Notifications service, so src/extension.ts no longer imports vscode.
  • The manifest test passes engines: true.
  • CHANGELOG: sharp 0.35.5 (libvips 8.18.6 → 8.18.7 and newer builds of the libraries it uses), which is already on main, the kit update, the context key and the save-directory warnings.

Verification

  • npm run verify: lint, compile, typecheck:test, test:coverage (491 tests; lines 90.31%, branches 79.23%) and test:e2e (13 passing, exit code 0, VS Code 1.140.0).
  • New tests and what they were checked against:
    • clipshot.logLevel at warn and silent, reading what reaches the log channel — pass on the previous source too, fail when the command ignores the setting;
    • the configuration warnings at activation and after a settings change;
    • no reaction to a settings change after deactivate — passes on the previous source (which released the subscription in stop), fails when the subscription is never released. The helper that fires configuration changes skips listeners whose subscription was disposed, since the vscode mock's dispose detaches nothing;
    • rooted save directories (C:images, C:\images, \images, \\server\share) — fails on the previous source at C:images;
    • the manifest test with engines.vscode lowered to ^1.137.0 fails with engines.vscode "^1.137.0" admits VS Code 1.137.0, and @kkdev92/vscode-ext-kit needs VS Code 1.138.0 or later.
  • vsce package --target win32-arm64 and verify-vsix.mjs win32-arm64 pass; the VSIX carries sharp 0.35.5 with libvips-cpp-8.18.7.dll.

🤖 Generated with Claude Code

Takes the kit's 7.1.0 and lets it do what this extension did by hand.

- clipshot.logLevel is applied with the kit's filterLogger, `silent`
  included, in place of the hand-written wrapper and its severity table. The
  level is still read on every paste and every settings change.
- The save-directory warnings use the kit's checkRelativePath, which judges
  a value the same way on every platform: a drive-relative value such as
  C:images is now reported as not relative, and so is a leading backslash on
  Linux and macOS. Where an image is written is unchanged;
  validatePathInsideWorkspace still keeps it inside the workspace. The two
  helpers the warnings used, and validateRelativePath, which nothing called,
  go with their tests.
- The context key clipshot.enabled is no longer set. No `when` clause in
  the manifest has ever read it; a keybinding of your own can test the
  setting as `config.clipshot.enabled`.
- The two hosted services that watch settings release their subscription
  through their signal instead of a variable outside `start`, and the notice
  that the terminal skip list was written goes through the Notifications
  service. This file no longer imports vscode.
- The manifest test holds engines.vscode to the kit's floor.
- CHANGELOG: sharp 0.35.5 (libvips 8.18.7), already on main, and the above.

New tests cover clipshot.logLevel at warn and silent, the configuration
warnings at activation and after a change, no reaction to a change after
deactivate, and rooted save directories. Each fails on a deliberate break;
the save-directory test also fails on the previous source, and the others
pass on it, as that behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kkdev92
kkdev92 merged commit b92a647 into main Oct 3, 2026
16 checks passed
@kkdev92
kkdev92 deleted the chore/kit-7.1.0 branch October 3, 2026 14:52
@kkdev92 kkdev92 mentioned this pull request Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant