修复 fast 中 endmodule 位置拿错的问题
This commit is contained in:
parent
c24b90ea96
commit
b09921473f
@ -362,7 +362,7 @@ pub fn make_fast_from_syntaxtree(
|
|||||||
// 尝试获取 content 最后一个元素的可变引用,该引用如果存在,说明已经创建了一个 module
|
// 尝试获取 content 最后一个元素的可变引用,该引用如果存在,说明已经创建了一个 module
|
||||||
if let Some(last_module) = fast.content.last_mut() {
|
if let Some(last_module) = fast.content.last_mut() {
|
||||||
last_module.range.end.line = pos.line;
|
last_module.range.end.line = pos.line;
|
||||||
last_module.range.end.character = pos.line;
|
last_module.range.end.character = pos.character;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_ => {}
|
_ => {}
|
||||||
|
@ -49,7 +49,6 @@ pub fn inlay_hint(server: &LspServer, params: &InlayHintParams) -> Option<Vec<In
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return Some(hints);
|
return Some(hints);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,6 +72,7 @@ fn make_endmodule_hints(
|
|||||||
let mut hints = Vec::<InlayHint>::new();
|
let mut hints = Vec::<InlayHint>::new();
|
||||||
let end_pos = &module.range.end;
|
let end_pos = &module.range.end;
|
||||||
let start_pos = &module.range.start;
|
let start_pos = &module.range.start;
|
||||||
|
|
||||||
if end_pos.character == start_pos.character && end_pos.line == start_pos.line {
|
if end_pos.character == start_pos.character && end_pos.line == start_pos.line {
|
||||||
// 说明解析器没有找到 endmodule
|
// 说明解析器没有找到 endmodule
|
||||||
return hints;
|
return hints;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user