diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-23 09:50:57 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-24 08:55:23 -0400 |
| commit | 730e0ad2f6c4fdffd4fa26753c0b82085ee8b2a5 (patch) | |
| tree | 2373b27217b3c396d3819ac445210a2ecb64e4f9 | |
| parent | 0d7f28a8ca38fbdd4baa522ec1caf9316d090d19 (diff) | |
Compare symbols uri and range rather than trying to see if they're same type
| -rw-r--r-- | src/server/analysis.odin | 9 | ||||
| -rw-r--r-- | src/server/completion.odin | 2 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index d65a410..66299e8 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -408,12 +408,7 @@ are_symbol_basic_same_keywords :: proc(a, b: Symbol) -> bool { return true } -is_symbol_same_typed :: proc( - ast_context: ^AstContext, - a, b: Symbol, - flags: ast.Field_Flags = {}, - ignore_pointers := false, -) -> bool { +is_symbol_same_typed :: proc(ast_context: ^AstContext, a, b: Symbol, flags: ast.Field_Flags = {}) -> bool { // In order to correctly equate the symbols for overloaded functions, we need to check both directions if same, ok := are_symbol_untyped_basic_same_typed(a, b); ok { return same @@ -428,7 +423,7 @@ is_symbol_same_typed :: proc( return false } - if !ignore_pointers && a.pointers != b.pointers { + if a.pointers != b.pointers { return false } diff --git a/src/server/completion.odin b/src/server/completion.odin index 5d28c3f..7493f5c 100644 --- a/src/server/completion.odin +++ b/src/server/completion.odin @@ -385,7 +385,7 @@ handle_pointers :: proc( } } - if !is_symbol_same_typed(ast_context, arg_symbol, result_symbol, ignore_pointers = true) { + if result_symbol.uri != arg_symbol.uri || result_symbol.range != arg_symbol.range { return } |