Skip to content

Commit e957dfc

Browse files
committed
fix inlay hint config
1 parent 4781b05 commit e957dfc

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

crates/emmylua_ls/src/handlers/inlay_hint/build_inlay_hint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,8 @@ pub fn get_override_lsp_location(
464464
let document = semantic_model.get_document_by_file_id(file_id)?;
465465
let root = semantic_model.get_root_by_file_id(file_id)?;
466466
let node = syntax_id.to_node_from_root(root.syntax())?;
467-
let range = if let Some(index_exor) = LuaIndexExpr::cast(node.clone()) {
468-
index_exor.get_index_name_token()?.text_range()
467+
let range = if let Some(index_expr) = LuaIndexExpr::cast(node.clone()) {
468+
index_expr.get_index_name_token()?.text_range()
469469
} else {
470470
node.text_range()
471471
};

crates/emmylua_ls/src/handlers/inlay_hint/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ pub fn inlay_hint(
3434
client_id: ClientId,
3535
) -> Option<Vec<InlayHint>> {
3636
let semantic_model = analysis.compilation.get_semantic_model(file_id)?;
37+
if !semantic_model.get_emmyrc().hint.enable {
38+
return Some(vec![]);
39+
}
40+
3741
build_inlay_hints(&semantic_model, client_id)
3842
}
3943

0 commit comments

Comments
 (0)