Context dependent auto activation of content assist [message #999492] |
Sat, 12 January 2013 08:35 |
Alex G Messages: 96 Registered: January 2012 |
Member |
|
|
Hi!
I want to do the following:
If the user calls content assist (e.g. CTRL+SPACE) and chooses a String to be entered, then I want that dependent of the EObject (model object) behind this string, the content assist is automatically reactivated in order to propose further strings.
Example: You have qualified names "a.b", but in the content assist you only show first "a", then "." and afterwards "b" if the user repeatedly calls CA manually.
Sure one could solve this by calling CA manually on "a", then press "." and the do the default auto activation dependent on the string "." entered (there are some posts and blogs about it on the web, how to do it). But how can I solve it without even pressing "." manually?
So far, I found out, that I can call
sourceViewer.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS)
in order to activate CA manually (where sourceViewer is of type XtextSourceViewer).
I tried this call by configuring an IAutoEditStrategy for an AutoEditStrategyProvider. But the AutoEditStrategyProvider is only invoked, when I edit the document. So: Where do I have to hook in, when I just navigate in the document, or even better: after a chosen string is inserted by the CA automatically?
|
|
|
Re: Context dependent auto activation of content assist [message #1000186 is a reply to message #999492] |
Mon, 14 January 2013 07:59 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Alex,
please search this newsgroup for COMPLETION_AUTO_ACTIVATION_CHARS.
They are used to automatically trigger content assist for certain input
events.
Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 12.01.13 09:35, schrieb Alex G:
> Hi!
>
> I want to do the following:
>
> If the user calls content assist (e.g. CTRL+SPACE) and chooses a String
> to be entered, then I want that dependent of the EObject (model object)
> behind this string, the content assist is automatically reactivated in
> order to propose further strings.
>
> Example: You have qualified names "a.b", but in the content assist you
> only show first "a", then "." and afterwards "b" if the user repeatedly
> calls CA manually.
>
> Sure one could solve this by calling CA manually on "a", then press "."
> and the do the default auto activation dependent on the string "."
> entered (there are some posts and blogs about it on the web, how to do
> it). But how can I solve it without even pressing "." manually?
>
> So far, I found out, that I can call
> sourceViewer.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS)
>
> in order to activate CA manually (where sourceViewer is of type
> XtextSourceViewer).
> I tried this call by configuring an IAutoEditStrategy for an
> AutoEditStrategyProvider. But the AutoEditStrategyProvider is only
> invoked, when I edit the document. So: Where do I have to hook in, when
> I just navigate in the document, or even better: after a chosen string
> is inserted by the CA automatically?
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02659 seconds