aboutsummaryrefslogtreecommitdiff
path: root/src/server/hover.odin
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-04-06 14:25:02 +0200
committerDanielGavin <danielgavin5@hotmail.com>2024-04-06 14:25:02 +0200
commit9652ef501f0085fd5e335427de95482625b2d1ea (patch)
treec81bb7913747f67c44a91a00336d3bac7927dd67 /src/server/hover.odin
parent34dc6495d51d8525bd2bc1059a31a27588b08e0c (diff)
Fix issues with objc completion and hover
Diffstat (limited to 'src/server/hover.odin')
-rw-r--r--src/server/hover.odin20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/server/hover.odin b/src/server/hover.odin
index be6adad..c3dccbc 100644
--- a/src/server/hover.odin
+++ b/src/server/hover.odin
@@ -170,7 +170,9 @@ get_hover_information :: proc(
}
}
- if position_context.selector != nil && position_context.identifier != nil {
+ if position_context.selector != nil &&
+ position_context.identifier != nil &&
+ position_context.field == position_context.identifier {
hover.range = common.get_token_range(
position_context.identifier^,
ast_context.file.src,
@@ -211,6 +213,7 @@ get_hover_information :: proc(
}
selector: Symbol
+
selector, ok = resolve_type_expression(
&ast_context,
position_context.selector,
@@ -229,6 +232,21 @@ get_hover_information :: proc(
}
}
+ if v, is_proc := selector.value.(SymbolProcedureValue); is_proc {
+ if len(v.return_types) == 0 || v.return_types[0].type == nil {
+ return {}, false, false
+ }
+
+ ast_context.current_package = selector.pkg
+
+ if selector, ok = resolve_type_expression(
+ &ast_context,
+ v.return_types[0].type,
+ ); !ok {
+ return {}, false, false
+ }
+ }
+
ast_context.current_package = selector.pkg
#partial switch v in selector.value {