use of org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension in project xtext-eclipse by eclipse.
the class SpellingQuickfixTest method computeQuickAssistProposals.
protected ICompletionProposal[] computeQuickAssistProposals(int offset) {
XtextSourceViewer sourceViewer = getSourceViewer();
XtextReconciler reconciler = (XtextReconciler) sourceViewer.getAdapter(IReconciler.class);
IReconcilingStrategyExtension reconcilingStrategyExtension = (IReconcilingStrategyExtension) reconciler.getReconcilingStrategy("");
reconcilingStrategyExtension.initialReconcile();
QuickAssistAssistant quickAssistAssistant = (QuickAssistAssistant) sourceViewer.getQuickAssistAssistant();
IQuickAssistProcessor quickAssistProcessor = quickAssistAssistant.getQuickAssistProcessor();
ICompletionProposal[] quickAssistProposals = quickAssistProcessor.computeQuickAssistProposals(new TextInvocationContext(sourceViewer, offset, -1));
return quickAssistProposals;
}
use of org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension in project xtext-eclipse by eclipse.
the class XtextReconciler method handleInputDocumentChanged.
protected void handleInputDocumentChanged(IDocument oldInput, IDocument newInput) {
if (Display.getCurrent() == null) {
log.error("Changes to the document must only be applied from the Display thread to keep them ordered", new Exception());
}
if (shouldInstallCompletionListener) {
ContentAssistantFacade facade = ((ISourceViewerExtension4) textViewer).getContentAssistantFacade();
if (facade != null) {
facade.addCompletionListener(documentListener);
}
shouldInstallCompletionListener = false;
}
if (oldInput != newInput) {
if (oldInput instanceof IXtextDocument) {
((IXtextDocument) oldInput).removeXtextDocumentContentObserver(documentListener);
}
if (newInput instanceof IXtextDocument) {
((IXtextDocument) newInput).addXtextDocumentContentObserver(documentListener);
final IXtextDocument document = XtextDocumentUtil.get(textViewer);
strategy.setDocument(document);
if (!initalProcessDone && strategy instanceof IReconcilingStrategyExtension) {
initalProcessDone = true;
IReconcilingStrategyExtension reconcilingStrategyExtension = (IReconcilingStrategyExtension) strategy;
reconcilingStrategyExtension.initialReconcile();
}
}
}
if (oldInput != null && newInput != null) {
handleDocumentChanged(new InputChangedDocumentEvent(oldInput, newInput));
}
}
use of org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension in project erlide_eclipse by erlang.
the class ErlReconciler method initialProcess.
/**
* This method is called on startup of the background activity. It is called
* only once during the life time of the reconciler.
*/
protected void initialProcess() {
synchronized (fMutex) {
if (fStrategy instanceof IReconcilingStrategyExtension) {
final IReconcilingStrategyExtension extension = (IReconcilingStrategyExtension) fStrategy;
extension.initialReconcile();
}
}
}
use of org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension in project erlide_eclipse by erlang.
the class ErlReconciler method setProgressMonitor.
public void setProgressMonitor(final IProgressMonitor monitor) {
fProgressMonitor = monitor;
if (fStrategy instanceof IReconcilingStrategyExtension) {
final IReconcilingStrategyExtension extension = (IReconcilingStrategyExtension) fStrategy;
extension.setProgressMonitor(monitor);
}
}
Aggregations