Content Assist don't work in first column of second line... [message #848050] |
Tue, 17 April 2012 22:48 |
Cristiano Gavião Messages: 279 Registered: July 2009 |
Senior Member |
|
|
Hi again,
I've implemented a new pilot to test importing resources stuffs... It is reaally cool !
But there are something wrong with content assist that I couldn't find why...:
If I type crtl-space in a empty file at first position, It shows me the content assist with Risk:, Roles: and import options.
So, If I choose any option and type enter, at the second line and first column the content assist doesn't work. It just works after I enter a space...
could someone give me a tip here?
That is my grammar:
grammar org.xtext.example.risks.RiskDsl with org.eclipse.xtext.common.Terminals hidden(WS, NewLine)
generate riskDsl "http://www.xtext.org/example/risks/RiskDsl"
RiskModel :
{RiskModel}
(
(imports += Import*)
(rolesLibrary=RoleLibrary)?
(risks+=Risk*)
)
;
Risk:
{Risk}
'Risk:' ((name=STRING)
('roles=' (assignedRoles+=[Role|STRING]) (',' roles+=[Role|STRING])*)?
)
;
RoleLibrary :
{RoleLibrary}
'Roles:' (id=ID
(roles+=Role*)
)
;
Role :
{Role}
'Role:'
(id=ID 'name=' name=STRING)
;
Import hidden (WS, ID):
'import' (importURI=STRING)
;
terminal SL_COMMENT : '!-' -> NewLine
;
terminal WS:
(' ' | '\t')+
;
terminal NewLine:
('\r'? '\n')+
;
This is the text that I enter. repare in the space that I'm forced to enter before "Role:"
Roles:
Role: id=kb name="Kill Bill"
Role: id=jim name="Jim M"
[Updated on: Wed, 18 April 2012 01:57] Report message to a moderator
|
|
|
Re: Content Assist don't work in first column of second line... [message #849017 is a reply to message #848050] |
Wed, 18 April 2012 20:06 |
Jan Koehnlein Messages: 760 Registered: July 2009 Location: Hamburg |
Senior Member |
|
|
That's intended Eclipse behavior. Content assist tries to complete the
current word when there is no whitespace before the caret position. Same
as in JDT and any other editor.
Am 18.04.12 00:49, schrieb Cristiano Gaviao:
> Hi again,
> I've implemented a new pilot to test importing resources stuffs... It is
> reaally cool !
>
> But there are something wrong with content assist that I couldn't find
> why...:
> If I type crtl-space in a empty file at first position, It shows me the
> content assist with Risk:, Roles: and import options.
>
> So, If I choose anyone option and type enter, at the second line and
> first column the content assist doesn't work. It just works after I
> enter a space...
>
> could someone give me a tip here?
>
> That is my grammar:
>
> grammar org.xtext.example.risks.RiskDsl with
> org.eclipse.xtext.common.Terminals hidden(WS, NewLine)
>
> generate riskDsl "http://www.xtext.org/example/risks/RiskDsl"
>
> RiskModel :
> {RiskModel}
> (
> (imports += Import*)
> (rolesLibrary=RoleLibrary)?
> (risks+=Risk*)
> )
> ;
> Risk:
> {Risk}
> ('Risk:' ('name=' name=STRING)
> ('roles=' (roles+=[Role|STRING]) ((',' (roles+=[Role|STRING]))*)?)? )
> ;
> RoleLibrary :
> {RoleLibrary}
> ('Roles:'
> (roles+=Role*)
> )
> ;
> Role :
> ('Role:' ('id=' id=ID 'name=' name=STRING)
> )
> ;
> Import hidden (WS, ID):
> ('import' importURI=STRING) ;
> terminal SL_COMMENT : '!-' -> NewLine
>
> ;
> terminal WS:
> (' ' | '\t')+
> ;
> terminal NewLine:
> ('\r'? '\n')+
> ;
>
>
> This is the text that I enter. repare in the space that I'm forced to
> enter before "Role:"
>
> Roles:
> Role: id=kb name="Kill Bill"
> Role: id=jim name="Jim M"
>
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
---
Get professional support from the Xtext committers at www.typefox.io
|
|
|
Re: Content Assist don't work in first column of second line... [message #849803 is a reply to message #849017] |
Thu, 19 April 2012 13:11 |
Cristiano Gavião Messages: 279 Registered: July 2009 |
Senior Member |
|
|
Jan Kohnlein wrote on Wed, 18 April 2012 23:06That's intended Eclipse behavior. Content assist tries to complete the
current word when there is no whitespace before the caret position. Same
as in JDT and any other editor.
Hi Jan,
Thanks for the worry, but I think you didn't understood well my point
In JDT or Xtend Class for example, if I enter this
import whatever.package.clazz; [hit enter here]
and hit a enter, the content assist will work properly in the first column of the line below the first import, am I right ?
so in this example we will have this:
import whatever.package.clazz;[hit enter here]
<content assist works here in the first column of the next line>
and in my dsl it just don't happen... if I hit the enter after the first import sentence, content assist doesn't appears in the next line at the first column...
So, or I just did something wrong (that I can't find or it is a bug)
regards,
Cristiano
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04378 seconds