Skip to content

Add quick fix actions for invalidConfigSection warning#346

Merged
garrytrinder merged 5 commits intomainfrom
copilot/add-quick-fix-actions-invalid-config
Mar 2, 2026
Merged

Add quick fix actions for invalidConfigSection warning#346
garrytrinder merged 5 commits intomainfrom
copilot/add-quick-fix-actions-invalid-config

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

  • Understand codebase structure and existing code-action patterns
  • Add registerInvalidConfigSectionFixes in src/code-actions.ts with two quick fix actions:
    • "Remove section" - removes the orphaned config section from the document
    • "Link to plugin..." - shows a quick pick of plugins without configSection, then adds the property
  • Register the new command for interactive plugin linking
  • Update test assertions for provider count
  • Create test fixture config-invalid-config-section.json
  • Add tests for the new code actions
  • Validate with lint and compile
  • Fix duplicate command registration error in tests (try-catch guard)
  • Update CHANGELOG.md with new quick fix entries
  • Update README.md Quick Fixes section
Original prompt

This section details on the original issue you should resolve

<issue_title>For the invalidConfigSection warning, add quick fix actions</issue_title>
<issue_description>When we show the invalidConfigSection section, it would be helpful to add quick fix actions, such as Remove section and Link to plugin. For the latter it would be great to show a list of configured plugins for the user to select from and then add the configSection property to it, although not sure if that's possible in the VSCode UI.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add quick fix actions for invalidConfigSection warning Add quick fix actions for invalidConfigSection warning Feb 27, 2026
@garrytrinder
Copy link
Member

@copilot fix the failed tests

Copy link
Contributor Author

Copilot AI commented Feb 27, 2026

@copilot fix the failed tests

Fixed in 5b92e6b. The linkConfigSectionToPlugin command was being registered multiple times across tests, causing Error: command already exists. Wrapped the command registration in try-catch to handle duplicate registration gracefully, and updated the subscription count assertion from 17 to 16.

@garrytrinder
Copy link
Member

@copilot update this PR to include changelog and readme updates following the guidelines in AGENTS.md

Copy link
Contributor Author

Copilot AI commented Feb 27, 2026

@copilot update this PR to include changelog and readme updates following the guidelines in AGENTS.md

Added in 6e6e97d. Updated CHANGELOG.md with two new entries under [1.13.0] - UnreleasedAdded: and added the two new quick fixes to the README.md Quick Fixes section.

@garrytrinder garrytrinder force-pushed the copilot/add-quick-fix-actions-invalid-config branch from 6e6e97d to 95741d4 Compare March 2, 2026 10:08
@garrytrinder garrytrinder marked this pull request as ready for review March 2, 2026 10:14
Copilot AI and others added 4 commits March 2, 2026 11:39
Add "Remove section" and "Link to plugin..." quick fix code actions
for the invalidConfigSection warning. The remove action deletes the
orphaned config section. The link action shows a quick pick of plugins
without a configSection and adds the property to the selected plugin.

Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
Wrap the linkConfigSectionToPlugin command registration in try-catch
to handle cases where the command is already registered (e.g., during
test runs that call registerCodeActions multiple times). Update the
subscription count assertion from 17 to 16 accordingly.

Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
@garrytrinder garrytrinder force-pushed the copilot/add-quick-fix-actions-invalid-config branch from 95741d4 to 9873223 Compare March 2, 2026 11:43
- Show plugin index in quick pick when duplicate plugin names exist
- Add CHANGELOG entries for new quick fixes
- Add README entries for remove and link quick fixes
@garrytrinder garrytrinder merged commit ab59bc9 into main Mar 2, 2026
3 checks passed
@garrytrinder garrytrinder deleted the copilot/add-quick-fix-actions-invalid-config branch March 2, 2026 12:05
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.

For the invalidConfigSection warning, add quick fix actions

2 participants