Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » case keywords as you type
case keywords as you type [message #830869] Wed, 28 March 2012 06:39 Go to next message
Marian Edu is currently offline Marian EduFriend
Messages: 10
Registered: March 2012
Junior Member
Hi Guys,

I'm new to xtext so this might be an easy one for many of you but I've couldn't find the answer to my problem by a quick forum search Smile

The issue is, while I'm enjoying the case-insensitive option for my language it will be nice to have all keywords use the same case so I've thought to make it user configurable (believe it or not there still are quite a few peoples that like to have them UPERCASED). Thing is, where should I 'hook' my change case action so it can be triggered as you type?

I've tried to glue an editor that extends XtextEditor and add a listener on it but I rather don't go as low as working in the IDocumentListener so I've tried the IXtextModelListener instead but then how do I get the editor to refresh with the changes done on the model?

But as I've said, there might be a simple/better way to do it that I'm not aware of... any help greatly appreciated.

Regards,
Marian
Re: case keywords as you type [message #830968 is a reply to message #830869] Wed, 28 March 2012 09:33 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
One possible hook is IAutoEditStrategy. In Xtext1 you find some code in the xtext.ui plugin in the ...ui.editor.autoedit package. I guess in Xtext2 the code will be located similarly.

Alex
Re: case keywords as you type [message #831029 is a reply to message #830968] Wed, 28 March 2012 11:17 Go to previous messageGo to next message
Marian Edu is currently offline Marian EduFriend
Messages: 10
Registered: March 2012
Junior Member
Alex, it does look like what I was after... I'll give that a try and see how it goes.

Thanks.
Re: case keywords as you type [message #831056 is a reply to message #831029] Wed, 28 March 2012 12:06 Go to previous messageGo to next message
Marian Edu is currently offline Marian EduFriend
Messages: 10
Registered: March 2012
Junior Member
works like a charm, thanks again.
Re: case keywords as you type [message #1028542 is a reply to message #831056] Thu, 28 March 2013 11:47 Go to previous message
Cash Ko is currently offline Cash KoFriend
Messages: 21
Registered: May 2012
Junior Member
Hi Marian,

can u share your code to me or give me a hint how did you solved this issue (i have the very similar task to do in my xtext project)?

Thanks!
Previous Topic:Xtext: Referencing Elements of one DSL from another DSL Problem
Next Topic:Update to Xtext 2.4 and Xtend 2.4
Goto Forum:
  


Current Time: Fri Apr 26 02:50:24 GMT 2024

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

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

Back to the top