Skip to content

Commit

Permalink
revert pr #1659 (#1692)
Browse files Browse the repository at this point in the history
Signed-off-by: he1pa <[email protected]>
  • Loading branch information
He1pa authored Oct 14, 2024
1 parent 7bb22c2 commit 0c59e6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 34 deletions.
31 changes: 1 addition & 30 deletions kclvm/sema/src/advanced_resolver/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1937,36 +1937,7 @@ impl<'ctx> AdvancedResolver<'ctx> {

if let Some(key) = &entry.node.key {
self.ctx.maybe_def = true;
if let Some(symbol_ref) = self.expr(key)? {
let config_key_symbol =
self.gs.get_symbols().unresolved.get(symbol_ref.get_id());
let hint: Option<SymbolHint> =
if let Some(config_key_symbol) = config_key_symbol {
match config_key_symbol.get_definition() {
Some(def_ref) => match self.gs.get_symbols().get_symbol(def_ref) {
Some(def_symbol) => {
let ty = def_symbol.get_sema_info().ty.clone();
ty.as_ref().map(|ty| SymbolHint {
kind: SymbolHintKind::TypeHint(ty.ty_hint()),
pos: config_key_symbol.get_range().1.clone(),
})
}
None => None,
},
None => None,
}
} else {
None
};
if let Some(config_key_symbol_mut_ref) = self
.gs
.get_symbols_mut()
.unresolved
.get_mut(symbol_ref.get_id())
{
config_key_symbol_mut_ref.hint = hint;
}
}
self.expr(key)?;
self.ctx.maybe_def = false;
}
}
Expand Down
9 changes: 5 additions & 4 deletions kclvm/tools/src/LSP/src/inlay_hints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ mod tests {
"src/test_data/inlay_hints/schema_args/schema_args_hint.k"
);

inlay_hints_test_snapshot!(
test_config_key_ty,
"src/test_data/inlay_hints/config_key/config_key.k"
);
// Temporary revert
// inlay_hints_test_snapshot!(
// test_config_key_ty,
// "src/test_data/inlay_hints/config_key/config_key.k"
// );
}

0 comments on commit 0c59e6c

Please sign in to comment.