diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2020-12-14 22:49:55 +0100 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2020-12-14 22:49:55 +0100 |
| commit | 94d621dc376f0d7736d293d5a6dbb8feab4bec30 (patch) | |
| tree | 95c5ea3190213b41f7f188b19e1e69a69ecb438a /src | |
| parent | 7cf3509ed86e81fec6d3114c7b49218fd57fc257 (diff) | |
handle fallback completion with &
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/analysis.odin | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index 66280f3..6b8d84d 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -42,6 +42,7 @@ DocumentPositionContext :: struct { field: ^ast.Expr, //used for completion call: ^ast.Expr, //used for signature help returns: ^ast.Expr, //used for completion + comp_lit: ^ast.Comp_Lit, //used for completion hint: DocumentPositionContextHint, }; @@ -2445,7 +2446,7 @@ fallback_position_context_completion :: proc(document: ^Document, position: comm c == '}' || c == '^' || c == ':' || c == '\n' || c == '\r' || c == '=' || c == '<' || c == '>' || c == '-' || - c == '+' { + c == '+' || c == '&' { start = i+1; break; } @@ -2614,6 +2615,7 @@ get_document_position_node :: proc(node: ^ast.Node, position_context: ^DocumentP get_document_position(n.body, position_context); } case Comp_Lit: + position_context.comp_lit = cast(^Comp_Lit)node; get_document_position(n.type, position_context); get_document_position(n.elems, position_context); case Tag_Expr: |