xtext

How to write custom autocompletion in Xtext?

半世苍凉 提交于 2019-12-22 10:33:02
问题 I just can't find anything about this, only sources about writing a custom autocompletion proposal, which is not what I want (or is it)? Syntax We can use the example syntax for this: Model: greetings+=Greeting*; Greeting: 'Hello' name=ID '!'; Problem Now, when the user creates a new instance of the syntax, he has to Write "Hello" (and could complete it) Has to write a space Can now autocomplete the "Name=ID" But this is not what I want. What I want When the user completes "Hello", I want the

auto pretty formatting in xtext

為{幸葍}努か 提交于 2019-12-21 21:43:38
问题 I want to ask that is there a way to do Pretty formatting in xtext automatically without (ctrl+shift+f) or turning it on from preference menu. What I actually want is whenever a user completes writing the code it is automatically pretty formatted (or on runtime) without (ctrl+shift+f). 回答1: There is a way for doing that which is called "AutoEdit". It's not exactly when the user completes writing but it's with every token. That's at least what I have done. You can for sure change that. I will

Interpreter vs. Code Generator Xtext

孤街浪徒 提交于 2019-12-21 17:18:24
问题 I've a DSL written using Xtext. What I want is to execute that DSL to perform something good out of it. I wrote myDslGenerator class implementing the interface IGenerator in xtend to generate java code and it's working fine. I've two questions; What is the difference between Interpreter and Code Generator? Aren't both for executing DSL? How to write an interpreter? Any step by step tutorial link? I found many tutorial to generate code using xtend but couldn't find any for writing an

ClassNotFoundException: junit.framework.TestCase cannot be found by org.eclipse.xtext.junit_2.4.3.v201309030823

回眸只為那壹抹淺笑 提交于 2019-12-21 07:13:15
问题 I'm puzzled by this error: java.lang.NoClassDefFoundError: junit/framework/TestCase at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:792) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.java:638) ... at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java

What are the main differences between Jetbrains' MPS and Eclipse Xtext?

断了今生、忘了曾经 提交于 2019-12-20 08:24:03
问题 I have used Eclipse Xtext in several projects. I loved the ease of defining a grammar over an Ecore (meta)model and letting everything generated for you including awesome Eclipse plugin editor, but I was quite uncomfortable with the underlying EMF framework with everything hard-wired in static fields. Lately I came across Jetbrains' MPS (Meta Programming System). It's based on completely different philosophy. While Xtext is for creating text-based DSLs generating a parser for you (and

Can't Create Xtext Project in Eclipse

本秂侑毒 提交于 2019-12-20 05:53:52
问题 I installed Xtext 2.12 from the Eclipse Marketplace. I'm using Eclipse Neon.3 Release (4.6.3). Following the directions in the Bettini book, I tried to create a new Xtext project, but the wizard does not appear in the New>Other... dialog. What did I miss and why doesn't stuff just work? 来源: https://stackoverflow.com/questions/46458903/cant-create-xtext-project-in-eclipse

Hide Coolbar/Toolbar items/Preference pages in Eclipse RCP application (Eclipse e4)

删除回忆录丶 提交于 2019-12-20 02:37:13
问题 In our Eclipse RCP application (using Eclipse 3.7 ) I had overridden WorkbenchWindowAdvisor.postWindowCreate() method, to hide the unwanted Coolbar/Toolbar items like File , Run etc. menus and Run Last Tool , Search etc. toolbar buttons and it was working fine. Now I have moved my code to Eclipse e4 4.1.2 and when I run my RCP application now it gets launched but it is showing these unwanted Coolbar/Toolbar items. On some digging into the issue I found out that WorkbenchWindowAdvisor

RCP application cannot find ModelCleanupAddon class

删除回忆录丶 提交于 2019-12-13 07:25:04
问题 I have RCP application based on Luna release. After migrating to Luna 4.4.2 relase, I observe the following error !ENTRY org.eclipse.e4.ui.workbench 4 0 2015-08-27 16:59:58.081 !MESSAGE Unable to load class 'org.eclipse.ui.internal.ide.application.addons.ModelCleanupAddon' from bundle '85' !STACK 0 java.lang.ClassNotFoundException: org.eclipse.ui.internal.ide.application.addons.ModelCleanupAddon cannot be found by org.eclipse.ui.ide.application_1.0.501.v20141111-1238 at org.eclipse.osgi

xText: doGenerate method is not called

我的未来我决定 提交于 2019-12-13 07:04:45
问题 I'm developing a DSL using xText (version 2.10.0) and i would like to add also a code generator. When running the plug-ins, as I understood, the code generator should be invoked automatically upon a change in a file. This is not happening. Using a debugger I've noticed that the doGenerate function is not invoked. What can I do so the doGenerate function will be invoked automatically? Thanks. 回答1: Your file needs the right file extension (case sensitive) the project needs xtext nature and

working with xtext not as plugin

我只是一个虾纸丫 提交于 2019-12-13 05:25:47
问题 In general I have my dsl as plugin and I want to create a new app that use my dsl so i tried to write this code: JsonParser p = new JsonParser(); IParseResult r = p.parse(new StringReader("{}")); //once that work it will be the file data instead of {} but when i do the parse the node model builder is null and the following line has exception: return doParse(ruleName, in, nodeModelBuilder.get(), 0); and i'm not sure how to init nodeModelBuilder i'm sure i missing some steps but i'm not quite