bscan / RakuNavigator

Raku language support and language server
MIT License
50 stars 3 forks source link

Incorrect grammar highlighting #1

Closed emakei closed 2 years ago

emakei commented 2 years ago

https://ibb.co/LzhHPQM

bscan commented 2 years ago

Thanks for the report. Do you have the full file where it's not working? It looks like a screenshot of this file: https://github.com/Raku/examples/blob/master/categories/parsers/CSSGrammar.pm

Which is working fine on my local copy and on Github (both use the same rules based on the atom extension).

Highlighting

bscan commented 2 years ago

Update: I see the issue. I can reproduce your screenshot if I set the Language to Perl 6 instead of Raku. What's the file extension you are using? .raku and .rakumod are the most reliable. You can also manually change the language in the bottom right to Raku to enable this syntax highlighting instead.

emakei commented 2 years ago

Well yes. It works exactly as you said. I have no idea why on my mac was Perl 6 and not Raku. This time (on my work) i just installed extension and it works as on your screenshot.

bscan commented 2 years ago

Excellent. This does expose an important issue that vscode will often label Raku scripts as Perl 6. I just modified the language server to provide syntax checking on "Perl 6" scripts as well as "Raku":

"activationEvents": [
    "onLanguage:raku",
    "onLanguage:perl6"
],

Thanks for the bug report.