JET-107 Standard library classes are not shown in completion list
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package org.jetbrains.jet.lang.resolve;
|
package org.jetbrains.jet.lang.resolve;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.lang.ErrorHandler;
|
import org.jetbrains.jet.lang.ErrorHandler;
|
||||||
@@ -13,6 +14,7 @@ import java.util.Collection;
|
|||||||
*/
|
*/
|
||||||
public class WriteThroughScope extends WritableScopeWithImports {
|
public class WriteThroughScope extends WritableScopeWithImports {
|
||||||
private final WritableScope writableWorker;
|
private final WritableScope writableWorker;
|
||||||
|
private Collection<DeclarationDescriptor> allDescriptors;
|
||||||
|
|
||||||
public WriteThroughScope(@NotNull JetScope outerScope, @NotNull WritableScope scope, @NotNull ErrorHandler errorHandler) {
|
public WriteThroughScope(@NotNull JetScope outerScope, @NotNull WritableScope scope, @NotNull ErrorHandler errorHandler) {
|
||||||
super(outerScope, errorHandler);
|
super(outerScope, errorHandler);
|
||||||
@@ -149,6 +151,11 @@ public class WriteThroughScope extends WritableScopeWithImports {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
public Collection<DeclarationDescriptor> getAllDescriptors() {
|
||||||
return writableWorker.getAllDescriptors();
|
if (allDescriptors == null) {
|
||||||
|
allDescriptors = Lists.newArrayList();
|
||||||
|
allDescriptors.addAll(writableWorker.getAllDescriptors());
|
||||||
|
allDescriptors.addAll(getWorkerScope().getAllDescriptors());
|
||||||
|
}
|
||||||
|
return allDescriptors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user