diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-23 08:47:48 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-23 08:47:48 -0400 |
| commit | 1089170576b4cc4b6330c6e9852cf3598a74991c (patch) | |
| tree | 413cf6d0b34abc4fc1d50961a4ad4c1637aa0d90 /src/server/hover.odin | |
| parent | 51c8693023acb0d5b2e6b80fbb9a31f44fc37fd6 (diff) | |
Resolve allocator field for container types on hover
Diffstat (limited to 'src/server/hover.odin')
| -rw-r--r-- | src/server/hover.odin | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/server/hover.odin b/src/server/hover.odin index bf64967..86fd6a8 100644 --- a/src/server/hover.odin +++ b/src/server/hover.odin @@ -356,9 +356,22 @@ get_hover_information :: proc(document: ^Document, position: common.Position) -> case SymbolSliceValue: return get_soa_field_hover(&ast_context, selector, v.expr, nil, field) case SymbolDynamicArrayValue: + if field == "allocator" { + if symbol, ok := resolve_container_allocator(&ast_context, "Raw_Dynamic_Array"); ok { + hover.contents = write_hover_content(&ast_context, symbol) + return hover, true, true + } + } return get_soa_field_hover(&ast_context, selector, v.expr, nil, field) case SymbolFixedArrayValue: return get_soa_field_hover(&ast_context, selector, v.expr, v.len, field) + case SymbolMapValue: + if field == "allocator" { + if symbol, ok := resolve_container_allocator(&ast_context, "Raw_Map"); ok { + hover.contents = write_hover_content(&ast_context, symbol) + return hover, true, true + } + } } } else if position_context.implicit_selector_expr != nil { implicit_selector := position_context.implicit_selector_expr |