aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/analysis.odin16
-rw-r--r--src/server/completion.odin3
-rw-r--r--src/server/documents.odin2
3 files changed, 11 insertions, 10 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index e3857c1..45e2e74 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -1698,13 +1698,10 @@ resolve_comp_literal :: proc(
} else if position_context.call != nil {
if call_expr, ok := position_context.call.derived.(^ast.Call_Expr);
ok {
- arg_index := 0
- for arg, i in call_expr.args {
- if position_in_node(arg, position_context.position) {
- arg_index = i
- break
- }
- }
+ arg_index := find_position_in_call_param(
+ position_context,
+ call_expr^,
+ ) or_return
symbol = resolve_type_expression(
ast_context,
@@ -1728,6 +1725,9 @@ resolve_comp_literal :: proc(
}
}
+ old_package := ast_context.current_package
+ ast_context.current_package = symbol.pkg
+
symbol, _ = resolve_type_comp_literal(
ast_context,
position_context,
@@ -1735,6 +1735,8 @@ resolve_comp_literal :: proc(
position_context.parent_comp_lit,
) or_return
+ ast_context.current_package = old_package
+
return symbol, true
}
diff --git a/src/server/completion.odin b/src/server/completion.odin
index eb83432..c10a48b 100644
--- a/src/server/completion.odin
+++ b/src/server/completion.odin
@@ -233,7 +233,7 @@ get_comp_lit_completion :: proc(
}
ast_context.current_package = symbol.pkg
-
+
if resolved, ok := resolve_type_expression(
ast_context,
v.types[i],
@@ -1128,6 +1128,7 @@ get_implicit_completion :: proc(
ast_context,
proc_value.arg_types[parameter_index].type,
); ok {
+ ast_context.current_package = bitset_symbol.pkg
if enum_value, ok := unwrap_bitset(
ast_context,
bitset_symbol,
diff --git a/src/server/documents.odin b/src/server/documents.odin
index e2cc322..7b3cba4 100644
--- a/src/server/documents.odin
+++ b/src/server/documents.odin
@@ -284,8 +284,6 @@ document_apply_changes :: proc(
}
}
- //log.info(string(document.text[:document.used_text]));
-
return document_refresh(document, config, writer)
}