Repository navigation
feat: add uv and uvx completions - #496
Closed
taf (tashifkhan) wants to merge 1 commit into
Closed
taf (tashifkhan) wants to merge 1 commit into
taf (tashifkhan) wants to merge 1 commit into
Conversation
Author
|
@microsoft-github-policy-service agree |
Bundle uv and uvx specs covering uv 0.13.6. The runtime registers them alongside the @withfig/autocomplete specs, and specs in specs.path still take precedence. uv run suggests [project.scripts] entry points from the nearest pyproject.toml, then Python files, then other files. uv remove suggests declared dependencies. pyproject.toml is parsed with smol-toml because the existing toml dependency does not support TOML 1.0 mixed arrays. Closes microsoft#495
taf (tashifkhan)
force-pushed
the
feat/uv-completions
branch
from
November 1, 2026 10:16
4cc9c1e to
30d00bf
Compare
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.
Closes #495
Adds bundled
uvanduvxcompletion specs. They load through the same spec set as the@withfig/autocompletespecs, and a spec of the same name inspecs.pathstill takes precedence.Changes
src/specs/uv.tsandsrc/specs/uvx.tsare Fig specs covering uv 0.13.6. They cover 61 command nodes, flags, documented choice values, and file or directory arguments. Option groups that uv repeats across commands (index, resolver, build, installer, cache and Python options) are shared constants. Global options are declared once on the root withisPersistent: true.src/specs/pyproject.tshas the generators:uv run, entry points from[project.scripts]in the nearestpyproject.tomlcome first, then Python files, then other files.--projectand--directorychange where it looks.--no-project,--script/-s,--gui-scriptand--module/-mturn script suggestions off. Scripts are hidden while a path is being typed.uv remove, dependencies declared inproject.dependencies,project.optional-dependenciesanddependency-groups.src/specs/index.tsmaps spec names to lazy imports.runtime.tsadds them to the spec set and accepts a loader function as well as a path.smol-tomlparsespyproject.toml. The existingtomldependency only supports TOML 0.4 and rejects mixed arrays such asdev = ["pytest", { include-group = "lint" }], which are common in uv projects.Why not use the uv spec from newer
@withfig/autocompleteVersion 2.692.3 includes
uv.js, but it is missing current commands (auth,format,check,audit,workspace) and has nouvxspec. Itsuv rungenerator also runs a bareuv run, which creates.venvanduv.lockin a new project. Details are in #495.Testing
npm run lint,npm run buildandnpm testpass locally on macOS (217 passed, 10 skipped).poetry, thepyproject.tomlgenerators, andspecs.pathtaking precedence over a bundled spec.Open questions
src/specs/uv.ts, the same way the Fig specs are updated.withfig/autocomplete, I can move the spec there instead.