feat(figspec): use filepaths zip helper + Generators array for azd extension install#8887
Draft
Copilot wants to merge 2 commits into
Draft
feat(figspec): use filepaths zip helper + Generators array for azd extension install#8887Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
- Add FigGenFilepathsZip constant and filepathsHelperImport for VS Code's
filepaths({ extensions: ['zip'] }) helper
- Add Generators []string to Arg struct (takes precedence over Generator);
remove unused Template string field
- Update typescript_renderer to emit the filepaths import preamble and
render Generators as an array when multiple entries are present
- Switch azd extension install customization to use
Generators: [listExtensions, filepaths({extensions:['zip']})]
- Update tests and snapshot accordingly
- Update docs/fig-spec.md: add listConfigKeys table row and filepaths
helper subsection
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update azd figspec generation for new extension argument
feat(figspec): use filepaths zip helper + Generators array for azd extension install
Jun 30, 2026
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.
The
azd extension installarg was using atemplate: 'filepaths'fallback that didn't restrict completions to.zipfiles and didn't align with VS Code'sfilepathshelper API. This updates the Fig spec generator to emit the correct multi-generator array form with a scopedfilepaths({ extensions: ['zip'] })entry.Changes
Argstruct (types.go): AddedGenerators []stringfield (takes precedence overGeneratorwhen non-empty); removed deadTemplate stringfield.typescript_renderer.go): Emitsgenerators: [a, b]array form whenGeneratorshas multiple entries; auto-prependsimport { filepaths } from '../helpers/filepaths';to every generated spec.fig_generators.go): AddedFigGenFilepathsZipandfilepathsHelperImportconstants.customizations.go):azd extension installnow usesGenerators: []string{FigGenListExtensions, FigGenFilepathsZip}.fig-spec.md): Added missinglistConfigKeystable row; added subsection explaining multi-generator args and the auto-emitted import.TestFigSpec.ts): Updated to reflect import preamble and new generators array.Generated output for
azd extension install:Original prompt
open pr against azure/azure-dev
**Chronological Review:**Initial request: User switched to
mainbranch and provided a git patch from the VS Code repo (extensions/terminal-suggest/src/completions/azd.ts) that changed theazd ext installargument fromtemplate: 'filepaths'togenerators: [azdGenerators.listExtensions, filepaths({ extensions: ['zip'] })]with an added import. They asked me to update azd's figspec generation to produce this output.Exploration phase: I grepped for figspec-related files, discovering the generation lives in
cli/azd/internal/figspec/. I examinedcustomizations.go,fig_generators.go,types.go,typescript_renderer.go, the snapshotcmd/testdata/TestFigSpec.ts,resources/generators.ts, the tests, and the docdocs/fig-spec.md. Found the existing customization usedGenerator: FigGenListExtensions, Template: "filepaths".Implementation phase 1 (main task): Added
FigGenFilepathsZipandfilepathsHelperImportconstants; addedGenerators []stringtoArg; updated renderer to emit import preamble + render multiple generators as array; switchedazd extension installcustomization; updated tests; manually edited the snapshot (2 spots: import at top, ext-install arg block). Verified withgo build,go test ./cmd -run TestFigSpec(passed, 27.9s), gofmt, golangci-lint, cspell — all clean.Second request (doc review): User asked to review all recent figspec changes and ensure the
.mddocs are up to date. I checked git history, reviewed the full diff, and found the generators table infig-spec.mdwas missinglistConfigKeys(pre-existing gap), and nothing documented the newfilepathshelper. Added thelistConfigKeystable row and a "Combining generators: thefilepathshelper" subsection (using bold-subhead style to match existing section conventions). Fixed a botched edit that truncated a paragraph.Third request (cleanup - MOST RECENT): I noted that
Arg.Templatewas now dead code; user said "Sure can we clean that up." I removed theTemplatefield and all references.Intent Mapping:
Technical Inventory:
test/snapshotCode Archaeology: Files modified —
fig_generators.go,types.go,typescript_renderer.go,customizations.go,customizations_test.go,typescript_renderer_test.go,cmd/testdata/TestFigSpec.ts,docs/fig-spec.md.Progress Assessment: All three user requests complete and verified.
Recent Commands Analysis: The most recent operations were the
Arg.Templatecleanup: edits to 4 files removing the field/rendering/tests, followed by verification commands (gofmt/test/lint all passing, grep confirming no remaining references, grep confirming snapshot unaffected).1. Conversation Overview
Primary Objectives:
generators: [azdGenerators.listExtensions, filepaths({ extensions: ['zip'] })](with the required import) instead oftemplate: 'filepaths'forazd extension install.Arg.Templatefield flagged in my review.Session Context: Working in
/workspaces/azure-dev, on branchmain, in thecli/azdGo module. The figspec package generates a TypeScript Fig autocomplete spec (copied into VS Code'sextensions/terminal-suggest/src/completions/azd.ts) for terminal IntelliSense.User Intent Evolution: Started with a focused feature change (matching a VS Code patch), expanded to documentation accuracy review, then to dead-code cleanup. All three are complete.
2. Technical Foundation
cli/azd/internal/figspec/.spec_builder.goto build the spec.typescript_renderer.gorenders the spec;resources/generators.tsis embedded viafigGeneratorDefinitionsTS.Spec/Subcommand/Option/Argstructs intypes.go. Generators are raw TS expressions (e.g."azdGenerators.listExtensions").TestFigSpecin `cmd/figspec_...Created from Copilot CLI via the copilot delegate command.