Xtext auto-suggest value - eclipse

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.

Related

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

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.

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.

Add to language syntax in Netbeans/Eclipse

This may seem like seem like a bit of a weird/uncommon request but I am trying to find out if it is possible. I would like to add to the language syntax in Netbeans or Eclipse easily without needing to create an entirely new language. According to this question How to add more syntax elements for eclipse it is not possible in Eclipse, but that was asked in 2008 so maybe things have changed.
The reason I want to do it is I am developing in node.js and it uses callbacks quite heavily. So it would be nice if I could make the word 'callback' and 'callback()' be highlighted in a different colour so it can be easily seen in amongst the rest of the code.
Thanks for your help!
The css thing is really easy:
go to Options/Miscellaneous/Files, create new file extension less and then select proper MIME type text/x-css. I Believe that it is possible to extend syntax highlighting in NetBeans IDE but you have to write your own plugin to do that.

Is there an easy way to integrate scaladoc into IntelliJ Idea?

How do I use/generate scaladoc from within IntelliJ Idea (running on ubuntu)? Most preferably I would like to configure Tools/generate javadoc to also generate scaladoc, though that might be hard as of the differences between both according to this thread.
The scaladoc support in IntelliJ is pretty basic for now: some keywords are highlighted in comments, but there is no "generate scaladoc" option in tools. We'll create an issue in the tracker to keep it in mind.
Thanks.
Cheers!
Ilya