Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Improves hook parsing and editing robustness by adding compatibility for Claude-style hook structures and by switching hook file updates to JSONC-aware, comment-preserving edits.
Changes:
- Add Claude-style nested
matcher/hooksparsing support when reading Copilot hook files. - Refactor Claude hook parsing to use a shared extraction helper and expand test coverage for these cases.
- Update hook file editing to parse JSONC and apply targeted JSON edits (preserving comments) when appending a new hook.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/common/promptSyntax/hookCompatibility.test.ts | Adds tests ensuring Copilot hook parsing accepts Claude-style nested matcher structures and type-omitted commands. |
| src/vs/workbench/contrib/chat/test/common/promptSyntax/hookClaudeCompat.test.ts | Adds unit tests for the new shared extractHookCommandsFromItem helper. |
| src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.ts | Switches Copilot parsing to use the shared extraction helper (supports nested matcher forms). |
| src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.ts | Introduces extractHookCommandsFromItem and uses it from Claude parsing. |
| src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.ts | Updates hook insertion to parse JSONC and use jsonEdit setProperty/applyEdits to preserve comments. |
src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…mpat.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
mjbvz
approved these changes
Feb 12, 2026
pwang347
added a commit
that referenced
this pull request
Feb 12, 2026
lramos15
pushed a commit
that referenced
this pull request
Feb 12, 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.
No description provided.