Home » Modeling » TMF (Xtext) » Code completion for Java imports
|
Re: Code completion for Java imports [message #920019 is a reply to message #918848] |
Sat, 22 September 2012 16:34 |
|
As far as I know, there is no direct support for that when using
'importedNamespace'...
the html routing example,
http://www.eclipse.org/Xtext/7languagesDoc.html#httpRouting , uses
"validated imports":
"in the routing DSL we use real cross-references to Java types in
imports. Although it is not as convenient to implement, it has the
advantage having imports validated and getting proper content assist in
your imports section. For future releases it is planned to significantly
improve support for import sections for JVM languages including nice IDE
features like organize imports. "
hope this helps
Lorenzo
On 09/21/2012 02:02 PM, Aaron Digulla wrote:
> This should be a common topic but Google didn't turn up anything useful:
> How do I get code completion in the DSL editor for a Java-like import
> statement?
>
>
> import java.util.D|
>
>
> should offer "java.util.Date"
>
> How do I do that?
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
| |
Re: Code completion for Java imports [message #927268 is a reply to message #922659] |
Sat, 29 September 2012 12:58 |
|
On 09/25/2012 10:02 AM, Aaron Digulla wrote:
> Thanks, the example grammar led me on the right track.
>
> But one more question: What do you mean by "when using
> 'importedNamespace'"? What is "importedNamespace"?
>
I mean this one (from the documentation), which, I assumed, was your
initial setting:
Imports can be defined in a very convenient way with Xtext. If you use
the name importedNamespace in a parser rule, the framework will treat
the value as an import. It even supports wildcard and handles them as
expected:
Import:
'import' importedNamespace = QualifiedNameWithWildcard
;
QualifiedNameWithWildcard:
QualifiedName '.*'?
;
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
Goto Forum:
Current Time: Fri Apr 19 05:37:09 GMT 2024
Powered by FUDForum. Page generated in 0.01974 seconds
|