diff --git a/src/core/sv_parser.rs b/src/core/sv_parser.rs index 02e193b..d991ac8 100644 --- a/src/core/sv_parser.rs +++ b/src/core/sv_parser.rs @@ -362,7 +362,7 @@ pub fn make_fast_from_syntaxtree( // 尝试获取 content 最后一个元素的可变引用,该引用如果存在,说明已经创建了一个 module if let Some(last_module) = fast.content.last_mut() { last_module.range.end.line = pos.line; - last_module.range.end.character = pos.line; + last_module.range.end.character = pos.character; } }, _ => {} diff --git a/src/inlay_hint/sv.rs b/src/inlay_hint/sv.rs index f87e603..7039eab 100644 --- a/src/inlay_hint/sv.rs +++ b/src/inlay_hint/sv.rs @@ -49,7 +49,6 @@ pub fn inlay_hint(server: &LspServer, params: &InlayHintParams) -> Option::new(); let end_pos = &module.range.end; let start_pos = &module.range.start; + if end_pos.character == start_pos.character && end_pos.line == start_pos.line { // 说明解析器没有找到 endmodule return hints;