1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Turned off all interaction with content assist with the PDOM. There isn't enough information in the PDOM for this to work correctly yet.

This commit is contained in:
Doug Schaefer 2006-05-24 22:24:57 +00:00
parent c5ecc9ca4c
commit 0d6c0848f7
5 changed files with 27 additions and 13 deletions

View file

@ -15,6 +15,7 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.CDOM;
import org.eclipse.cdt.core.dom.ICodeReaderFactory;
import org.eclipse.cdt.core.dom.ast.ASTCompletionNode;
import org.eclipse.cdt.core.dom.ast.IASTName;
@ -155,8 +156,11 @@ public class GCCLanguage extends PlatformObject implements ILanguage {
scanInfo = new ScannerInfo();
}
PDOM pdom = (PDOM)CCorePlugin.getPDOMManager().getPDOM(workingCopy.getCProject()).getAdapter(PDOM.class);
ICodeReaderFactory fileCreator = new PDOMCodeReaderFactory(pdom);
// TODO use the pdom once we get enough info into it
// PDOM pdom = (PDOM)CCorePlugin.getPDOMManager().getPDOM(workingCopy.getCProject()).getAdapter(PDOM.class);
// ICodeReaderFactory fileCreator = new PDOMCodeReaderFactory(pdom);
ICodeReaderFactory fileCreator = CDOM.getInstance().getCodeReaderFactory(CDOM.PARSE_WORKING_COPY_WHENEVER_POSSIBLE);
String path
= resource != null

View file

@ -15,6 +15,7 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.CDOM;
import org.eclipse.cdt.core.dom.ICodeReaderFactory;
import org.eclipse.cdt.core.dom.ast.ASTCompletionNode;
import org.eclipse.cdt.core.dom.ast.IASTName;
@ -154,8 +155,11 @@ public class GPPLanguage extends PlatformObject implements ILanguage {
scanInfo = new ScannerInfo();
}
PDOM pdom = (PDOM)CCorePlugin.getPDOMManager().getPDOM(workingCopy.getCProject()).getAdapter(PDOM.class);
ICodeReaderFactory fileCreator = new PDOMCodeReaderFactory(pdom);
// TODO use the pdom once we get enough info into it
// PDOM pdom = (PDOM)CCorePlugin.getPDOMManager().getPDOM(workingCopy.getCProject()).getAdapter(PDOM.class);
// ICodeReaderFactory fileCreator = new PDOMCodeReaderFactory(pdom);
ICodeReaderFactory fileCreator = CDOM.getInstance().getCodeReaderFactory(CDOM.PARSE_WORKING_COPY_WHENEVER_POSSIBLE);
CodeReader reader = new CodeReader(resource.getLocation().toOSString(), workingCopy.getContents());
IScannerExtensionConfiguration scannerExtensionConfiguration

View file

@ -14,6 +14,7 @@ import org.eclipse.cdt.core.dom.CDOM;
import org.eclipse.cdt.core.dom.ICodeReaderFactory;
import org.eclipse.cdt.core.model.IWorkingCopyProvider;
import org.eclipse.cdt.core.parser.CodeReader;
import org.eclipse.cdt.core.parser.IScanner;
/**
* @author jcamelon
@ -38,7 +39,7 @@ public class WorkingCopyCodeReaderFactory extends
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ICodeReaderFactory#createCodeReaderForInclusion(java.lang.String)
*/
public CodeReader createCodeReaderForInclusion(String path) {
public CodeReader createCodeReaderForInclusion(IScanner scanner, String path) {
return checkWorkingCopyThenCache(path);
}

View file

@ -76,15 +76,16 @@ public class OpenDeclarationsAction extends SelectionParseAction {
});
} else if (binding instanceof PDOMBinding) {
final IASTName name = ((PDOMBinding)binding).getFirstDeclaration();
Display.getDefault().asyncExec(new Runnable() {
public void run() {
try {
open(name);
} catch (CoreException e) {
CUIPlugin.getDefault().log(e);
if (name != null)
Display.getDefault().asyncExec(new Runnable() {
public void run() {
try {
open(name);
} catch (CoreException e) {
CUIPlugin.getDefault().log(e);
}
}
}
});
});
}
}
}

View file

@ -53,6 +53,10 @@ public class PDOMCompletionContributor extends DOMCompletionContributor implemen
if (completionNode == null)
return;
// Return anyway
if (completionNode != null)
return;
try {
IPDOM pdom = CCorePlugin.getPDOMManager().getPDOM(workingCopy.getCProject());