Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2008-12-17 16:18:50 +0000
committerMarkus Schorn2008-12-17 16:18:50 +0000
commiteea81e9d95c1b8dadd23fc29d09f5aded43c2a32 (patch)
treee15236528eccf16e23c244391924735c90b0790c /core/org.eclipse.cdt.core/browser
parenta036483c1817b7aadb44c6f3fbbca01ae89ad835 (diff)
downloadorg.eclipse.cdt-eea81e9d95c1b8dadd23fc29d09f5aded43c2a32.tar.gz
org.eclipse.cdt-eea81e9d95c1b8dadd23fc29d09f5aded43c2a32.tar.xz
org.eclipse.cdt-eea81e9d95c1b8dadd23fc29d09f5aded43c2a32.zip
Static variables shown as global in search, bug 255192.
Diffstat (limited to 'core/org.eclipse.cdt.core/browser')
-rw-r--r--core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/IndexTypeInfo.java9
-rw-r--r--core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/IndexModelUtil.java5
2 files changed, 10 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/IndexTypeInfo.java b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/IndexTypeInfo.java
index 94949ed3626..502c22990ea 100644
--- a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/IndexTypeInfo.java
+++ b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/IndexTypeInfo.java
@@ -51,7 +51,7 @@ import org.eclipse.core.runtime.Path;
/**
* @author Doug Schaefer
- *
+ * @noextend This class is not intended to be subclassed by clients.
*/
public class IndexTypeInfo implements ITypeInfo, IFunctionInfo {
private static int hashCode(String[] array) {
@@ -562,4 +562,11 @@ public class IndexTypeInfo implements ITypeInfo, IFunctionInfo {
return false;
return true;
}
+
+ /**
+ * @since 5.1
+ */
+ public boolean isFileLocal() {
+ return fileLocal != null;
+ }
}
diff --git a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/IndexModelUtil.java b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/IndexModelUtil.java
index f06677dc29f..48b1d9f502d 100644
--- a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/IndexModelUtil.java
+++ b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/IndexModelUtil.java
@@ -17,6 +17,7 @@ package org.eclipse.cdt.internal.core.browser;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
import org.eclipse.cdt.core.dom.ast.DOMException;
+import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.ICompositeType;
import org.eclipse.cdt.core.dom.ast.IEnumeration;
@@ -27,8 +28,6 @@ import org.eclipse.cdt.core.dom.ast.IParameter;
import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.IVariable;
-import org.eclipse.cdt.core.dom.ast.c.ICFunctionScope;
-import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceAlias;
@@ -141,7 +140,7 @@ public class IndexModelUtil {
scope = binding.getScope();
} catch (DOMException e) {
}
- if (scope instanceof ICPPBlockScope || scope instanceof ICFunctionScope) {
+ if (scope != null && scope.getKind() == EScopeKind.eLocal) {
elementType= ICElement.C_VARIABLE_LOCAL;
} else {
elementType = ICElement.C_VARIABLE;

Back to the top