diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/c/GCCLanguage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/c/GCCLanguage.java index b48e1a8d02a..c21a5a6fe6e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/c/GCCLanguage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/c/GCCLanguage.java @@ -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 diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/GPPLanguage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/GPPLanguage.java index 5af84322249..06d9d352f7a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/GPPLanguage.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/GPPLanguage.java @@ -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 diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/WorkingCopyCodeReaderFactory.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/WorkingCopyCodeReaderFactory.java index b8e5083a189..4e173f50266 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/WorkingCopyCodeReaderFactory.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/dom/WorkingCopyCodeReaderFactory.java @@ -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); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsAction.java index 5a3f7705447..535d2520a3c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsAction.java @@ -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); + } } - } - }); + }); } } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/PDOMCompletionContributor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/PDOMCompletionContributor.java index 08ecc615056..66cd95aa9ba 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/PDOMCompletionContributor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/PDOMCompletionContributor.java @@ -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());