Skip to content

@annotation super. appears parsed differently than @annotation this. #5247

Closed

Description

@matanlurey

I'm guessing the grammar change was not reflected the same way, ... or something :)

import 'package:meta/meta.dart';

final class Base {
  const Base(@mustBeConst this.code);
  final int code;
}

final class Super extends Base {
  const Super(@mustBeConst super.code);
}

Real example:

Screenshot 2024-09-03 at 11 47 26 PM

Activity

  1. added this to the v3.98.0 milestone on Sep 4, 2024
  2. added
    in editorRelates to code editing or language features
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    on Sep 4, 2024
  3. DanTup commented on Sep 4, 2024

    @DanTup
    Member

    Yeah, I can repro this - what's odd is that unlike most of this kind of issue, it seems to be the semantic tokens. If I disable semantic highlighting so the textmate grammar is used, it's consistent:

    image

    But with semantic tokens enabled, it's inconsistent:

    image

    It appears we don't have any semantic token on the super version.

    image

  4. DanTup commented on Sep 6, 2024

    @DanTup
    Member

    This is fixed by dart-lang/sdk@40b9153

    The change is in the analysis server so will show up in an SDK update (not a Dart-Code update).

  5. added
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    on Sep 30, 2024
  6. stan-at-work commented on Oct 1, 2024

    @stan-at-work

    @DanTup What type of documentation is this ?

    image

  7. DanTup commented on Oct 1, 2024

    @DanTup
    Member

    @stan-at-work it's something built in to VS Code to help debug syntax highlighting. You can enable it with this command:

    Screenshot 2024-10-01 at 08 51 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions