Releases: willibrandon/serilog-syntax
Serilog Syntax Highlighting v0.7.2
Installation
Download the attached VSIX file and double-click to install in Visual Studio 2022.
What's Changed
Fixed
- Navigation to arguments now properly uses cursor position
- Visual Studio was passing line spans instead of cursor position to ISuggestedActionsSource
- Navigation provider now correctly uses ITextView.Caret.Position for accurate cursor detection
- Fixes issue where navigation actions would not appear when cursor was on template properties
Requirements
- Visual Studio 2022 (17.0) or later
- .NET Framework 4.7.2 or later
Full Changelog: https://github.com/willibrandon/serilog-syntax/blob/main/CHANGELOG.md
Serilog Syntax Highlighting v0.7.1
Installation
Download the attached VSIX file and double-click to install in Visual Studio 2022.
What's Changed
Fixed
- Added ESC key dismissal for property-argument highlighting
- Press ESC to temporarily dismiss property-argument highlights
- Highlights automatically restore when cursor moves to a new position
- Consistent with brace matching ESC dismissal behavior
- Uses Visual Studio command handler chain for proper key handling
Requirements
- Visual Studio 2022 (17.0) or later
- .NET Framework 4.7.2 or later
Full Changelog: https://github.com/willibrandon/serilog-syntax/blob/main/CHANGELOG.md
Serilog Syntax Highlighting v0.7.0
Installation
Download the attached VSIX file and double-click to install in Visual Studio 2022.
What's Changed
Added
- Property-argument highlighting for Serilog templates (#15, #17)
- Highlights the connection between template properties and their corresponding arguments
- When cursor is on a template property, both the property and its argument are highlighted
- When cursor is on an argument, both the argument and its template property are highlighted
- Press ESC to dismiss highlights
- Supports all string formats: regular, verbatim (@"..."), and raw strings ("""...""")
- Handles complex scenarios: multi-line templates, collection expressions, anonymous objects
- Correctly handles LogError with exception parameters
- Supports positional parameters ({0}, {1}) including duplicates
- Excludes ExpressionTemplate contexts where properties have no corresponding arguments
Requirements
- Visual Studio 2022 (17.0) or later
- .NET Framework 4.7.2 or later
Full Changelog: https://github.com/willibrandon/serilog-syntax/blob/main/CHANGELOG.md
Serilog Syntax Highlighting v0.6.2
Installation
Download the attached VSIX file and double-click to install in Visual Studio 2022.
What's Changed
Fixed
- Multi-line template navigation for early properties in verbatim strings
- Navigation from early template properties (like
{AppName},{Version},{Environment}) now works correctly in multi-line verbatim strings - Fixed ReconstructMultiLineTemplate search range to properly find string termination beyond initial 5-line limit
- Extended search range from
currentLine + 5toMath.Max(currentLine + 5, serilogCallLine + 20)for better coverage - Resolves issue where navigation worked for later properties but failed for early ones in long multi-line templates
- Navigation from early template properties (like
Requirements
- Visual Studio 2022 (17.0) or later
- .NET Framework 4.7.2 or later
Full Changelog: https://github.com/willibrandon/serilog-syntax/blob/main/CHANGELOG.md
Serilog Syntax Highlighting v0.6.1
Installation
Download the attached VSIX file and double-click to install in Visual Studio 2022.
What's Changed
Fixed
- Multi-line Serilog template navigation position calculation (#11, #14)
- Navigation from template properties to arguments now works correctly when Serilog calls span multiple lines
- Fixed template detection for multi-line verbatim strings (
@"...") and raw string literals ("""...""") - Corrected argument position calculation by starting after comma delimiter instead of at comma
- Added fallback to ReconstructMultiLineTemplate() when cursor is on first line of multi-line template
- Enhanced FindArgumentInMultiLineCall() to properly handle template end position calculation
- LogError calls with exception parameters (#12, #13)
- Syntax highlighting now works correctly for
logger.LogError(exception, "template {Property}", arg)patterns - Fixed string literal parser to skip exception constructor parameter and find actual message template
- Added IsLogErrorWithExceptionParameter() method to detect LogError patterns with exception parameters
- Enhanced FindStringLiteral() with skipFirstString parameter to locate correct message template
- Handles both string literal and variable exception constructors
- Syntax highlighting now works correctly for
Requirements
- Visual Studio 2022 (17.0) or later
- .NET Framework 4.7.2 or later
Full Changelog: https://github.com/willibrandon/serilog-syntax/blob/main/CHANGELOG.md
Serilog Syntax Highlighting v0.6.0
Installation
Download the attached VSIX file and double-click to install in Visual Studio 2022.
What's Changed
Added
- Automatic theme-aware WCAG-compliant colors (#9)
- Colors now automatically switch between Light and Dark Visual Studio themes
- All colors maintain ≥4.5:1 contrast ratio for WCAG AA compliance
- SerilogThemeColors service with VSColorTheme.ThemeChanged event handling
- Theme detection using background color heuristic for custom theme compatibility
- Semantic color grouping: properties (blue family), operators (warm colors), functions (purple family)
- All 15 classification format definitions converted to use SerilogClassificationFormatBase
- Automatic color updates when themes change without VS restart
Fixed
- ExpressionTemplate multi-line highlighting regression
- Removed overlapping classifications that caused highlighting artifacts
- Simplified regex pattern detection for better reliability
- Added deduplication logic to prevent classification conflicts
Requirements
- Visual Studio 2022 (17.0) or later
- .NET Framework 4.7.2 or later
Full Changelog: https://github.com/willibrandon/serilog-syntax/blob/main/CHANGELOG.md
Serilog Syntax Highlighting v0.5.2
Installation
Download the attached VSIX file and double-click to install in Visual Studio 2022.
What's Changed
Fixed
- Multi-line ForContext patterns now correctly highlighted (#3)
- Properties in templates like
{@Items}are now highlighted when ForContext is on one line and logging method on the next - Added SyntaxTreeAnalyzer fallback for complex multi-line patterns
- Enhanced regex detection for ForContext chains split across lines
- Properties in templates like
- Multi-line outputTemplate patterns now correctly highlighted (#5)
- Properties like
{Timestamp}are now highlighted whenoutputTemplate:parameter is on one line and template string on the next - Enhanced concatenated template fragment detection
- Added dedicated regex for multi-line outputTemplate detection
- Properties like
- ForContext logger variables now correctly detected (#7)
- Template properties like
{ListenUri}are now highlighted when using logger variables from ForContext calls (e.g.,var program = log.ForContext<Program>()) - Enhanced SerilogCallDetector with dotted method patterns (
.Information,.Debug, etc.) - Added duplicate processing detection to prevent overlapping matches between regex patterns
- Separated quick check patterns into logical arrays for better maintainability
- Template properties like
Added
- Performance benchmarking infrastructure for overlap detection algorithms
- Benchmarks comparing O(n²) vs binary search vs SortedSet approaches
- Empirical validation showing original O(n²) algorithm performs best for typical usage patterns
Requirements
- Visual Studio 2022 (17.0) or later
- .NET Framework 4.7.2 or later
Full Changelog: https://github.com/willibrandon/serilog-syntax/blob/main/CHANGELOG.md
Serilog Syntax Highlighting v0.5.1
Installation
Download the attached VSIX file and double-click to install in Visual Studio 2022.
What's Changed
Fixed
- Template properties in concatenated strings are now correctly highlighted (#1)
- Properties in all string fragments of a concatenation chain are now detected
- Handles both line-by-line processing (how VS sends text) and full-span processing
- Supports various concatenation patterns:
" +,",, and mixed regular/verbatim strings - Example: In
"User {Id}" + "Name {Name}", both{Id}and{Name}are now highlighted
- Improved escape sequence handling in string literals
- Correctly counts consecutive backslashes to determine if a character is escaped
- Handles complex patterns like
\\\"(escaped backslash followed by quote)
- Enhanced verbatim string (
@"...") detection in concatenated contexts
Requirements
- Visual Studio 2022 (17.0) or later
- .NET Framework 4.7.2 or later
Full Changelog: https://github.com/willibrandon/serilog-syntax/blob/main/CHANGELOG.md
Serilog Syntax Highlighting v0.5.0
Installation
Download the attached VSIX file and double-click to install in Visual Studio 2022.
What's Changed
Added
- Full support for Serilog.Expressions syntax highlighting
- Filter expressions in
Filter.ByExcluding()andFilter.ByIncludingOnly() - Expression templates with
ExpressionTemplateclass - Conditional expressions in
WriteTo.Conditional() - Computed properties in
Enrich.WithComputed()
- Filter expressions in
- Expression language syntax elements
- Operators:
and,or,not,like,in,is null,=,<>,>,>=,<,<= - Functions:
StartsWith(),EndsWith(),Contains(),Length(),Has(), etc. - String literals with escape sequences
- Numeric and boolean literals
- Property paths with dot notation:
User.Name,Order.Customer.Address.City - Case-insensitive operators:
cisuffix for string comparisons
- Operators:
- Expression template control flow directives
{#if},{#else},{#elseif},{#end}for conditional rendering{#each}for iteration- Built-in properties:
@t,@m,@l,@x,@i,@p,@tr,@sp - Nested directive support with proper scope tracking
- Brace matching for expression templates
- Consistent with Visual Studio standard behavior
- Works across multi-line expression templates
- Handles nested directives correctly
Requirements
- Visual Studio 2022 (17.0) or later
- .NET Framework 4.7.2 or later
Full Changelog: https://github.com/willibrandon/serilog-syntax/blob/main/CHANGELOG.md
Serilog Syntax Highlighting v0.4.5
Installation
Download the attached VSIX file and double-click to install in Visual Studio 2022.
What's Changed
Fixed
- Unclosed properties with format or alignment specifiers no longer cause highlight spillover
- Properties like
{@PerformanceData,without closing brace no longer highlight subsequent text - Format specifiers like
{Timestamp:HH:mm:ssproperly stop at pipes and opening braces - Alignment specifiers like
{Name,10properly stop at pipes and opening braces - Multiple unclosed properties in a template are handled independently
- Prevents visual confusion when typing incomplete templates
- Properties like
Requirements
- Visual Studio 2022 (17.0) or later
- .NET Framework 4.7.2 or later
Full Changelog: https://github.com/willibrandon/serilog-syntax/blob/main/CHANGELOG.md