Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Xtext showing unwanted contents(Xtext showing unwanted contents)
Xtext showing unwanted contents [message #1740058] Mon, 08 August 2016 11:02 Go to next message
Eclipse UserFriend
Hi,

Content assist showing unwanted contents.
index.php/fa/26708/0/

class JPLEditorUiModule extends AbstractJPLEditorUiModule {
override configure(Binder binder) {
super.configure(binder);
binder.bind(String).annotatedWith(Names.named((XtextContentAssistProcessor.COMPLETION_AUTO_ACTIVATION_CHARS))).toInstance(">");
}
}
Re: Xtext showing unwanted contents [message #1740060 is a reply to message #1740058] Mon, 08 August 2016 11:05 Go to previous messageGo to next message
Eclipse UserFriend
COMPLETION_AUTO_ACTIVATION_CHARS and the content assist entries hav nothing todo with each other.

it seems like your grammar is in a way that error recovery doesnt know what to do.
this is why you get this very generic proposals
Re: Xtext showing unwanted contents [message #1740064 is a reply to message #1740058] Mon, 08 August 2016 13:02 Go to previous messageGo to next message
Eclipse UserFriend
Which kind of proposals would you expect?
Which proposals are wrong?
Did you customize your proposal provider?
Do you have backtracking enabled?
Re: Xtext showing unwanted contents [message #1740120 is a reply to message #1740064] Tue, 09 August 2016 08:36 Go to previous messageGo to next message
Eclipse UserFriend
Yes I have backtracking enabled.

My Grammar:

Annotation: {Annotation} '@app' '(' (appExp+=Expression)* ')' ('->'appExp+=Expression);

Widget: {Widget} '@widget' '(' (widgetExp+=Expression)* ')' (widgetExp+=Expression)* (('->'|'=')widgetExp+=Expression*)?;

ScreenNum : {ScreenNum} ('@screen_num'|'@screen') '(' (screenExp+=Expression)* ')' ('->'screenExp+=Expression)?;

FieldNum: {FieldNum} ('@field_num')(fieldExp+=Expression) (fieldExp+=Expression)? ('->'fieldExp+=Expression)?;

IdObject: {IdObject} '@id' '('(idExp+=Expression)* ')' ('->'idExp+=Expression)?;

TpReq: {TpReq} '@tp_req' '(' (tpreqExp+=Expression)* ')' ('->'tpreqExp+=Expression)?;

Sm_library : smExp='sm_'ID;

Dm_library : dmExp='dm_'ID;

Proposal Provider Code:

override completeDm_library_DmExp(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
println("Inside dm_ after acceptor::::::::::")
for(String dmLibFunc : DmLibFuncSet) {
acceptor.accept(createCompletionProposal(dmLibFunc,dmLibFunc,null /*getBlackImage()*/,context));
}
}

override completeSm_library_SmExp(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
println("Inside sm_ after acceptor::::::::::")
for(String smLibFunc : smLibFuncSet) {
acceptor.accept(createCompletionProposal(smLibFunc,smLibFunc,null /*getBlackImage()*/,context));
}
}

What kind of customization I need to do?
Re: Xtext showing unwanted contents [message #1740122 is a reply to message #1740120] Tue, 09 August 2016 08:44 Go to previous messageGo to next message
Eclipse UserFriend
When I click on @app()->, @widget()-> etc it should only '@app()', '@widget' related stuff but it is calling 'sm_' and 'dm_' stuff also.
Re: Xtext showing unwanted contents [message #1740694 is a reply to message #1740122] Wed, 17 August 2016 07:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I have added return in all overridden proposal methods still content assist showing the junk values.
Re: Xtext showing unwanted contents [message #1740695 is a reply to message #1740694] Wed, 17 August 2016 07:12 Go to previous messageGo to next message
Eclipse UserFriend
Sry. From my point of view we have discussed a lot about your grammar problems. Unless you don't solve then systematically ...
If you override all methods e.g. Complete keyword you won't get any of the proposals in the screenshot
Re: Xtext showing unwanted contents [message #1740699 is a reply to message #1740695] Wed, 17 August 2016 07:26 Go to previous messageGo to next message
Eclipse UserFriend
I overrode every method still it is coming.
Re: Xtext showing unwanted contents [message #1740702 is a reply to message #1740699] Wed, 17 August 2016 08:08 Go to previous messageGo to next message
Eclipse UserFriend
please create a new minimal + complete grammar what reproduces the problem and share it with your proposal provider
Re: Xtext showing unwanted contents [message #1740703 is a reply to message #1740702] Wed, 17 August 2016 08:15 Go to previous message
Eclipse UserFriend
I confirm that a backtracking grammar may cause the content assist provider to give unexpected proposals.
Refactoring the grammar for removing backtracking had solved my issue.
Previous Topic:[SOLVED] @SuppressWarning in my DSL
Next Topic:[SOLVED] ValidationTestHelper - getting the correct messageParts for assertError
Goto Forum:
  


Current Time: Sun Nov 02 05:13:24 EST 2025

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

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

Back to the top