guillermooo / dart-sublime-bundle

Sublime Text 3 Dart Package
BSD 3-Clause "New" or "Revised" License
264 stars 42 forks source link

Comment containing ' in argument list break syntax highlighting #491

Closed madsager closed 9 years ago

madsager commented 9 years ago
void f(a,
       // This second argument isn't used.
       b) {
  print(a);
}

main() {
  f('hello', 'world');
}

Maybe the ' in the comment is seen as a string start?

guillermooo commented 9 years ago

Thanks for the report!

Going forward, we'll have a problem maintaining the syntax def file for Dart that GH uses.

As of recently, Sublime Text includes two types of syntax definition formats:

My plan is to switch to .sublime-syntax and never look back, but that will make the tmLanguage used by GH to fall out of sync...

One idea would be to keep the tmLanguage very simple (now it tries to do fancy stuff with functions) and only ever update it for new keywords introduced into Dart.

This way, GH would still show useful highlighting for Dart code and the syntax def actually used by ST could evolve on its own.

The tmLanguage format is hard to maintain and not very flexible, so we should leave it behind.