简体   繁体   中英

Eclipse plugin: content assist working in Galileo, not Ganymede

I am writing a custom editor in a plugin, and I developed it in Galileo. Now I'm trying to run it in Ganymede, but content assist doesn't work. There is no error, just nothing happens when I type "ctrl+space".

The way I'm doing it is by providing a custom Configuration class that extends SourceViewerConfiguration, overriding public IContentAssistant getContentAssistant(ISourceViewer sourceViewer). The method gets called when the editor is created but there is no content assist.

Was there any change from Ganymede to Galileo that I should be aware of?

I found the answer here: http://wiki.eclipse.org/FAQ_How_do_I_add_Content_Assist_to_my_editor%3F

In Ganymede it's necessary to override createActions to register the content assist one:

Action action = new ContentAssistAction(resourceBundle, "ContentAssistProposal.", this); String id = ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS action.setActionDefinitionId(id); setAction("ContentAssistProposal", action); markAsStateDependentAction("ContentAssistProposal", true);

That was not needed in Galileo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM