data: error for java import not found
* added recording an error in this case. * added test for this case.
This commit is contained in:
@@ -401,6 +401,13 @@ public class JavaAstVisitor extends JavaAstVisitorAdapter
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
JavaIndexer.recordError(
|
||||
m_callbackId, "Import not found.", true, true,
|
||||
nameExpr.getBeginLine(), nameExpr.getBeginColumn(), nameExpr.getEndLine(), nameExpr.getEndColumn()
|
||||
);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -314,6 +314,16 @@ public:
|
||||
TS_ASSERT_EQUALS(client->errors[0], "Encountered unexpected token. <1:1 1:7>");
|
||||
}
|
||||
|
||||
void test_java_parser_finds_missing_import_as_error()
|
||||
{
|
||||
std::shared_ptr<TestParserClient> client = parseCode(
|
||||
"import foo;\n"
|
||||
);
|
||||
|
||||
TS_ASSERT_EQUALS(client->errors.size(), 1);
|
||||
TS_ASSERT_EQUALS(client->errors[0], "Import not found. <1:8 1:10>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user