diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-03-12 22:07:26 +0100 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-03-12 22:07:26 +0100 |
| commit | 8f3ec02f79ad5061158c7f8dd09e8f2ce2353a16 (patch) | |
| tree | 69b5d6aa23edcef18137940710b95372104b51f5 /src/server | |
| parent | 5a95f96a9a96536e247c64af56f4a756c68b6bb3 (diff) | |
Fix hover error and change union complete type
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/hover.odin | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/server/hover.odin b/src/server/hover.odin index 5dd6acf..a5c3b5e 100644 --- a/src/server/hover.odin +++ b/src/server/hover.odin @@ -80,13 +80,12 @@ get_hover_information :: proc(document: ^common.Document, position: common.Posit if position_context.selector != nil && position_context.identifier != nil { hover.range = common.get_token_range(position_context.identifier^, ast_context.file.src) - ast_context.use_locals = true - ast_context.use_globals = true + ast_context.use_locals = true + ast_context.use_globals = true ast_context.current_package = ast_context.document_package //if the base selector is the client wants to go to. - if base, ok := position_context.selector.derived.(^ast.Ident); ok && position_context.identifier != nil { - + if base, ok := position_context.selector.derived.(^ast.Ident); ok && position_context.identifier != nil && position_in_node(position_context.selector, position_context.position) { ident := position_context.identifier.derived.(^ast.Ident)^ if ident.name == base.name { @@ -115,7 +114,6 @@ get_hover_information :: proc(document: ^common.Document, position: common.Posit field: string if position_context.field != nil { - #partial switch v in position_context.field.derived { case ^ast.Ident: field = v.name @@ -149,7 +147,6 @@ get_hover_information :: proc(document: ^common.Document, position: common.Posit } } } else if position_context.identifier != nil { - ast_context.use_locals = true ast_context.use_globals = true ast_context.current_package = ast_context.document_package |