aboutsummaryrefslogtreecommitdiff
path: root/src/server/position_context.odin
diff options
context:
space:
mode:
authorBradley Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-20 09:00:01 -0400
committerGitHub <noreply@github.com>2025-09-20 09:00:01 -0400
commitc8060630c01f8f46ae12dcc60b96b77a22f29751 (patch)
tree11c19677b34befd6d98d2d5613733cf7ea5f0671 /src/server/position_context.odin
parent7ff84eb0b24912db1b3f3b0cff323e1728f47b0b (diff)
parentcad50369b0756958e826d7e964b1a3b7ed1504d5 (diff)
Merge pull request #1032 from BradLewis/fix/completion-matching-unary-improvements
Check to see if completion already includes `&` before adding it when matching
Diffstat (limited to 'src/server/position_context.odin')
-rw-r--r--src/server/position_context.odin6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/server/position_context.odin b/src/server/position_context.odin
index f3f2f68..1aa2ec1 100644
--- a/src/server/position_context.odin
+++ b/src/server/position_context.odin
@@ -34,6 +34,7 @@ DocumentPositionContext :: struct {
tag: ^ast.Node,
field: ^ast.Expr, //used for completion
call: ^ast.Expr, //used for signature help
+ call_arg: ^ast.Expr, //used for completion
returns: ^ast.Return_Stmt, //used for completion
comp_lit: ^ast.Comp_Lit, //used for completion
parent_comp_lit: ^ast.Comp_Lit, //used for completion
@@ -628,6 +629,11 @@ get_document_position_node :: proc(node: ^ast.Node, position_context: ^DocumentP
case ^Call_Expr:
position_context.call = n
get_document_position(n.expr, position_context)
+ for arg in n.args {
+ if position_in_node(arg, position_context.position) {
+ position_context.call_arg = arg
+ }
+ }
get_document_position(n.args, position_context)
case ^Selector_Call_Expr:
position_context.selector = n.expr