[L] Change in dart/sdk[main]: [analysis_server] Add `kind`s to LSP document highlights

0 views
Skip to first unread message

Danny Tuppeny (Gerrit)

unread,
May 12, 2026, 12:27:20 PM (21 hours ago) May 12
to Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson

Danny Tuppeny added 2 comments

File pkg/analysis_server/doc/design/features/documentHighlight.md
Line 62, Patchset 1 (Latest):## Kinds
Danny Tuppeny . unresolved

Please check this makes sense and you agree with it (and feel free to nit-pick if it's not how you'd have written it).

Using Write/Read for things like type names feels slightly odd to me, but between what the spec says and TypeScript's behaviour, I think it makes sense to copy.

File pkg/analysis_server/lib/src/computer/computer_document_highlights.dart
Line 157, Patchset 1 (Latest):class _DartDocumentHighlightsVisitor extends GeneralizingAstVisitor<void> {
Danny Tuppeny . resolved

There were a lot of tests updated, and the kinds are in a map separate to the code, so it's probably easier to review the specific choices about what is Read/Write/Text here in the implementation than by reviewing the tests.

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I6a53450038cde31b399b5b1aca5f964083106763
Gerrit-Change-Number: 503060
Gerrit-PatchSet: 1
Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Comment-Date: Tue, 12 May 2026 16:27:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Brian Wilkerson (Gerrit)

unread,
May 12, 2026, 1:53:43 PM (19 hours ago) May 12
to Danny Tuppeny, Keerti Parthasarathy, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Danny Tuppeny and Keerti Parthasarathy

Brian Wilkerson voted and added 2 comments

Votes added by Brian Wilkerson

Code-Review+1

2 comments

File pkg/analysis_server/doc/design/features/documentHighlight.md
Danny Tuppeny . resolved

Please check this makes sense and you agree with it (and feel free to nit-pick if it's not how you'd have written it).

Using Write/Read for things like type names feels slightly odd to me, but between what the spec says and TypeScript's behaviour, I think it makes sense to copy.

Brian Wilkerson

I agree.

Line 75, Patchset 1 (Latest):- `Write` - setters, assignments, declarations, argument names
Brian Wilkerson . unresolved

I'm guessing that you're distinguishing between references to (a) actual setters and (b) things like local variables that appear on the left-hand side of an assignment or fields being assigned to in a constructor's initializer list.

If so, the distinction is valid, but we might want to spell it out more concretely.

Open in Gerrit

Related details

Attention is currently required from:
  • Danny Tuppeny
  • Keerti Parthasarathy
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I6a53450038cde31b399b5b1aca5f964083106763
Gerrit-Change-Number: 503060
Gerrit-PatchSet: 1
Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
Gerrit-Attention: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Keerti Parthasarathy <kee...@google.com>
Gerrit-Comment-Date: Tue, 12 May 2026 17:53:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Danny Tuppeny <da...@tuppeny.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Danny Tuppeny (Gerrit)

unread,
May 12, 2026, 2:18:29 PM (19 hours ago) May 12
to Keerti Parthasarathy, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson and Keerti Parthasarathy

Danny Tuppeny added 1 comment

File pkg/analysis_server/doc/design/features/documentHighlight.md
Line 75, Patchset 1:- `Write` - setters, assignments, declarations, argument names
Brian Wilkerson . unresolved

I'm guessing that you're distinguishing between references to (a) actual setters and (b) things like local variables that appear on the left-hand side of an assignment or fields being assigned to in a constructor's initializer list.

If so, the distinction is valid, but we might want to spell it out more concretely.

Danny Tuppeny

I changed `setters, assignments` to `assignments (setters, variables, initializers)` though I'm not sure if that's exactly what you had in mind. If not, let me know (or if you want to suggest specific text I'm happy to go with it).

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
  • Keerti Parthasarathy
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I6a53450038cde31b399b5b1aca5f964083106763
Gerrit-Change-Number: 503060
Gerrit-PatchSet: 2
Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Attention: Keerti Parthasarathy <kee...@google.com>
Gerrit-Comment-Date: Tue, 12 May 2026 18:18:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Brian Wilkerson <brianwi...@google.com>
unsatisfied_requirement
open
diffy

Brian Wilkerson (Gerrit)

unread,
May 12, 2026, 2:25:03 PM (19 hours ago) May 12
to Danny Tuppeny, Brian Wilkerson, Keerti Parthasarathy, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Danny Tuppeny and Keerti Parthasarathy

Brian Wilkerson voted and added 1 comment

Votes added by Brian Wilkerson

Code-Review+1
Commit-Queue+1

1 comment

File pkg/analysis_server/doc/design/features/documentHighlight.md
Line 75, Patchset 1:- `Write` - setters, assignments, declarations, argument names
Brian Wilkerson . resolved

I'm guessing that you're distinguishing between references to (a) actual setters and (b) things like local variables that appear on the left-hand side of an assignment or fields being assigned to in a constructor's initializer list.

If so, the distinction is valid, but we might want to spell it out more concretely.

Danny Tuppeny

I changed `setters, assignments` to `assignments (setters, variables, initializers)` though I'm not sure if that's exactly what you had in mind. If not, let me know (or if you want to suggest specific text I'm happy to go with it).

Brian Wilkerson

LGTM, thanks.

Open in Gerrit

Related details

Attention is currently required from:
  • Danny Tuppeny
  • Keerti Parthasarathy
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I6a53450038cde31b399b5b1aca5f964083106763
Gerrit-Change-Number: 503060
Gerrit-PatchSet: 2
Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
Gerrit-Attention: Danny Tuppeny <da...@tuppeny.com>
Gerrit-Attention: Keerti Parthasarathy <kee...@google.com>
Gerrit-Comment-Date: Tue, 12 May 2026 18:24:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Brian Wilkerson <brianwi...@google.com>
Comment-In-Reply-To: Danny Tuppeny <da...@tuppeny.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Keerti Parthasarathy (Gerrit)

unread,
May 12, 2026, 2:47:29 PM (18 hours ago) May 12
to Danny Tuppeny, dart-...@luci-project-accounts.iam.gserviceaccount.com, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Danny Tuppeny

Keerti Parthasarathy voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Danny Tuppeny
Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I6a53450038cde31b399b5b1aca5f964083106763
    Gerrit-Change-Number: 503060
    Gerrit-PatchSet: 2
    Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
    Gerrit-Attention: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Comment-Date: Tue, 12 May 2026 18:47:27 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Keerti Parthasarathy (Gerrit)

    unread,
    May 12, 2026, 2:48:19 PM (18 hours ago) May 12
    to Danny Tuppeny, dart-...@luci-project-accounts.iam.gserviceaccount.com, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org
    Attention needed from Danny Tuppeny

    Keerti Parthasarathy voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Danny Tuppeny
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I6a53450038cde31b399b5b1aca5f964083106763
    Gerrit-Change-Number: 503060
    Gerrit-PatchSet: 2
    Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
    Gerrit-Attention: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Comment-Date: Tue, 12 May 2026 18:48:16 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    dart-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

    unread,
    May 12, 2026, 3:04:33 PM (18 hours ago) May 12
    to Danny Tuppeny, Keerti Parthasarathy, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org

    dart-...@luci-project-accounts.iam.gserviceaccount.com submitted the change

    Change information

    Commit message:
    [analysis_server] Add `kind`s to LSP document highlights

    Populates the `kind` on the Document Highlights we return. This allows colouring reads and writes differently (which it turns out VS Code does by default).

    The options are a bit limited (Read/Write/Text) and using Read/Write for things like type names feels slightly odd, but the spec does seem to encourage this and it's what TypeScript is doing.

    Fixes https://github.com/dart-lang/sdk/issues/62929
    Change-Id: I6a53450038cde31b399b5b1aca5f964083106763
    Commit-Queue: Brian Wilkerson <brianwi...@google.com>
    Commit-Queue: Keerti Parthasarathy <kee...@google.com>
    Reviewed-by: Brian Wilkerson <brianwi...@google.com>
    Reviewed-by: Keerti Parthasarathy <kee...@google.com>
    Files:
    • M pkg/analysis_server/doc/design/features/documentHighlight.md
    • M pkg/analysis_server/lib/src/computer/computer_document_highlights.dart
    • M pkg/analysis_server/lib/src/lsp/handlers/handler_document_highlights.dart
    • M pkg/analysis_server/test/lsp/document_highlights_test.dart
    Change size: L
    Delta: 4 files changed, 634 insertions(+), 261 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Brian Wilkerson, +1 by Keerti Parthasarathy
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I6a53450038cde31b399b5b1aca5f964083106763
    Gerrit-Change-Number: 503060
    Gerrit-PatchSet: 3
    Gerrit-Owner: Danny Tuppeny <da...@tuppeny.com>
    Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
    Gerrit-Reviewer: Keerti Parthasarathy <kee...@google.com>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages