|
|
|
|
|
|
|
Re: XText 2.0 --- Hover Documentation [message #696977 is a reply to message #696783] |
Fri, 15 July 2011 04:46   |
Eclipse User |
|
|
|
Hi Christian
as you know I have this grammar ;
Librarymodel:
(elements+=NonEmptyline)*;
NonEmptyline:
writer=Words ':' book=Words ':'pageNumber=INT ',' isbn=INT
;
Words hidden (): ID (WS ID)* ;
I want hovering for NonEmptyLine and i just change the if loop as follows
public class MyDslEObjectDocumentationProvider implements IEObjectDocumentationProvider {
@Override
public String getDocumentation(EObject o) {
if (o instanceof NonEmpityLine) {
return "This is a NonEmpityLine";
}
return null;
}
as well as here too;
protected String getFirstLine(EObject o) {
if (o instanceof NonEmpityLine) {
return "Damn good coding: " ;
}
return super.getFirstLine(o);
}
Consequent ; When I point on the following line, Hovering doesnt show up for my NonEmptyline in somthng.mydsl;
Writer1:Book1:1233:213
Is it because ; NonEmptyline consists of other parameters which are hidden?
Second; I want to implement hovers for each field (writer,selected writer's book,selected book's isbn..etc)in my NOnEmptyLine,
which have been divided with ':'/',' for user,so user will know which type has to be typed,
while user is typing code, is there anyway to display information ?
[Updated on: Fri, 15 July 2011 04:46] by Moderator
|
|
|
|
|
|
|
|
|
|
|
Re: XText 2.0 --- Hover Documentation [message #697475 is a reply to message #697449] |
Sat, 16 July 2011 18:43   |
Eclipse User |
|
|
|
Hi
Tons of Thanks for your explanation, you are really helpful.
This is working really fine, and I guess I can use it for my dsl comment rule which is same with terminal single line comment rule,
On the other hand, if I have a keyword 'NEL' for nonemptyline as follows, when i point the NEL it works as well.
LibraryModel:
(types+=Type)*;
Type:
NonEmptyline;
NonEmptyline:
'NEL' writer=Words ':' book=Words ':'pageNumber=INT ',' isbn=INT
;
Words hidden ():
ID (WS ID)*
;
However, my emptyline has not a keyword as follows,
NonEmptyline:
writer=Words ':' book=Words ':'pageNumber=INT ',' isbn=INT
;
Words hidden ():
ID (WS ID)*
;
Which means, i have to point on writer or another parameter for display a hover.
I tried to define onemore qualifiedname for writer, But Xtext didnt generate interface for writer and other book, isbn and pagenumbers.
it didnt work, i need to define somethng for writer parameter which has not a key word and part of the nonemptyline and as well as for other parameters. is there anyway to do this kind with Xtext 2.0 ?
BR Caner
[Updated on: Sun, 17 July 2011 05:20] by Moderator
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06456 seconds