aboutsummaryrefslogtreecommitdiff
path: root/src/server/completion.odin
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/completion.odin')
-rw-r--r--src/server/completion.odin18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/server/completion.odin b/src/server/completion.odin
index 91cc790..d3dfa08 100644
--- a/src/server/completion.odin
+++ b/src/server/completion.odin
@@ -1952,16 +1952,26 @@ append_magic_dynamic_array_completion :: proc(
return
}
+ prefix := "&"
+ suffix := ""
+ if symbol.pointers > 0 {
+ prefix = ""
+ suffix = common.repeat(
+ "^",
+ symbol.pointers - 1,
+ context.temp_allocator,
+ )
+ }
+ ptr_symbol_str := fmt.tprint(prefix, symbol_str, suffix, sep = "")
+
//pop
{
- text := fmt.tprintf("pop(&%v)", symbol_str)
-
item := CompletionItem {
label = "pop",
kind = .Function,
detail = "pop",
textEdit = TextEdit {
- newText = text,
+ newText = fmt.tprintf("pop(%v)", ptr_symbol_str),
range = {start = range.end, end = range.end},
},
additionalTextEdits = additionalTextEdits,
@@ -1988,7 +1998,7 @@ append_magic_dynamic_array_completion :: proc(
detail = name,
additionalTextEdits = additionalTextEdits,
textEdit = TextEdit {
- newText = fmt.tprintf("%s(&%v, $0)", name, symbol_str),
+ newText = fmt.tprintf("%s(%v, $0)", name, ptr_symbol_str),
range = {start = range.end, end = range.end},
},
insertTextFormat = .Snippet,