Multiple resources and validation problem [message #687781] |
Thu, 23 June 2011 08:21 |
Victor Noël Messages: 112 Registered: June 2010 |
Senior Member |
|
|
Hi,
I defined a DSL exploiting scoping.ImportNamespacesScopingFragment, exporting.QualifiedNamesFragment and types.TypesGeneratorFragment to enable multiple resources to be referring to each others as long as they are in the same classpath, as well as refering to Java types.
The corresponding DSL constructs related to these fragments are:
Model returns Namespace:
( imports+=Import
| elements+=ModelElement
)*;
Namespace:
'namespace' name=FQN '{'
( imports+=Import
| elements+=ModelElement
)*
'}';
FQN:
ID ('.' ID)*;
ImportedFQN:
FQN ('.' '*')?;
Import:
'import' importedNamespace=ImportedFQN;
ModelElement:
Namespace | ParameterizedElement;
TypeParameter returns types::JvmTypeParameter:
{TypeParameter} name=ID;
ReferenceTypeArgument returns types::JvmReferenceTypeArgument:
typeReference=ParameterizedTypeReference;
ParameterizedTypeReference returns types::JvmParameterizedTypeReference:
{ParameterizedTypeReference} type=[types::JvmType|FQN] ("[" arguments+=ReferenceTypeArgument ("," arguments+=ReferenceTypeArgument)* "]")?;
The problem is very precise: if I have 2 projects A and B, one resource of this dsl in each (RA in A and RB in B), a Java class JB in B.
RB is referring to JB and to an element inside RA.
A is in the classpath of B.
If I modify an element in RB, even one not referenced by RA, then RA shows as having errors, and if I look inside, there is grey crosses (and not red) in front of the lines where JB is referred to, and it says it can't resolve the reference to JB in the problem view (but the reference itself is not underlined).
Then I just have to make the Validator run (for example by modifying a bit RB) and then the errors disappears.
I don't know how to debug that, any idea??!
Thanks :)
|
|
|
|
Re: Multiple resources and validation problem [message #692623 is a reply to message #687781] |
Mon, 04 July 2011 21:02 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Victor,
are there any customizations in your validator or scope provider?
How does the content of RA and RB look like?
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
On 23.06.11 10:21, Victor wrote:
> Hi,
>
> I defined a DSL exploiting scoping.ImportNamespacesScopingFragment,
> exporting.QualifiedNamesFragment and types.TypesGeneratorFragment to
> enable multiple resources to be referring to each others as long as they
> are in the same classpath, as well as refering to Java types.
>
> The corresponding DSL constructs related to these fragments are:
>
> Model returns Namespace:
> ( imports+=Import
> | elements+=ModelElement
> )*;
>
> Namespace:
> 'namespace' name=FQN '{'
> ( imports+=Import
> | elements+=ModelElement
> )*
> '}';
>
> FQN:
> ID ('.' ID)*;
>
> ImportedFQN:
> FQN ('.' '*')?;
>
> Import:
> 'import' importedNamespace=ImportedFQN;
>
> ModelElement:
> Namespace | ParameterizedElement;
>
> TypeParameter returns types::JvmTypeParameter:
> {TypeParameter} name=ID;
>
> ReferenceTypeArgument returns types::JvmReferenceTypeArgument:
> typeReference=ParameterizedTypeReference;
>
> ParameterizedTypeReference returns types::JvmParameterizedTypeReference:
> {ParameterizedTypeReference} type=[types::JvmType|FQN] ("["
> arguments+=ReferenceTypeArgument ("," arguments+=ReferenceTypeArgument)*
> "]")?;
>
>
> The problem is very precise: if I have 2 projects A and B, one resource
> of this dsl in each (RA in A and RB in B), a Java class JB in B.
> RB is referring to JB and to an element inside RA.
> A is in the classpath of B.
>
> If I modify an element in RB, even one not referenced by RA, then RA
> shows as having errors, and if I look inside, there is grey crosses (and
> not red) in front of the lines where JB is referred to, and it says it
> can't resolve the reference to JB in the problem view (but the reference
> itself is not underlined).
> Then I just have to make the Validator run (for example by modifying a
> bit RB) and then the errors disappears.
>
> I don't know how to debug that, any idea??!
>
> Thanks :)
|
|
|
Powered by
FUDForum. Page generated in 0.03409 seconds