Removed UNRESOLVED_IDE_TEMPLATE diagnostic factory, since this check will be moved to CLI.

This commit is contained in:
Evgeny Gerashchenko
2012-06-20 17:05:27 +04:00
parent a7596a81e6
commit c4b0522c42
6 changed files with 0 additions and 60 deletions
@@ -336,8 +336,6 @@ public interface Errors {
DiagnosticFactory1<PsiElement, SolutionStatus> TYPE_INFERENCE_FAILED = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1<JetElement, Integer> WRONG_NUMBER_OF_TYPE_ARGUMENTS = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1<JetIdeTemplateExpression, String> UNRESOLVED_IDE_TEMPLATE = DiagnosticFactory1.create(ERROR);
SimpleDiagnosticFactory<JetExpression> DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED = SimpleDiagnosticFactory.create(WARNING);
DiagnosticFactory1<JetAnnotationEntry, String> NOT_AN_ANNOTATION_CLASS = DiagnosticFactory1.create(ERROR);
@@ -398,8 +398,6 @@ public class DefaultErrorMessages {
MAP.put(TYPE_INFERENCE_FAILED, "Type inference failed: {0}", TO_STRING);
MAP.put(WRONG_NUMBER_OF_TYPE_ARGUMENTS, "{0,choice,0#No type arguments|1#Type argument|1<{0,number,integer} type argument} expected", null);
MAP.put(UNRESOLVED_IDE_TEMPLATE, "Unresolved IDE template: {0}", TO_STRING);
MAP.put(DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED,
"This expression is treated as an argument to the function call on the previous line. " +
"Separate it with a semicolon (;) if it is not intended to be an argument.");
@@ -901,12 +901,6 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
}
}
@Override
public JetTypeInfo visitIdeTemplateExpression(JetIdeTemplateExpression expression, ExpressionTypingContext context) {
context.trace.report(UNRESOLVED_IDE_TEMPLATE.on(expression, ObjectUtils.notNull(expression.getText(), "<no name>")));
return JetTypeInfo.create(null, context.dataFlowInfo);
}
@Override
public JetTypeInfo visitBinaryExpression(JetBinaryExpression expression, ExpressionTypingContext contextWithExpectedType) {
ExpressionTypingContext context = contextWithExpectedType.replaceExpectedType(NO_EXPECTED_TYPE);
@@ -311,10 +311,4 @@ public class ExpressionTypingVisitorForStatements extends ExpressionTypingVisito
public JetTypeInfo visitUnaryExpression(JetUnaryExpression expression, ExpressionTypingContext context) {
return basic.visitUnaryExpression(expression, context, true);
}
@Override
public JetTypeInfo visitIdeTemplateExpression(JetIdeTemplateExpression expression, ExpressionTypingContext context) {
context.trace.report(UNRESOLVED_IDE_TEMPLATE.on(expression, ObjectUtils.notNull(expression.getText(), "<no name>")));
return JetTypeInfo.create(null, context.dataFlowInfo);
}
}
@@ -1,41 +0,0 @@
fun main(args : Array<String>) {
if (<!UNRESOLVED_IDE_TEMPLATE!><#<condition>#><!>) {
<!UNRESOLVED_IDE_TEMPLATE!><#<block>#><!>
} else {
<!UNRESOLVED_IDE_TEMPLATE!><#<block>#><!>
}
fun <!UNRESOLVED_IDE_TEMPLATE!><#<name>#><!>(<#<params>#>) : <#<returnType>#> {
<#<body>#>
}
for (<#<i>#> in <!UNRESOLVED_IDE_TEMPLATE!><#<elements>#><!>) {
<!UNRESOLVED_IDE_TEMPLATE!><#<body>#><!>
}
when (<!UNRESOLVED_IDE_TEMPLATE!><#<expression>#><!>) {
<!UNRESOLVED_IDE_TEMPLATE!><#<condition>#><!> -> <#<value>#>
else -> <!UNRESOLVED_IDE_TEMPLATE!><#<elseValue>#><!>
}
var <#<name>#> = <!UNRESOLVED_IDE_TEMPLATE!><#<value>#><!>
class <#<name>#> {
<#<body>#>
}
class <#<name>#> {
var <#<name>#> : <#<varType>#>
get() {
<!UNRESOLVED_IDE_TEMPLATE!><#<body>#><!>
}
set(value) {
<!UNRESOLVED_IDE_TEMPLATE!><#<body>#><!>
}
val <#<name>#> : <#<valType>#>
get() {
<!UNRESOLVED_IDE_TEMPLATE!><#<body>#><!>
}
}
}
@@ -145,9 +145,6 @@ public class JetPsiChecker implements Annotator {
if (!diagnostic.isValid()) return;
List<TextRange> textRanges = diagnostic.getTextRanges();
if (diagnostic.getSeverity() == Severity.ERROR) {
if (diagnostic.getFactory() == Errors.UNRESOLVED_IDE_TEMPLATE) {
return;
}
if (diagnostic.getFactory() instanceof UnresolvedReferenceDiagnosticFactory) {
JetReferenceExpression referenceExpression = (JetReferenceExpression)diagnostic.getPsiElement();
PsiReference reference = referenceExpression.getReference();