Improving java editing experience? Follow
I'm used to IntelliJ automatically figuring out packages that I can import from for classes. I've noticed that in MPS, those packages are in "@java_stub" models. What I'm wondering is if there is a way to allow MPS to auto-complete from other modules that aren't yet added to the dependency (and then suggest adding them).
On a related note, is there any way to enable seeing the Java *source* from within MPS? I have the JDK source installed, and I like to be able to see the source code of libraries I'm using, to ensure that I understand what the intent of the methods/classes are.
Please sign in to leave a comment.
Hi Daniel,
I'm not used to IntelliJ, so maybe I misunderstand what you are asking (first part).
In MPS, if you want to reference something that is currently not in the dependency scope of your module, you can press Ctrl+R to search for the root node you are interested in (that can also be classes from java_stubs). Once found, press ENTER to add the corresponding dependency to your module.
If you want to make use of existing languages, do the same with Ctrl+L to import those languages.
At least in the case of languages, MPS gives you the option to add dependencies right away.
I don't think you can open Java as text in MPS out-of-the-box. Maybe using MPS as a IntelliJ plugin might be more interesting to you?
It's more about having to use ctrl-m to import the stubs in the first place. I'd like to type the name of a class that's in the an unimported stub, and have MPS figure out that I might want to import it.