Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Recommended terminal value for auto-completion
Recommended terminal value for auto-completion [message #1820843] Thu, 30 January 2020 04:40 Go to next message
Eclipse UserFriend
Hello,
I have simple model for testing auto-complition string values.
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals
generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"
Model:
	items+= (Entity  | Dictionary | Rule)*
;
Entity:
	'entity' name=ID
;
Dictionary:
	'RecommendedValues' 'for' entity=[Entity|ID]
	'[' values+= STRING+ ']' 
;
Rule:
	'Selected' 'value' 'for' entity=[Entity|ID] '=' refValue=STRING
;


Is it possible implement auto-completion in UI with list of 'RecommendedValues' but with possibility to insert arbitrary value?
Re: Recommended terminal value for auto-completion [message #1820846 is a reply to message #1820843] Thu, 30 January 2020 05:18 Go to previous messageGo to next message
Eclipse UserFriend
hi you might have a look at the concept of template proposals.
you can create them
- shipping templates.xml
- condiguratively
- programmatically

https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#templates
Re: Recommended terminal value for auto-completion [message #1820849 is a reply to message #1820846] Thu, 30 January 2020 06:29 Go to previous messageGo to next message
Eclipse UserFriend
Thank you,
I'll check this one.
BTW, are template proposals compatible with web or LSP?
Re: Recommended terminal value for auto-completion [message #1820850 is a reply to message #1820849] Thu, 30 January 2020 07:01 Go to previous message
Eclipse UserFriend
no. and "depends on how you implement it" see https://github.com/itemis/xtext-languageserver-example/blob/41cb80481485a61efbdfc744029260a916c38011/org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/contentassist/MyDslIdeContentProposalProvider.xtend#L18
Previous Topic:Debugging a DSL with spaces in its path
Next Topic:cross reference between two resources
Goto Forum:
  


Current Time: Fri Jul 11 21:43:41 EDT 2025

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

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

Back to the top