Skip to content

Add support for dot shorthands#79

Open
erikas-taroza wants to merge 3 commits intozed-extensions:mainfrom
erikas-taroza:dot-shorthands
Open

Add support for dot shorthands#79
erikas-taroza wants to merge 3 commits intozed-extensions:mainfrom
erikas-taroza:dot-shorthands

Conversation

@erikas-taroza
Copy link
Copy Markdown
Contributor

@erikas-taroza erikas-taroza commented Apr 20, 2026

Updates tree-sitter-dart for the grammar and adds highlighting.

It seems there is still some errors present in the syntax tree, mainly when using a dot shorthand with the const keyword (ex. const .function()) but this will have to be fixed in https://github.com/UserNobody14/tree-sitter-dart

Before:
Screenshot from 2026-04-22 08-35-23
After:
Screenshot from 2026-04-22 08-34-47

void main() {
  final MyClass myClass = .new("");
  final MyClass myClass2 = .named("");
  const MyEnum myEnum = .one;
}

class MyClass {
  final String field;

  MyClass(this.field);
  MyClass.named(this.field);
}

enum MyEnum { one, two }

@cla-bot cla-bot Bot added the cla-signed label Apr 20, 2026
Copy link
Copy Markdown
Contributor

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Looks good overall, could you please share a quick before/after, please?

@erikas-taroza
Copy link
Copy Markdown
Contributor Author

Thanks for this! Looks good overall, could you please share a quick before/after, please?

I have updated the first comment with screenshots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants