diff --git a/core/org.eclipse.cdt.ui/plugin.properties b/core/org.eclipse.cdt.ui/plugin.properties index fdedc7c2f21..88d0ed99407 100644 --- a/core/org.eclipse.cdt.ui/plugin.properties +++ b/core/org.eclipse.cdt.ui/plugin.properties @@ -304,3 +304,7 @@ ExternalSearchEditor.name=External Search Editor #--- templates c.contextType.name = C + +# completion + +completionContributors=Code Assist Completion Contributor diff --git a/core/org.eclipse.cdt.ui/plugin.xml b/core/org.eclipse.cdt.ui/plugin.xml index d9faafff4b6..0d72eab2f20 100644 --- a/core/org.eclipse.cdt.ui/plugin.xml +++ b/core/org.eclipse.cdt.ui/plugin.xml @@ -44,6 +44,7 @@ + @@ -1324,4 +1325,12 @@ + + + + diff --git a/core/org.eclipse.cdt.ui/schema/completionContributors.exsd b/core/org.eclipse.cdt.ui/schema/completionContributors.exsd new file mode 100644 index 00000000000..31e7289ba5c --- /dev/null +++ b/core/org.eclipse.cdt.ui/schema/completionContributors.exsd @@ -0,0 +1,119 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + + + + + + + + + diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProcessor2.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProcessor2.java index 35791f4ffe8..2a83e74029c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProcessor2.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProcessor2.java @@ -66,7 +66,7 @@ public class CCompletionProcessor2 implements IContentAssistProcessor { offset, new ICodeReaderFactory() { public CodeReader createCodeReaderForTranslationUnit(String path) { - return new CodeReader(viewer.getDocument().get().toCharArray()); + return new CodeReader(path, viewer.getDocument().get().toCharArray()); } public CodeReader createCodeReaderForInclusion(String path) { return ParserUtil.createReader(path, diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionContributor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionContributor.java new file mode 100644 index 00000000000..bc601211fe5 --- /dev/null +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionContributor.java @@ -0,0 +1,23 @@ +/********************************************************************** + * Copyright (c) 2004 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + **********************************************************************/ +package org.eclipse.cdt.internal.ui.text.contentassist; + +import org.eclipse.cdt.core.dom.ast.ASTCompletionNode; +import org.eclipse.cdt.ui.text.contentassist.ICompletionContributor; +import org.eclipse.jface.text.ITextViewer; +import org.eclipse.jface.text.contentassist.ICompletionProposal; + +public class DOMCompletionContributor implements ICompletionContributor { + + public ICompletionProposal[] contributeCompletionProposals( + ITextViewer viewer, int offset, ASTCompletionNode node) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/contentassist/ICompletionContributor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/contentassist/ICompletionContributor.java new file mode 100644 index 00000000000..a528ebd3cc4 --- /dev/null +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/contentassist/ICompletionContributor.java @@ -0,0 +1,18 @@ +/********************************************************************** + * Copyright (c) 2004 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + **********************************************************************/ +package org.eclipse.cdt.ui.text.contentassist; + +import org.eclipse.cdt.core.dom.ast.ASTCompletionNode; +import org.eclipse.jface.text.ITextViewer; +import org.eclipse.jface.text.contentassist.ICompletionProposal; + +public interface ICompletionContributor { + + ICompletionProposal[] contributeCompletionProposals(ITextViewer viewer, int offset, ASTCompletionNode node); + +}