Custom semantic highlighting
For now semantic highlighting is hard-coded and it's not possible for user to define his own rules. It'll be nice to have extension point there.
This requires extracting some stable interfaces as for now highlighting code is purely procedural.
This requires extracting some stable interfaces as for now highlighting code is purely procedural.
Leave a comment
on 2013-12-05 01:37 *
By Simon Schäfer
on 2013-12-05 13:49 *
By Mirco Dotta
I like the idea! But I have a different approach in mind to offer the functionality. What if we would allow user to extend semantic highlighting via a preference page, ideally using a format that could be easily shared. Imagine I'm using Akka and want all calls to `actor` to be colored like keywords (because it feels like a primitive). In the setting page I'd declare something like the following: "class: akka.actor.ActorDsl", "method: actor", "style: keyword".
on 2013-12-05 14:11 *
By Jerzy.Muller
@Mirco: that will be great to have also, but it requires underlying mechanism to be more modular and configurable.
For now some symbols are extracted using Traversals, some using chained if/else with methods from Symbol and some even with Scalariform parser. Also, definition of symbol is in one place, method for it's extraction in second and style for highlighting in third.
I'm thinking about creating some common interface (with subclasses for different methods of extraction) that encapsulates symbol definition, method of extraction and all highlighting preferences. Then adding something like generic configuration for users should be easy and if something exceed configuration you can always create plugin and hack your own implementation.
For now some symbols are extracted using Traversals, some using chained if/else with methods from Symbol and some even with Scalariform parser. Also, definition of symbol is in one place, method for it's extraction in second and style for highlighting in third.
I'm thinking about creating some common interface (with subclasses for different methods of extraction) that encapsulates symbol definition, method of extraction and all highlighting preferences. Then adding something like generic configuration for users should be easy and if something exceed configuration you can always create plugin and hack your own implementation.
Mechanism for creating custom semantic annotations
This mechanism is based on custom reconciliers (like implicit
highlighting), and provides easy way to extends Scala IDE with ability to
annotate your own method calls.
Fixes #1001989
Branch: master
Commit: scala-ide:c4167207a9
This mechanism is based on custom reconciliers (like implicit
highlighting), and provides easy way to extends Scala IDE with ability to
annotate your own method calls.
Fixes #1001989
Branch: master
Commit: scala-ide:c4167207a9