use of org.eclipse.cdt.internal.ui.editor.CEditor in project linuxtools by eclipse.
the class ContentAssistTests method getResults.
protected ICompletionProposal[] getResults(IFile file, int offset) throws Exception {
disableContributions();
// call the ContentAssistProcessor
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
FileEditorInput editorInput = new FileEditorInput(file);
IEditorPart editorPart = page.openEditor(editorInput, "org.eclipse.cdt.ui.editor.CEditor");
CEditor editor = (CEditor) editorPart;
@SuppressWarnings("unused") IAction completionAction = editor.getAction("ContentAssistProposal");
String contentType = editor.getViewer().getDocument().getContentType(offset);
ContentAssistant assistant = new ContentAssistant();
CContentAssistProcessor processor = new CContentAssistProcessor(editor, assistant, contentType);
return processor.computeCompletionProposals(editor.getViewer(), offset);
}
Aggregations