--
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.
--
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.
I'm wondering, won't Scala also provide the quick fix in its error message? If yes, maybe can simply parse the reported compiler error and have an ad-hoc quick fix for this.
I'm wondering, won't Scala also provide the quick fix in its error message? If yes, maybe can simply parse the reported compiler error and have an ad-hoc quick fix for this.
Funny, I had that idea too. :-)
It might make sense to define a simple protocol so that the compiler can emit recommendations in an machine-readable format, so one doesn't have to search all strings for magic keywords.
The issue is that at least for view bounds that they get desugared extremely early, so I'm not sure if there is a reliable way to reverse-engineer implicit parameters to view bounds (or even tell desugared ones and user-defined ones apart), so maybe it is easier to fix at the IDE side.
For procedures, it should be a bit easier to fix regardless of the approach.
I'm mostly bringing this up because I know I'm not the person efficient at digging through those dozens of layers of indirection Eclipse seems to mandate, but without IDE support it is questionable whether I can get this into 2.11, meaning that we will be stuck with that language cruft for at least an additional two years.
So if there is a good soul who can handle the IDE specific parts of this migration or can give me some hints like Simon on how to do it in scala-refactoring properly, this would be extremely great!
Bye,
Simon
Wow, thanks a lot, Simon!
Now that I managed to make SBT work again, I'll fix my stuff which piled up for the last few days and then look into the refactoring code.
--
I took a look at this too before I saw that you (Simon S) already did. As you found, there is no real way to determine if a type parameter was using a view bound in scala-refactoring.
I didn't think of checking if the implicit evidence name matched the compiler generated naming scheme, so I gave up on using scala-refactoring. Instead I tried a different way: using scalariform's parser you can detect the view bounds perfectly and pull them out to a parameter list.
I've got a quick fix for this working (handles multiple view bounds in a type parameter list, appending to an existing implicit parameter list or adding a new one), but the code is messy and it'll be a day or two before I have a chance to clean it up. I'll put it on a branch when it's ready.
Is there a warning for this already? I tried out 2.11 M4 as well as the nightly from yesterday but I didn't get any warning when using view bounds. Right now I'm triggering the quickfix by causing a completely unrelated error.
Is there a warning for this already? I tried out 2.11 M4 as well as the nightly from yesterday but I didn't get any warning when using view bounds. Right now I'm triggering the quickfix by causing a completely unrelated error.
Is there a warning for this already? I tried out 2.11 M4 as well as the nightly from yesterday but I didn't get any warning when using view bounds. Right now I'm triggering the quickfix by causing a completely unrelated error.
No, not yet. The language change depends a bit on having decent IDE support.
--