fix(frontends/lean/parser): generate flycheck-friendly import error
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
6ca80b5000
commit
c01b4bd636
1 changed files with 8 additions and 1 deletions
|
@ -1067,6 +1067,13 @@ void parser::parse_imports() {
|
|||
} else if (auto it = find_file(f, ".olean")) {
|
||||
olean_files.push_back(f);
|
||||
} else {
|
||||
m_found_errors = true;
|
||||
if (!m_use_exceptions && m_show_errors) {
|
||||
flycheck_error err(regular_stream());
|
||||
display_error_pos(pos());
|
||||
regular_stream() << " invalid import, unknown module '" << f << "'" << endl;
|
||||
}
|
||||
if (m_use_exceptions)
|
||||
throw parser_error(sstream() << "invalid import, unknown module '" << f << "'", pos());
|
||||
}
|
||||
next();
|
||||
|
|
Loading…
Reference in a new issue