Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Keyword with whitespace
Keyword with whitespace [message #1836213] Thu, 24 December 2020 11:07 Go to next message
Alex Gor is currently offline Alex GorFriend
Messages: 159
Registered: November 2014
Location: Russia
Senior Member
Dears

XText is able to support keyword with whitespaces

In case I write in grammar something like :
MY_KEYWORD:
	"KeywordStart KeywordSecond"
;


Xtext suggests me to rewrite as

MY_KEYWORD:
	"KeywordStart"  "KeywordSecond"
;


But seems to me it is not fully corresponded

Thank you in advance
Re: Keyword with whitespace [message #1836513 is a reply to message #1836213] Wed, 06 January 2021 15:17 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

The first alternative would require to use always exactly one space between the kewyords. No tab, no newline. It is generally recommended to split multiple keywords. What you likely want is that you get proposed to insert the second keyword along when starting typing the first keyword and use content assist to complete that. Therefore handle this with customizing content assist.
Read more here: https://blogs.itemis.com/en/xtext-hint-content-assist-for-multiple-consecutive-keywords
Re: Keyword with whitespace [message #1836514 is a reply to message #1836513] Wed, 06 January 2021 15:18 Go to previous message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

double post of https://www.eclipse.org/forums/index.php?t=rview&goto=1836212#msg_1836212
Previous Topic:Nested project: Dsl files compiled twice
Next Topic:Full language inheritance
Goto Forum:
  


Current Time: Thu Apr 18 00:53:02 GMT 2024

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

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

Back to the top