Skip to content

Commit d8ff774

Browse files
committed
update semantic_tokens
1 parent 3554b8c commit d8ff774

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/emmylua_ls/src/handlers/semantic_token/build_semantic_tokens.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,13 @@ fn handle_name_node(
626626
)
627627
}
628628
LuaType::DocFunction(_) => (SemanticTokenType::FUNCTION, None),
629+
LuaType::Union(union) => {
630+
if union.get_types().iter().any(|typ| typ.is_function()) {
631+
(SemanticTokenType::FUNCTION, None)
632+
} else {
633+
(SemanticTokenType::VARIABLE, None)
634+
}
635+
}
629636
_ => {
630637
let decl = semantic_model
631638
.get_db()

0 commit comments

Comments
 (0)