Commit 9a1d769c authored by Benedikt Engeser's avatar Benedikt Engeser

s

parent d3d9926e
......@@ -3,38 +3,24 @@ package de.tum.in.www2.cupplugin.editors;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer;
import org.eclipse.jdt.internal.ui.text.ContentAssistPreference;
import org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor;
import org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor;
import org.eclipse.jdt.internal.ui.text.javadoc.JavadocCompletionProcessor;
import org.eclipse.jdt.ui.text.IJavaPartitions;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.DefaultInformationControl;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IInformationControl;
import org.eclipse.jface.text.IInformationControlCreator;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.ITypedRegion;
import org.eclipse.jface.text.contentassist.CompletionProposal;
import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContentAssistant;
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.texteditor.ITextEditor;
import de.in.tum.www2.cup.CupSymbol;
import de.in.tum.www2.cup.Declarations;
import de.in.tum.www2.cup.ast.ParserResult;
import de.tum.in.www2.cupplugin.IDisposable;
import de.tum.in.www2.cupplugin.controller.Controller;
import de.tum.in.www2.cupplugin.model.*;
@SuppressWarnings("restriction")
public class CupContentAssistProcessor implements IContentAssistProcessor,
IDisposable, ICupParserASTChangeObserver {
......@@ -43,9 +29,8 @@ public class CupContentAssistProcessor implements IContentAssistProcessor,
/*
* TODO: Find the way to get the Java Code assistant here
*/
private IContentAssistProcessor javaProcessor = null;
private IContentAssistProcessor javaProcessor = null;
public CupContentAssistProcessor(IDocument doc) {
this.decls = new Declarations();
......@@ -53,23 +38,15 @@ public class CupContentAssistProcessor implements IContentAssistProcessor,
Model model = Model.getInstanceForDocument(doc);
updateFromParserResult(model.getAstModel());
model.registerModelObserver(this);
this.javaProcessor = getJavaContentAssistProcessor();
}
@SuppressWarnings("restriction")
private IContentAssistProcessor getJavaContentAssistProcessor() {
JavaCompletionProcessor r = null;
return r;
}
public void dispose() {
Model.getInstanceForDocument(doc).unregisterModelObserver(this);
}
......@@ -162,8 +139,8 @@ public class CupContentAssistProcessor implements IContentAssistProcessor,
&& ((myWord.equals("")) || (terminalName.length() >= myWord
.length() && terminalName.substring(0,
myWord.length()).equals(myWord)))) {
proposals.add(new CompletionProposal(terminalName,
offset - myWord.length(), myFullWord.length(),
proposals.add(new CompletionProposal(terminalName, offset
- myWord.length(), myFullWord.length(),
terminalName.length()));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment