Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsContext dependent auto activation of content assist
https://www.eclipse.org/forums/index.php/mv/msg/447883/999492/#msg_999492
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?
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?
]]>Alex G2013-01-12T08:35:49-00:00Re: Context dependent auto activation of content assist
https://www.eclipse.org/forums/index.php/mv/msg/447883/1000186/#msg_1000186
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?
>
>]]>Sebastian Zarnekow2013-01-14T07:59:01-00:00