diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2021-03-22 22:41:23 +0100 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2021-03-22 22:41:23 +0100 |
| commit | 8b7fa052b40149d6023f4f23b07116a4f3813ebc (patch) | |
| tree | 6c8cb86764140ace2b2a1d8a032f15b801d90708 /src/server/analysis.odin | |
| parent | aab3b14f72276182412c070950dd5c6488177d21 (diff) | |
add directive completion(not context aware atm)
Diffstat (limited to 'src/server/analysis.odin')
| -rw-r--r-- | src/server/analysis.odin | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index ae7d510..62ab37c 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -41,6 +41,7 @@ DocumentPositionContext :: struct { function: ^ast.Proc_Lit, //used to help with type resolving in function scope selector: ^ast.Expr, //used for completion identifier: ^ast.Node, + tag: ^ast.Node, field: ^ast.Expr, //used for completion call: ^ast.Expr, //used for signature help returns: ^ast.Return_Stmt, //used for completion @@ -2184,6 +2185,8 @@ fallback_position_context_completion :: proc(document: ^Document, position: comm position_context.field = s.field; } else if s, ok := e.derived.(ast.Implicit_Selector_Expr); ok { position_context.implicit = true; + } else if s, ok := e.derived.(ast.Tag_Expr); ok { + position_context.tag = s.expr; } else if bad_expr, ok := e.derived.(ast.Bad_Expr); ok { //this is most likely because of use of 'in', 'context', etc. //try to go back one dot. |