diff options
Diffstat (limited to 'src/server/hover.odin')
| -rw-r--r-- | src/server/hover.odin | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/src/server/hover.odin b/src/server/hover.odin index 9d8519c..4843391 100644 --- a/src/server/hover.odin +++ b/src/server/hover.odin @@ -201,10 +201,8 @@ get_hover_information :: proc(document: ^Document, position: common.Position) -> symbol.type_pkg = symbol.pkg symbol.pkg = bit_field_symbol.name symbol.name = identifier.name - if value, ok := bit_field_symbol.value.(SymbolBitFieldValue); ok { - symbol.comment = get_comment(value.comments[i]) - symbol.doc = get_doc(value.docs[i], context.temp_allocator) - } + symbol.comment = get_comment(value.comments[i]) + symbol.doc = get_doc(value.docs[i], context.temp_allocator) symbol.signature = get_bit_field_field_signature(value, i) hover.contents = write_hover_content(&ast_context, symbol) return hover, true, true @@ -215,6 +213,37 @@ get_hover_information :: proc(document: ^Document, position: common.Position) -> } } } + + if position_context.call != nil { + // Check if we're resolving the name of a parameter being passed to a proc call + if call, ok := position_context.call.derived.(^ast.Call_Expr); ok { + if proc_symbol, ok := resolve_type_expression(&ast_context, call); ok { + if value, ok := proc_symbol.value.(SymbolProcedureValue); ok { + for arg in call.args { + if field_value, ok := arg.derived.(^ast.Field_Value); ok { + if position_in_node(field_value.field, position_context.position) { + if identifier, ok := field_value.field.derived.(^ast.Ident); ok { + if arg_type, arg_type_ok := get_proc_arg_type_from_name(value, identifier.name); ok { + if symbol, ok := resolve_type_expression(&ast_context, arg_type.type); ok { + symbol.range = common.get_token_range(field_value.field, ast_context.file.src) + symbol.type_name = symbol.name + symbol.type_pkg = symbol.pkg + symbol.pkg = proc_symbol.name + symbol.name = identifier.name + symbol.signature = get_signature(&ast_context, symbol) + hover.contents = write_hover_content(&ast_context, symbol) + return hover, true, true + } + } + } + } + break + } + } + } + } + } + } } if position_context.field_value != nil && position_context.comp_lit != nil { |