EA-39175 Completion fails if MultiDeclaration is present on top level in file
This commit is contained in:
+3
-2
@@ -245,8 +245,9 @@ public abstract class AbstractLazyMemberScope<D extends DeclarationDescriptor, D
|
||||
getProperties(name);
|
||||
}
|
||||
}
|
||||
else if (declaration instanceof JetTypedef) {
|
||||
// Do nothing as typedefs are not supported
|
||||
else if (declaration instanceof JetTypedef || declaration instanceof JetMultiDeclaration) {
|
||||
// Do nothing for typedefs as they are not supported.
|
||||
// MultiDeclarations are not supported on global level too.
|
||||
}
|
||||
else {
|
||||
throw new IllegalArgumentException("Unsupported declaration kind: " + declaration);
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ public abstract class AbstractPsiBasedDeclarationProvider implements Declaration
|
||||
JetClassOrObject classOrObject = (JetClassOrObject) declaration;
|
||||
classesAndObjects.put(classOrObject.getNameAsName(), classOrObject);
|
||||
}
|
||||
else if (declaration instanceof JetParameter || declaration instanceof JetTypedef) {
|
||||
else if (declaration instanceof JetParameter || declaration instanceof JetTypedef || declaration instanceof JetMultiDeclaration) {
|
||||
// Do nothing, just put it into allDeclarations is enough
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
data class LocalData(val first : Int, val second : Int)
|
||||
|
||||
val (localFirst, localSecond) = LocalData(11, 12)
|
||||
|
||||
fun test() {
|
||||
local<caret>
|
||||
}
|
||||
|
||||
// Test that this test won't fail with exception
|
||||
// Regression for EA-39175
|
||||
|
||||
// ABSENT: localFirst, localSecond
|
||||
@@ -100,6 +100,10 @@ public class JetBasicCompletionTest extends JetCompletionTestBase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInFileWithMultiDeclaration() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInFileWithTypedef() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user