jdr: properly fetch supertype member names

previous implementation relied on Idea PSI resolver that doesn't
work well in certain situations
This commit is contained in:
Stepan Koltsov
2012-06-17 05:28:01 +04:00
parent b33fc76c12
commit 9b13a308f8
5 changed files with 61 additions and 16 deletions
@@ -88,6 +88,9 @@ public interface JetScope {
Collection<DeclarationDescriptor> getAllDescriptors();
@NotNull
Collection<Name> getAllDescriptorNames();
/**
* @return EFFECTIVE implicit receiver at this point (may be corresponding to an outer scope)
*/
@@ -16,9 +16,13 @@
package org.jetbrains.jet.lang.resolve.scopes;
import com.google.common.collect.Sets;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
import org.jetbrains.jet.lang.resolve.name.Name;
import java.util.Collection;
import java.util.Set;
/**
* @author Stepan Koltsov
@@ -30,4 +34,14 @@ public abstract class JetScopeBase implements JetScope {
return getAllDescriptors(DescriptorPredicate.all());
}
@NotNull
@Override
public Collection<Name> getAllDescriptorNames() {
// dummy implementation
Set<Name> r = Sets.newHashSet();
for (DeclarationDescriptor descriptor : getAllDescriptors()) {
r.add(descriptor.getName());
}
return r;
}
}