Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Proposal not added
Proposal not added [message #1815810] Fri, 11 October 2019 08:49 Go to next message
Jozsef Klespitz is currently offline Jozsef KlespitzFriend
Messages: 34
Registered: September 2019
Member
Hello everyone,

I am experimenting with Proposal Provider customization.
I want to add an own keyword to the existing ones.

I am using this as an example and here is how far I reached:

override void completeExpression(EObject model,  RuleCall ruleCall,   ContentAssistContext context,  ICompletionProposalAcceptor acceptor) 
	{
		val myEntry = createCompletionProposal('KeywordToShow', context)
		acceptor.accept(myEntry)
		super.completeExpression(model, ruleCall, context, acceptor)
	}


I have debugged the code and found that the existsConflict method of AntlrProposalConflictHelper returns conflict and I no have any idea why.
I see that the equalTokenSequence(getLastCompleteLexer(), getCombinedLexer()) is false when I try to complete a 'K'.

Can you please give me any hint, how to get rid off this problem?
Re: Proposal not added [message #1815811 is a reply to message #1815810] Fri, 11 October 2019 08:57 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
hi, i have no idea with the information you provided
but is may be that either
Keyword or To to Show are keywords
or there is a keyword pre and postfixed by KeywordToShow

=> what happens if you use

val myEntry = createCompletionProposal(' KeywordToShow ', context)
instead


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Proposal not added [message #1815812 is a reply to message #1815811] Fri, 11 October 2019 09:04 Go to previous messageGo to next message
Jozsef Klespitz is currently offline Jozsef KlespitzFriend
Messages: 34
Registered: September 2019
Member
The KeywordToShow was misleading, it is not a keyword, not even a substring of it.
But adding those two spaces fixed the problem for some reason...

Thank you a lot Christian! I would have never figure it out myself.
Re: Proposal not added [message #1815813 is a reply to message #1815812] Fri, 11 October 2019 09:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
do you execute the proposal here

xxxxxx|

if you now insert it the result will be

xxxxxxKeywordToShow

and xxxxxxKeywordToShow be parsed as one ID


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Proposal not added [message #1815814 is a reply to message #1815813] Fri, 11 October 2019 09:23 Go to previous messageGo to next message
Jozsef Klespitz is currently offline Jozsef KlespitzFriend
Messages: 34
Registered: September 2019
Member
I am experiencing it as you wrote.

What shall I do different if I want to get

KeywordToShow

if I am executing proposal at

Keyw|

[Updated on: Fri, 11 October 2019 10:32]

Report message to a moderator

Re: Proposal not added [message #1815817 is a reply to message #1815814] Fri, 11 October 2019 10:22 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
then it should actually work.
but that would need to be debugged


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Error using maven in Eclipse
Next Topic:Disable NodeModel
Goto Forum:
  


Current Time: Wed Apr 24 23:33:55 GMT 2024

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

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

Back to the top