Skip to content

Hook parsing fixes#294745

Merged
pwang347 merged 6 commits intomainfrom
pawang/hooksParsingFixes
Feb 12, 2026
Merged

Hook parsing fixes#294745
pwang347 merged 6 commits intomainfrom
pawang/hooksParsingFixes

Conversation

@pwang347
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings February 12, 2026 01:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/hooks parsing 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.

pwang347 and others added 5 commits February 11, 2026 17:48
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>
@pwang347 pwang347 marked this pull request as ready for review February 12, 2026 01:53
@pwang347 pwang347 enabled auto-merge (squash) February 12, 2026 01:55
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 12, 2026
@pwang347 pwang347 merged commit 962b547 into main Feb 12, 2026
18 checks passed
@pwang347 pwang347 deleted the pawang/hooksParsingFixes branch February 12, 2026 02:31
pwang347 added a commit that referenced this pull request Feb 12, 2026
lramos15 pushed a commit that referenced this pull request Feb 12, 2026
* Hook menu title rename (#294645)

* Update hook settings (#294732)

* Add customizations telemetry (#294741)

* Hook parsing fixes (#294745)
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.

2 participants

Comments