Hi all,
Hi David,
I want to add a small feature to the Scala Eclipse plugin and get it accepted. I was wondering if you could help me and let me know what I need to do to allow this to happen.
Absolutely! We are glad to welcome new contributors to the project.
Starting small, what I want to do is this: Today I realised that the Scala syntax highlighter/formatter allows you to provide a format for "Methods", but then doesn't make the distinction between method declarations and method invocations. One of the great things about Scala is its conciseness and I find that when I have lots of small, one-line methods all close by, it becomes hard to see. Therefore I'd like to make a change to the plugin so that users can specify separate colours for the method name in the signature, and for references to the method, so that I can leave the references as is and have the method definitions shine.
Before starting I'd like to know if this change would be welcomed, and if so, what I need to get a patch accepted once I create it.
So, you want to have different colors for method declarations and references. I see the interest, so you have my +1.
About the implementation, I am considering two alternatives.
1) Add a new semantic class in the Semantic Highlighting component that will allow you to distinguish method declaration vs references. To do this, it should be enough to:
* (Ask questions when you get stuck, as I'm sure I forgot a ton of other details :))
2) However, I am not convinced the one above is the best way to go. I'm thinking we should be able to categorize declaration while tokenizing the source, as the grammar of the language allows us to guess that any word following a `def` is a
method declaration. Basically, instead of plugging the functionality in Semantic Highlighting, we would do it in the Syntax Highlighting. I see the following interesting advantages: 1) it's much faster, 2) simpler, 3) we could easily do the
same for `val`, `var`, ..., and 4) you don't need to enable semantic highlighting. The only possible issue I see with this approach is that when semantic highlighting is enabled, the method declaration coloring that is applied during syntax
highlighting will be overruled by the one done during semantic highlighting :-/ I can't tell you for sure this will happen, but it's likely. Which means that you would need to also patch semantic highlighting to correctly handle this case.
I hope the above wasn't too much information :)
-- Mirco
And I don't know very much about Eclipse plugin dev either for that matter. I'll figure it out, but any advice or points in the right direction would be appreciated. :)
Thanks all!
David
--
You received this message because you are subscribed to the Google Groups "Scala IDE Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.