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);
|
getProperties(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (declaration instanceof JetTypedef) {
|
else if (declaration instanceof JetTypedef || declaration instanceof JetMultiDeclaration) {
|
||||||
// Do nothing as typedefs are not supported
|
// Do nothing for typedefs as they are not supported.
|
||||||
|
// MultiDeclarations are not supported on global level too.
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new IllegalArgumentException("Unsupported declaration kind: " + declaration);
|
throw new IllegalArgumentException("Unsupported declaration kind: " + declaration);
|
||||||
|
|||||||
+1
-1
@@ -64,7 +64,7 @@ public abstract class AbstractPsiBasedDeclarationProvider implements Declaration
|
|||||||
JetClassOrObject classOrObject = (JetClassOrObject) declaration;
|
JetClassOrObject classOrObject = (JetClassOrObject) declaration;
|
||||||
classesAndObjects.put(classOrObject.getNameAsName(), classOrObject);
|
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
|
// Do nothing, just put it into allDeclarations is enough
|
||||||
}
|
}
|
||||||
else {
|
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();
|
doTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testInFileWithMultiDeclaration() {
|
||||||
|
doTest();
|
||||||
|
}
|
||||||
|
|
||||||
public void testInFileWithTypedef() {
|
public void testInFileWithTypedef() {
|
||||||
doTest();
|
doTest();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user