Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Ctr+Clik
Ctr+Clik [message #669690] Wed, 11 May 2011 07:50 Go to next message
Kapusta Missing name is currently offline Kapusta Missing nameFriend
Messages: 48
Registered: March 2011
Member
hi,

We just want to have, like in eclipse for Java, ctrl+clik to go to declaration of variable.
Our current version accept ctr+clik for the function name but when we use ctrl+clik on a variable, we arrive on the first declaration of variable which have the same name.
Example :

/* sequence covers a prefix of seq/Int */
pred isSeq[s: Int -> univ] {
  s in seq/Int -> lone univ
  s.inds - ui/next[s.inds] in 0 
}

/* returns all the elements in this sequence */
fun elems [s: Int -> univ]: set (Int.s) { seq/Int . s }


When we ctrl+clik on the last "s"instead of go to
--- elems [s: Int -> univ] ----
we arrived on
--- isSeq[s: Int -> univ] ---

Any ideas ?

Tanks Smile

Max&Yo
Re: Ctr+Clik [message #669704 is a reply to message #669690] Wed, 11 May 2011 08:30 Go to previous messageGo to next message
Luong  is currently offline Luong Friend
Messages: 8
Registered: March 2011
Junior Member
Hi!
If I'm not wrong you have two ways:

1) Change the grammar so that the last cross-reference point to the element you wanted.

2) Customize the hyperlink mechanism. Look in the User Guide, section "Hyperlinking".

Smile

