Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [SOLVED] Content Assist Invalid completeXMemberFeatureCall_Feature
[SOLVED] Content Assist Invalid completeXMemberFeatureCall_Feature [message #1737515] Fri, 08 July 2016 21:14 Go to next message
Eclipse UserFriend
Hi all.

I have a problem with the content assistant. Let consider the following code written with my DSL:
class MyType {
    static def myfct() {}
}
class MyType2 {
    def myfct() : void {
          MyType::
    }
}


If I'm pushing Ctrl+Space just after "MyType::", I have no proposal.

My proposal provider is implemented as:
public class SARLProposalProvider extends AbstractSARLProposalProvider {
   public void completeXMemberFeatureCall_Feature(EObject model, Assignment assignment, ContentAssistContext context,
			ICompletionProposalAcceptor acceptor) {
       super.completeXMemberFeatureCall_Feature(model, assignment, context, acceptor);
    }
}


When I'm debugging my proposal provider, the type of the "model" parameter is a SarlClassImpl, not a XMemberFeatureCallImpl. This is the reason why there is no proposal.

But, when I'm debugging the similar function in the Xtend proposal provider, with a similar Xtend input program, I obtain a XMemberFeatureCallImpl for the model parameter, not a XtendClassImpl (that is the expected behavior).

Is anyone encountered this issue, and have a fix? Or is anyone may give me an starting point for solving this issue?

The grammar of my DSL is grammar.

Thank you.
Stéphane.

[Updated on: Wed, 27 July 2016 09:33] by Moderator

Report message to a moderator

Re: Content Assist Invalid completeXMemberFeatureCall_Feature [message #1739062 is a reply to message #1737515] Wed, 27 July 2016 09:32 Go to previous message
Eclipse UserFriend
Dear all.

For solving my problem, I have found a solution.

Previously my DSL grammar was defined in such a way that grammar backtracks are enabled in the mwe2 XtextAntlrGenerator fragment:
fragment = parser.antlr.XtextAntlrGeneratorFragment2 auto-inject {
				removeBacktrackingGuards = true
				lookaheadThreshold = '5'
				partialParsing = true
				debugGrammar = true
				options = auto-inject {
					backtrack = true
				}
			}


The solution is based on the refactoring of the grammar in such a way that backtracks are no more needed for generating the Lexer.
Turning the "backtrack" option to "false" means that the grammar must be rewrote for avoiding backtracks.

With a not-backtracking grammar, the content assist is now able to provide the proposals for the case that is explained at the beginning of this post.

Have fun.
Stéphane.

[Updated on: Wed, 27 July 2016 09:34] by Moderator

Report message to a moderator

Previous Topic:Umlauts and UTF-8 BOM
Next Topic:Xtext - Content Assist
Goto Forum:
  


Current Time: Fri Feb 14 13:28:19 GMT 2025

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

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

Back to the top