Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Proposal not added
Proposal not added [message #1815810] Fri, 11 October 2019 04:49 Go to next message
Eclipse UserFriend
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 04:57 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Proposal not added [message #1815812 is a reply to message #1815811] Fri, 11 October 2019 05:04 Go to previous messageGo to next message
Eclipse UserFriend
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 05:09 Go to previous messageGo to next message
Eclipse UserFriend
do you execute the proposal here

xxxxxx|

if you now insert it the result will be

xxxxxxKeywordToShow

and xxxxxxKeywordToShow be parsed as one ID
Re: Proposal not added [message #1815814 is a reply to message #1815813] Fri, 11 October 2019 05:23 Go to previous messageGo to next message
Eclipse UserFriend
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 06:32] by Moderator

Re: Proposal not added [message #1815817 is a reply to message #1815814] Fri, 11 October 2019 06:22 Go to previous message
Eclipse UserFriend
then it should actually work.
but that would need to be debugged
Previous Topic:Error using maven in Eclipse
Next Topic:Disable NodeModel
Goto Forum:
  


Current Time: Tue Apr 15 02:03:03 EDT 2025

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

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

Back to the top