KT-949 AssertionFailure in quick fix

This commit is contained in:
Nikolay Krasko
2012-01-11 16:16:34 +04:00
parent c39b333631
commit cb2219e72d
4 changed files with 36 additions and 2 deletions
@@ -123,6 +123,11 @@ public class JetPsiChecker implements Annotator {
catch (ProcessCanceledException e) {
throw e;
}
catch (AssertionError e) {
// For failing tests and to notify about idea internal error in -ea mode
holder.createErrorAnnotation(element, e.getClass().getCanonicalName() + ": " + e.getMessage());
throw e;
}
catch (Throwable e) {
// TODO
holder.createErrorAnnotation(element, e.getClass().getCanonicalName() + ": " + e.getMessage());
@@ -177,8 +177,7 @@ public class ImportClassFix extends JetHintAction<JetSimpleNameExpression> imple
@Nullable
@Override
public JetIntentionAction<JetSimpleNameExpression> createAction(@NotNull DiagnosticWithPsiElement diagnostic) {
assert diagnostic.getPsiElement() instanceof JetSimpleNameExpression;
// There could be different psi elements (i.e. JetArrayAccessExpression), but we can fix only JetSimpleNameExpression case
if (diagnostic.getPsiElement() instanceof JetSimpleNameExpression) {
JetSimpleNameExpression psiElement = (JetSimpleNameExpression) diagnostic.getPsiElement();
return new ImportClassFix(psiElement);
@@ -0,0 +1,15 @@
// "Import Class" "false"
package Teting
class Some() {
// fun get(i : Int) : Int {
// return i
// }
}
fun main(args : Array<String>) {
val some = Some()
// Nothing should be changed
<caret>some[12]
}
@@ -0,0 +1,15 @@
// "Import Class" "false"
package Teting
class Some() {
// fun get(i : Int) : Int {
// return i
// }
}
fun main(args : Array<String>) {
val some = Some()
// Nothing should be changed
<caret>some[12]
}