Re: [scala-ide-dev] I want to add a small feature. Help me contribute?

59 views
Skip to first unread message

Mirco Dotta

unread,
May 1, 2013, 7:48:08 AM5/1/13
to scala-...@googlegroups.com
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.
 
 


---------------
Mirco Dotta
PSE-D, 1015 Lausanne, Switzerland
Twitter: @mircodotta

See you at Scala Days 2013 in NYC!
June 10th - June 12th








David Barri

unread,
May 10, 2013, 5:29:45 PM5/10/13
to scala-...@googlegroups.com
Hello!

So I'm back and finally got a few hours to sit down and tinker with this. I followed all the instructions on the wiki: I've got the right Eclipse, the right JVM, installed all the required Eclipse plugins, it compiles, I've setup the tests as per the doco. I'm so close to getting this working but I've hit a roadblock. I just can't seem to get around this error. I keep getting this when I try to run the tests from Eclipse:

!ENTRY org.eclipse.osgi 2 0 2013-05-10 22:28:56.191
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-05-10 22:28:56.191
!MESSAGE Bundle org.eclipse.equinox.weaving.hook_1.0.100.v20110502 [181] was not resolved.

I seem to have both plugins:
> find | fgrep weaving.hook | sort
./plugins/org.eclipse.equinox.weaving.hook.source_1.0.100.v20110502.jar
./plugins/org.eclipse.equinox.weaving.hook_1.0.100.v20110502.jar
./plugins/org.eclipse.equinox.weaving.hook_1.0.200.I20120427-0800.jar

Any ideas?

iulian dragos

unread,
May 15, 2013, 6:04:04 AM5/15/13
to scala-ide-dev
I don't know what it could be, but I only have the last entry (1.0.200...). If you check the launch configuration, Plugins tab, do you have the weaving.hook bundle ticked? Make sure it's 1.0.200.I20120427-0800. Also, try "Validate Plugins", and eventually "Add Required Plugins" from the same page.

hope this helps,
iulian


--
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.
 
 



--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais
Reply all
Reply to author
Forward
0 new messages