Removed UNRESOLVED_IDE_TEMPLATE diagnostic factory, since this check will be moved to CLI.
This commit is contained in:
@@ -336,8 +336,6 @@ public interface Errors {
|
|||||||
DiagnosticFactory1<PsiElement, SolutionStatus> TYPE_INFERENCE_FAILED = DiagnosticFactory1.create(ERROR);
|
DiagnosticFactory1<PsiElement, SolutionStatus> TYPE_INFERENCE_FAILED = DiagnosticFactory1.create(ERROR);
|
||||||
DiagnosticFactory1<JetElement, Integer> WRONG_NUMBER_OF_TYPE_ARGUMENTS = 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);
|
SimpleDiagnosticFactory<JetExpression> DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED = SimpleDiagnosticFactory.create(WARNING);
|
||||||
|
|
||||||
DiagnosticFactory1<JetAnnotationEntry, String> NOT_AN_ANNOTATION_CLASS = DiagnosticFactory1.create(ERROR);
|
DiagnosticFactory1<JetAnnotationEntry, String> NOT_AN_ANNOTATION_CLASS = DiagnosticFactory1.create(ERROR);
|
||||||
|
|||||||
-2
@@ -398,8 +398,6 @@ public class DefaultErrorMessages {
|
|||||||
MAP.put(TYPE_INFERENCE_FAILED, "Type inference failed: {0}", TO_STRING);
|
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(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,
|
MAP.put(DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED,
|
||||||
"This expression is treated as an argument to the function call on the previous line. " +
|
"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.");
|
"Separate it with a semicolon (;) if it is not intended to be an argument.");
|
||||||
|
|||||||
-6
@@ -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
|
@Override
|
||||||
public JetTypeInfo visitBinaryExpression(JetBinaryExpression expression, ExpressionTypingContext contextWithExpectedType) {
|
public JetTypeInfo visitBinaryExpression(JetBinaryExpression expression, ExpressionTypingContext contextWithExpectedType) {
|
||||||
ExpressionTypingContext context = contextWithExpectedType.replaceExpectedType(NO_EXPECTED_TYPE);
|
ExpressionTypingContext context = contextWithExpectedType.replaceExpectedType(NO_EXPECTED_TYPE);
|
||||||
|
|||||||
-6
@@ -311,10 +311,4 @@ public class ExpressionTypingVisitorForStatements extends ExpressionTypingVisito
|
|||||||
public JetTypeInfo visitUnaryExpression(JetUnaryExpression expression, ExpressionTypingContext context) {
|
public JetTypeInfo visitUnaryExpression(JetUnaryExpression expression, ExpressionTypingContext context) {
|
||||||
return basic.visitUnaryExpression(expression, context, true);
|
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;
|
if (!diagnostic.isValid()) return;
|
||||||
List<TextRange> textRanges = diagnostic.getTextRanges();
|
List<TextRange> textRanges = diagnostic.getTextRanges();
|
||||||
if (diagnostic.getSeverity() == Severity.ERROR) {
|
if (diagnostic.getSeverity() == Severity.ERROR) {
|
||||||
if (diagnostic.getFactory() == Errors.UNRESOLVED_IDE_TEMPLATE) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (diagnostic.getFactory() instanceof UnresolvedReferenceDiagnosticFactory) {
|
if (diagnostic.getFactory() instanceof UnresolvedReferenceDiagnosticFactory) {
|
||||||
JetReferenceExpression referenceExpression = (JetReferenceExpression)diagnostic.getPsiElement();
|
JetReferenceExpression referenceExpression = (JetReferenceExpression)diagnostic.getPsiElement();
|
||||||
PsiReference reference = referenceExpression.getReference();
|
PsiReference reference = referenceExpression.getReference();
|
||||||
|
|||||||
Reference in New Issue
Block a user