slackhq / vscode-hack

Hack language & HHVM debugger support for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=pranayagarwal.vscode-hack
MIT License
76 stars 39 forks source link

Highlight class names in new expression tree syntax #123

Closed Wilfred closed 3 years ago

Wilfred commented 3 years ago

Hack is exploring expression trees, and it'd be great to have highlighting for this new syntax ready to go.

Given the code

$x = Foo`1 + 2`;

highlight Foo as a type.

Before:

Screenshot 2021-07-20 at 18 33 39

After:

Screenshot 2021-07-20 at 18 30 48

Wilfred commented 3 years ago

I'll update this to handle namespaces. I don't think it's possible to mark a pull request as 'draft' once it's published, unfortunately.

Wilfred commented 3 years ago

OK, this now does the right thing with all of the following:

$x = Foo`1`;
$y = \Foo`1`;
$z = bar\Foo`1`;

Should be good to merge now :)

Wilfred commented 3 years ago

Improved case sensitivity in regexps, so we correctly handle Foo`true`.