forked from OSchip/llvm-project
[mlir-lsp] Avoid empty range diagnostic
This commit is contained in:
parent
0289a2692e
commit
3f70b4e033
mlir/lib/Tools/mlir-lsp-server
|
@ -87,7 +87,8 @@ getLocationFromLoc(llvm::SourceMgr &sourceMgr, Location loc,
|
|||
if (Optional<llvm::SMRange> range =
|
||||
AsmParserState::convertIdLocToRange(loc)) {
|
||||
auto lineCol = sourceMgr.getLineAndColumn(range->End);
|
||||
location->range.end.character = lineCol.second - 1;
|
||||
location->range.end.character =
|
||||
std::max(fileLoc.getColumn() + 1, lineCol.second - 1);
|
||||
}
|
||||
return WalkResult::interrupt();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue