swiftlang / swiftlang/swift-syntax

Diagnostic formatter should highlight trivia in between consecutive highlight nodes

Open
#2,208 6 comments 0 reactions 1 assignee Claimed by @Matejkob View on GitHub
enhancement
Dominant language
Swift
Stars
3.7k
Forks
553
Avg merge
5d 13h
Merged PRs (30d)
16

Description

Currently, if a diagnostic has two nodes to highlight, it will highlight them individually, leaving the trivia in between them non-highlighted. The easiest way to see this is by running

```bash
swift-parser-cli print-diags -s 'for x = 1; x < 10; x++ {}'
```

Screenshot 2023-09-16 at 09 14 02

Note that the space between `x` and `=` should also be highlighted.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.