From b09921473f5bad610cee104a7cfb5593355431a5 Mon Sep 17 00:00:00 2001 From: LSTM-Kirigaya <1193466151@qq.com> Date: Thu, 19 Dec 2024 22:15:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20fast=20=E4=B8=AD=20endmodu?= =?UTF-8?q?le=20=E4=BD=8D=E7=BD=AE=E6=8B=BF=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/sv_parser.rs | 2 +- src/inlay_hint/sv.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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;