Replace brace matching with property-argument highlighting#16
Closed
willibrandon wants to merge 2 commits intomainfrom
Closed
Replace brace matching with property-argument highlighting#16willibrandon wants to merge 2 commits intomainfrom
willibrandon wants to merge 2 commits intomainfrom
Conversation
Implements property-argument connection highlighting to match VS Code extension behavior. When cursor is on a template property or argument, both are highlighted visually. Includes ESC dismissal, multi-line support, and navigation improvements. - Remove all brace matching code and tests - Add PropertyArgumentHighlighter with multi-line template support - Fix navigation to use cursor position instead of range midpoint - Update documentation to describe new feature - Add tests for property-argument highlighting Closes #15
There was a problem hiding this comment.
Pull Request Overview
This PR replaces the extension's brace matching functionality with property-argument highlighting to better match VS Code behavior. Instead of just highlighting matching braces, the extension now visually connects template properties with their corresponding arguments, making it easier to understand which argument corresponds to which property in complex multi-line Serilog calls.
- Replaced brace matching with property-argument highlighting that connects template properties to their values
- Fixed navigation provider to use actual cursor position instead of range midpoint
- Added comprehensive ESC key dismissal support for temporarily hiding highlights
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| SerilogSyntax/Tagging/SerilogBraceMatcher.cs | Removed entire brace matching implementation |
| SerilogSyntax/Tagging/PropertyArgumentHighlighter.cs | Added new property-argument highlighter with multi-line support |
| SerilogSyntax/Tagging/PropertyArgumentHighlightState.cs | Added state management for highlights with ESC dismissal |
| SerilogSyntax/Navigation/SerilogNavigationProvider.cs | Fixed to use actual cursor position instead of range midpoint |
| SerilogSyntax/Classification/SerilogClassificationFormats.cs | Updated format definition for property-argument highlighting |
| SerilogSyntax.Tests/Tagging/PropertyArgumentHighlighterTests.cs | Added comprehensive test coverage for new highlighting |
Comments suppressed due to low confidence (1)
SerilogSyntax/Tagging/PropertyArgumentHighlighter.cs:1
- [nitpick] The class is declared with primary constructor syntax but later has a separate constructor implementation. This is inconsistent - either use primary constructor parameters consistently or stick to traditional constructor implementation.
using Microsoft.VisualStudio.Text;
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- Remove unused textBuffer parameter from SerilogSuggestedActionsSource - Remove unused hasExceptionParameter from FindArgumentAtPosition - Remove unused foundComma variable in template extraction
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.
Description
The extension provided brace matching that only highlighted matching braces
{and}when the cursor was positioned on them. This implementation replaces it with property-argument highlighting that visually connects template properties with their corresponding arguments, matching the behavior already implemented in the VS Code version of the extension.Root cause: Brace matching was limited - it only showed brace pairs without indicating the relationship between template properties and their argument values. Users couldn't easily see which argument corresponded to which property in complex multi-line Serilog calls.
Solution:
Key Behaviors
{UserId}in the template, both the property (including braces) and its corresponding argument are highlightedTesting
Closes #15