Remove leven dependency - #1325
Merged
Benjamin Christopher Simmonds (benibenj) merged 5 commits intoSep 4, 2026
Merged
Conversation
Benjamin Christopher Simmonds (benibenj)
previously approved these changes
Sep 4, 2026
Christof Marti (chrmarti)
previously requested changes
Sep 4, 2026
Christof Marti (chrmarti)
left a comment
There was a problem hiding this comment.
What's the advantage of having a copy of the helper instead of the maintained package?
Move the inlined helper out of main.ts into util.ts, split into a `levenshtein` distance function and a `findSimilar` selection function so both can be unit tested. Adds src/test/similarity.test.ts covering three layers: the distance function against a textbook full matrix reference, the selection rule against a reference implementation, and the actual `vsce <typo>` output so the wiring in main.ts is covered too. Includes a guard that fails if the registered command list drifts from what the tests assume. Selection behaviour is unchanged from the inlined version, verified by a differential run over 189k inputs covering mutated commands, unicode, surrogate pairs, ties and degenerate candidate sets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Benjamin Christopher Simmonds (benibenj)
dismissed
their stale review
via
September 4, 2026 13:10
bee68cf
log.error writes to stdout with an ::error:: prefix when GITHUB_ACTIONS is set and to console.error otherwise, so the create-publisher test passed locally but failed on CI. Capture both streams so the tests are environment independent. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
We are working on reducing the number of packages we depend on. For most packages we only need a small subset of it's features but get dependabot alerts for every CVE the package and it's transitive dependencies have. This PR is rather a small change and not as impactful as the others we've merged, but I still think it's fine to have our own method as long as they are small, simple and easy to test. |
Benjamin Christopher Simmonds (benibenj)
enabled auto-merge
September 4, 2026 13:49
Benjamin Christopher Simmonds (benibenj)
approved these changes
Sep 4, 2026
Giuseppe Cianci (Giuspepe)
approved these changes
Sep 4, 2026
Benjamin Christopher Simmonds (benibenj)
merged commit Sep 4, 2026
75cae44
into
microsoft:main
5 checks passed
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.
Donating my helper from
hereby: https://github.com/jakebailey/hereby/blob/79e88d2d616eb199226d61f77e4c54bc8a40a1c1/src/cli/utils.ts#L61