navigate to the implementation of a data-type or a function - eclipse

I was wondering if there was the equivalent of "Ctrl+left-click" in eclipse for java, that takes me to the implementation of a method or a data-type in Rascal. I'm finding it a little hard to sort through a list of references brought up by doing a "Ctrl+H" search everytime.
Thanks,

The short answer is: not yet.
The longer answer is: we are working hard on a type checker and compiler for Rascal and those will provide the basic information for jumping to definitions, uses, and the like. As soon as that information is available we will integrate it in Eclipse.

Related

Online view of what the Scala.js compiler generates

Is there a page somewhere that allows me to write short snippets in Scala and to check the corresponding (possibly optimised) JavaScript spit out by the Scala.js compiler?
Would be great for short demos to friends and colleagues.
ScalaFiddle supports this feature, although it's hidden. Write your code on the left, then hit Ctrl+J. The optimized generated code appears on the right. Note that it's the code for the entire app, so there's a lot there. Usually a good starting point is to Ctrl+F for function $c_LScalaFiddle$().

Need brief understanding on how eclipse autocomplete works

Hi I am interested in understanding how eclipse autocomplete works. I want to understand how eclipse distinguishes between local and global variables in a piece of Java code. I would also like to understand how eclipse stores method signatures for an infinite number of classes and how it associates a method to a given class. And is it possible for one person to develop an autocomplete feature for a language like JavaScript.
There is already an AutoComplete feature for Javascript. You just need to let Eclipse install the appropriate extensions.
Eclipse maintains a model of your program, including the project and all the dependencies. It's big, but it's not infinite. When you hit the dot, it figures out based on the variable type what the target type can be, and then displays the relevant methods based on its internal model.
This is easy for Java because you can usually know the static type. Much harder in other languages.
The Eclipse plug-in developer's guide discusses how different things, including the internal model and auto completion works. There are extension points to implement yiur own.

Xtext auto-suggest value

I am working on Xtext project. I need feature for my variable declaration. Assume I am using my DSL like one below
LifeEra:Teenage
Age:(while cursor is here)
I wonder if I can get pop-up down here and suggesting 16 since LifeEra entered Teenage. Is there anyway I may achieve that.
Hope my question is clear.
Thank you.
As I understood, code complete from dynamic values is not possible only using Xtext. But developing an Eclipse plugin for your own DSL may help. I couldn't find any other way.
You can indeed customize content assist for your DSL. See http://www.eclipse.org/Xtext/documentation.html#contentAssist and http://zarnekow.blogspot.de/2011/06/customizing-content-assist-with-xtext.html.

Creating a plugin for code hinting

I'm working with an internally-developed scripting language that some prof and his team have created for an academic project. There's documentation that show function signatures of the existing classes, but for outsiders like me, I'm constantly referring to documentation. Also, in the summer, more helpers will join and I bet they will all suffer from the same problem. So I'd like to write something in Eclipse to help with code hinting and completion, like many languages have.
I haven't programmed eclipse add-ons before, so can someone give me hints how I would generally take the function signatures from their documentation and get code hinting from it. I realize I may need to make changes to the documentation to use it for what I need. But any hints or sample projects would be appreciated. I'm not sure how to get started.
You should have a look at Xtext. With Xtext you can define a domain specific language and generate an editor for it. Here you can find a brief tutorial.

Scala Help needed - Code completion

I am working on writing an IDE for Scala and need some help. I would like to implement coding assistance so that I could present a list of options when a user presses a period (".") or a space (" "). e.g. if projects is a List, as soon as user types "projects." or "projects ", I would like to show all methods of scala.List that he could use (regular IDE stuff). I know that scala.tools.nsc.interactive package provides this capability, but I am unable to figure out how to do it. Besides, it seems that the interactive package would use REPL and would be slow for this purpose. Is that a fair assumption, and if yes, are there any alternatives?
Also, is there a way I could get a call reference tree for a literal/ method (where all is the method referred to in a code base) ?
Thanks and Best regards
Aishwarya
Well, your best bet is going through the same set of links I provided in answer to this question, even though the questions are different.
Yes, the presentation compiler under scala.tools.nsc.interactive is where the reusable functionality would be.
The presentation compiler is used by Eclipse and ENSIME. May be ENSIME itself which in addition to providing emacs support also provides a server as a backend for an editor would be a good avenue.
The presentation compiler is not slow. It was designed from the ground up to provide good performance for Eclipse and it has largely delivered on this goal.
For some of the presentation compiler capabilities, see scala.tools.nsc.interactive.CompilerControl.
For another project using ENSIME, look at Daniel Spiewak's plugin for jEdit.