-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use "with" keyword to define an Entity implements a trait #361
Comments
I'm experiencing the same on my side. Latest version to date of the VSCode extension. |
This snippet
works in my context-mapper 6.12.0 plugin. I did not yet investigate if the traits are really arriving in the model. |
Is that syntax valid, though? Seems weird to me, but I can't find any reference in the website docs, only a single mention in the Freemarker Generator section. context-mapper-dsl/org.contextmapper.dsl/src/org/contextmapper/tactic/dsl/TacticDDDLanguage.xtext Line 209 in 981d5be
|
Thank you @astmuc for uncovering the supported syntax. I agree with @CesarD that it looks a bit odd, especially given the But happy it works at least! I can confirm it is exposed in the model. Should I leave this issue open given the above suspicions? |
I suggest to keep the ticket open as question about the right syntax. Sculpture documentation says the @ is needed for internal references. On the other hand it is optional in the xtext syntax definition. |
It is optional, but then it is not a reference. With the |
Ok thanks - will leave open. I guess the outstanding question is , why is does the syntax differ between:
|
The reason for this strange behavior seems to be a special meaning of 'with' inside of a DSL created by Xtext. If i replace 'with' by 'using' in the tactics language definition file, then one can use the space after 'using' as expected. |
Describe the bug
I have defined a Trait and I am trying to use the
with
keyword of an Entity definition to implement the Trait.I get the following error
mismatched input 'ith' expecting RULE_CLOSE(org.eclipse.xtext.diagnostics.Diagnostic.Syntax)
To Reproduce
Steps to reproduce the behavior:
Trait newTrait {}
Entity newEntity with newTrait {}
Expected behavior
An Entity can implement a Trait with the
with
keywordLooking at the DSL java docs I can see a
getTraits()
function of the DomainObject type https://www.javadoc.io/doc/org.contextmapper/context-mapper-dsl/latest/org/contextmapper/tactic/dsl/tacticdsl/DomainObject.htmlIDE and Plugin (please complete the following information):
I am using the ContextMapper plugin for VSCode @ v6.12.0
The text was updated successfully, but these errors were encountered: