refactor: build on @kkdev92/vscode-ext-kit 7.1.0 - #92
Merged
Merged
Conversation
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>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on
@kkdev92/vscode-ext-kit7.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
filterLogger, which does what the hand-writtenfilteredwrapper did (silentincluded), andcheckRelativePath, which judges a relative path the same way on every platform. It also letsassertManifestMatchesholdengines.vscodeto the kit's floor.startand disposed of it instop. The hosted service's signal is the owner the kit offers for this: it aborts however the application ends.clipshot.enabledat activation and on every settings change, for awhenclause to read. Nowhenclause in the manifest has ever read it — the keybindings testterminalFocusonly, and the paste command checks the setting itself.Change
clipshot.logLevelis applied withfilterLogger. The level is still read on every paste and every settings change, so a new value applies at once, as before.checkRelativePath. A drive-relative value such asC:imagesis now reported as not relative, and so is a leading backslash on Linux and macOS. Where an image is written is unchanged:validatePathInsideWorkspacestill resolves the target through links and refuses anything outside the workspace.isAbsolutePathandcontainsParentTraversal, which only the warnings used, andvalidateRelativePath, which nothing called, are removed with their tests.clipshot.enabledcontext key is no longer set. A keybinding of your own can test the setting asconfig.clipshot.enabled.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'sNotificationsservice, sosrc/extension.tsno longer importsvscode.engines: true.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%) andtest:e2e(13 passing, exit code 0, VS Code 1.140.0).clipshot.logLevelatwarnandsilent, reading what reaches the log channel — pass on the previous source too, fail when the command ignores the setting;stop), fails when the subscription is never released. The helper that fires configuration changes skips listeners whose subscription was disposed, since the vscode mock'sdisposedetaches nothing;C:images,C:\images,\images,\\server\share) — fails on the previous source atC:images;engines.vscodelowered to^1.137.0fails withengines.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-arm64andverify-vsix.mjs win32-arm64pass; the VSIX carries sharp 0.35.5 withlibvips-cpp-8.18.7.dll.🤖 Generated with Claude Code