Luong
Re: Ctr+Clik [message #669717 is a reply to message #669690] Wed, 11 May 2011 09:20 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Max, hi Yo,

I think this indicates a bug in your scope provider since the ctrl+click
navigates to the refered element.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 11.05.11 09:50, schrieb Kapusta:
> hi,
>
> We just want to have, like in eclipse for Java, ctrl+clik to
> go to declaration of variable. Our current version accept ctr+clik for
> the function name
> but when we use ctrl+clik on a variable, we arrive on the
> first declaration of variable which have the same name.
> Example :
>
>
> /* sequence covers a prefix of seq/Int */
> pred isSeq[s: Int -> univ] {
> s in seq/Int -> lone univ
> s.inds - ui/next[s.inds] in 0 }
>
> /* returns all the elements in this sequence */
> fun elems [s: Int -> univ]: set (Int.s) { seq/Int . s }
>
>
> When we ctrl+clik on the last "s"instead of go to
> --- elems [s: Int -> univ] ----
> we arrived on
> --- isSeq[s: Int -> univ] ---
>
> Any ideas ?
>
> Tanks :)
>
> Max&Yo
Re: Ctr+Clik [message #669754 is a reply to message #669717] Wed, 11 May 2011 12:05 Go to previous messageGo to next message
Kapusta Missing name is currently offline Kapusta Missing nameFriend
Messages: 48
Registered: March 2011
Member
hi Sebastian,

but how to configure the scope provider? Actually,we have one scope but we don't know what add.

tanks for your indications,

regards,

Max & Yo
Re: Ctr+Clik [message #669963 is a reply to message #669754] Thu, 12 May 2011 08:08 Go to previous messageGo to next message
Kapusta Missing name is currently offline Kapusta Missing nameFriend
Messages: 48
Registered: March 2011
Member
hi,

We almost got it Smile The hyper-linking works for the function name ,the variable which is in other file but it's never right for same file variable.

What did we forget ?

thanks again for your previous reply,

Max&Yo

[Updated on: Thu, 12 May 2011 08:09]

Report message to a moderator

Re: Ctr+Clik [message #670239 is a reply to message #669717] Fri, 13 May 2011 07:52 Go to previous messageGo to next message
Daniel Le Berre is currently offline Daniel Le BerreFriend
Messages: 82
Registered: July 2009
Member
Actually, our problem is that our default scope provider is not correct.

It looks like the SimpleNameScopeProvider is used while we would have liked to have the DefaultQualifiedScopeProvider to be applied.

As such, when the same element is found in a text, instead of referring to the innermost one, the first one in the file is referred to.

how can we change that?
Re: Ctr+Clik [message #670946 is a reply to message #670239] Mon, 16 May 2011 10:34 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Hi,

what is bound as impl of the IQualifiedNameProvider in the Runtime Module?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Ctr+Clik [message #670973 is a reply to message #670946] Mon, 16 May 2011 12:45 Go to previous messageGo to next message
Kapusta Missing name is currently offline Kapusta Missing nameFriend
Messages: 48
Registered: March 2011
Member
hi Christian,

We have in the runtime module :

@Override
	public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
		return AlsQualifiedNameProvider.class;
	}



And in the AlsQualifiedNameProvider class :



public class AlsQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider {

    public String qualifiedName(FunctionNamewParam obj) {
    	
      	
    	
    	return  Weobj.getName();
   }
    public String getQualifiedName (EObject o){
    	   	
    	return super.getQualifiedName(o);
    }
 

}

We try lot of kind of implementations for qualifiedName(FunctionNamewParam obj) but when we solve one problem, many others appear :s

What do you think about this?

thanks very much,

Max&Yo
Re: Ctr+Clik [message #670974 is a reply to message #670946] Mon, 16 May 2011 12:45 Go to previous messageGo to next message
Kapusta Missing name is currently offline Kapusta Missing nameFriend
Messages: 48
Registered: March 2011
Member
hi Christian,

We have in the runtime module :

@Override
	public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
		return AlsQualifiedNameProvider.class;
	}



And the AlsQualifiedNameProvider class :



public class AlsQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider {

    public String qualifiedName(FunctionNamewParam obj) {
    	
      	
    	
    	return  Weobj.getName();
   }
    public String getQualifiedName (EObject o){
    	   	
    	return super.getQualifiedName(o);
    }
 

}

We try lot of kind of implementatino for qualifiedName(FunctionNamewParam obj) but when we solve one problem, many appears :s

What are you thinking?

thanks very much,

Max&Yo
Re: Ctr+Clik [message #670975 is a reply to message #670946] Mon, 16 May 2011 12:46 Go to previous messageGo to next message
Kapusta Missing name is currently offline Kapusta Missing nameFriend
Messages: 48
Registered: March 2011
Member
hi Christian,

We have in the runtime module :

@Override
	public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
		return AlsQualifiedNameProvider.class;
	}



And the AlsQualifiedNameProvider class :



public class AlsQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider {

    public String qualifiedName(FunctionNamewParam obj) {
    	
      	
    	
    	return  Weobj.getName();
   }
    public String getQualifiedName (EObject o){
    	   	
    	return super.getQualifiedName(o);
    }
 

}

We try lot of kind of implementatino for qualifiedName(FunctionNamewParam obj) but when we solve one problem, many appears :s

What are you thinking?

thanks very much,

Max&Yo
Re: Ctr+Clik [message #670976 is a reply to message #670239] Mon, 16 May 2011 12:46 Go to previous messageGo to next message
Kapusta Missing name is currently offline Kapusta Missing nameFriend
Messages: 48
Registered: March 2011
Member
hi Christian,

We have in the runtime module :

@Override
	public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
		return AlsQualifiedNameProvider.class;
	}



And the AlsQualifiedNameProvider class :



public class AlsQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider {

    public String qualifiedName(FunctionNamewParam obj) {
    	
      	
    	
    	return  Weobj.getName();
   }
    public String getQualifiedName (EObject o){
    	   	
    	return super.getQualifiedName(o);
    }
 

}

We try lot of kind of implementatino for qualifiedName(FunctionNamewParam obj) but when we solve one problem, many appears :s

What are you thinking?

thanks very much,

Max&Yo
Re: Ctr+Clik [message #670977 is a reply to message #669690] Mon, 16 May 2011 12:46 Go to previous messageGo to next message
Kapusta Missing name is currently offline Kapusta Missing nameFriend
Messages: 48
Registered: March 2011
Member
hi Christian,

We have in the runtime module :

@Override
	public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
		return AlsQualifiedNameProvider.class;
	}



And the AlsQualifiedNameProvider class :



public class AlsQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider {

    public String qualifiedName(FunctionNamewParam obj) {
    	
      	
    	
    	return  Weobj.getName();
   }
    public String getQualifiedName (EObject o){
    	   	
    	return super.getQualifiedName(o);
    }
 

}

We try lot of kind of implementatino for qualifiedName(FunctionNamewParam obj) but when we solve one problem, many appears :s

What are you thinking?

thanks very much,

Max&Yo
Re: Ctr+Clik [message #670978 is a reply to message #670239] Mon, 16 May 2011 12:49 Go to previous messageGo to next message
Kapusta Missing name is currently offline Kapusta Missing nameFriend
Messages: 48
Registered: March 2011
Member
hi Christian,

We have in the runtime module :

@Override
	public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
		return AlsQualifiedNameProvider.class;
	}



And the AlsQualifiedNameProvider class :



public class AlsQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider {

    public String qualifiedName(FunctionNamewParam obj) {
    	
      	
    	
    	return  Weobj.getName();
   }
    public String getQualifiedName (EObject o){
    	   	
    	return super.getQualifiedName(o);
    }
 

}

We try lot of kind of implementatino for qualifiedName(FunctionNamewParam obj) but when we solve one problem, many appears :s

What are you thinking?

thanks very much,

Max&Yo
Re: Ctr+Clik [message #670979 is a reply to message #670946] Mon, 16 May 2011 12:49 Go to previous messageGo to next message
Kapusta Missing name is currently offline Kapusta Missing nameFriend
Messages: 48
Registered: March 2011
Member
hi Christian,

We have in the runtime module :

@Override
	public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
		return AlsQualifiedNameProvider.class;
	}



And the AlsQualifiedNameProvider class :



public class AlsQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider {

    public String qualifiedName(FunctionNamewParam obj) {
    	
      	
    	
    	return  Weobj.getName();
   }
    public String getQualifiedName (EObject o){
    	   	
    	return super.getQualifiedName(o);
    }
 

}

We try lot of kind of implementatino for qualifiedName(FunctionNamewParam obj) but when we solve one problem, many appears :s

What are you thinking?

thanks very much,

Max&Yo
Re: Ctr+Clik [message #670980 is a reply to message #670946] Mon, 16 May 2011 12:50 Go to previous messageGo to next message
Kapusta Missing name is currently offline Kapusta Missing nameFriend
Messages: 48
Registered: March 2011
Member
hi Christian,

We have in the runtime module :

@Override
	public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
		return AlsQualifiedNameProvider.class;
	}



And the AlsQualifiedNameProvider class :



public class AlsQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider {

    public String qualifiedName(FunctionNamewParam obj) {
    	
      	
    	
    	return  Weobj.getName();
   }
    public String getQualifiedName (EObject o){
    	   	
    	return super.getQualifiedName(o);
    }
 

}

We try lot of kind of implementatino for qualifiedName(FunctionNamewParam obj) but when we solve one problem, many appears :s

What are you thinking?

thanks very much,

Max&Yo
Re: Ctr+Clik [message #670982 is a reply to message #669690] Mon, 16 May 2011 12:52 Go to previous messageGo to next message
Kapusta Missing name is currently offline Kapusta Missing nameFriend
Messages: 48
Registered: March 2011
Member
hi Christian,

We have in the runtime module :

@Override
	public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
		return AlsQualifiedNameProvider.class;
	}



And the AlsQualifiedNameProvider class :



public class AlsQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider {

    public String qualifiedName(FunctionNamewParam obj) {
    	
      	
    	
    	return  Weobj.getName();
   }
    public String getQualifiedName (EObject o){
    	   	
    	return super.getQualifiedName(o);
    }
 

}

We try lot of kind of implementatino for qualifiedName(FunctionNamewParam obj) but when we solve one problem, many appears :s

What are you thinking?

thanks very much,

Max&Yo
Re: Ctr+Clik [message #670983 is a reply to message #669690] Mon, 16 May 2011 12:54 Go to previous messageGo to next message
Kapusta Missing name is currently offline Kapusta Missing nameFriend
Messages: 48
Registered: March 2011
Member
hi Christian,

We have in the runtime module :

@Override
	public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
		return AlsQualifiedNameProvider.class;
	}



And the AlsQualifiedNameProvider class :



public class AlsQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider {

    public String qualifiedName(FunctionNamewParam obj) {
    	
      	
    	
    	return  Weobj.getName();
   }
    public String getQualifiedName (EObject o){
    	   	
    	return super.getQualifiedName(o);
    }
 

}

We try lot of kind of implementatino for qualifiedName(FunctionNamewParam obj) but when we solve one problem, many appears :s

What are you thinking?

thanks very much,

Max&Yo
Re: Ctr+Clik [message #670984 is a reply to message #670983] Mon, 16 May 2011 12:58 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Hi,

without any concrete problem description i cannot help you.
What is the exact behaviour of the QNP you want to have
and what is the place you face problems?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Ctr+Clik [message #670996 is a reply to message #670984] Mon, 16 May 2011 13:48 Go to previous messageGo to next message
Kapusta Missing name is currently offline Kapusta Missing nameFriend
Messages: 48
Registered: March 2011
Member
hi,

in our eclipse application when we have :

0-// e1 is less than e2 in the ordering
1-pred lt [e1, e2: elem] { e1 in prevs[e2] }
2-
3-// e1 is greater than e2 in the ordering
4-pred gt [e1, e2: elem] { e1 in nexts[e2] }
5-
6-// e1 is less than or equal to e2 in the ordering
7-pred lte [e1, e2: elem] { e1=e2 || lt [e1,e2] }
8-
9-// e1 is greater than or equal to e2 in the ordering
10-pred gte [e1, e2: elem] { e1=e2 || gt [e1,e2] }


and when we click on any e2, we arrived on the first (line 1).

On our grammar, we have :

PredDecl returns Predicate:
  "private"? "pred" (ref=Ref dot=Dot)? predicateName=PredicateName (
  		leftS=LeftSquareBracketKeyword (decl+=Decl (comma+=Comma decl+=Decl)*)? rightS=RightSquareBracketKeyword	|
  		leftP=LeftParenthesis (decl+=Decl (comma+=Comma decl+=Decl)*)? rightP=RightParenthesis
  		)? block=Block	; 


Decl:
  ("private")? ("disj")?  propertyName+=PropertyName  (comma+=Comma propertyName+=PropertyName)* colon=Colon ("disj")? expr=Expression	; 
  
PropertyName:
	name=Name;



Is this description complete?

Anyway,Thanks Smile

Max&Yo

[Updated on: Mon, 16 May 2011 13:48]

Report message to a moderator

Re: Ctr+Clik [message #671001 is a reply to message #670996] Mon, 16 May 2011 13:57 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Hi,

no the relevant stuff is missing since you obviously have the problem that the references to a IDontKnowWhatButCanBeSomethingInADecl
from a block don't point to the right thing so you have as suggested by Luong and Sebastian adapt the the Scoping
that the reference point to the right thing.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Mon, 16 May 2011 14:02]

Report message to a moderator

Previous Topic:Cross-linking to alternative representations (not always having the 'name' attribute)?
Next Topic:Recognising variable type, where multiple variables declared in one statement.
Goto Forum:
  


Current Time: Thu Sep 19 15:57:53 GMT 2024

Powered by FUDForum. Page generated in 0.06050 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top