aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/analysis.odin4
-rw-r--r--tests/hover_test.odin13
2 files changed, 16 insertions, 1 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index 1ca15a8..97f18d8 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -1247,7 +1247,7 @@ resolve_index_expr :: proc(ast_context: ^AstContext, v: ^ast.Index_Expr) -> (Sym
return {}, false
case SymbolUntypedValue:
if v2.type == .String {
- value := SymbolBasicValue{
+ value := SymbolBasicValue {
ident = ast.new(ast.Ident, v2.tok.pos, v2.tok.pos),
}
value.ident.name = "u8"
@@ -1900,6 +1900,8 @@ resolve_slice_expression :: proc(ast_context: ^AstContext, slice_expr: ^ast.Slic
expr = v.expr
case SymbolDynamicArrayValue:
expr = v.expr
+ case SymbolMultiPointerValue:
+ expr = v.expr
case SymbolUntypedValue:
if v.type == .String {
return symbol, true
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index c043e01..1a94c89 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -4302,6 +4302,19 @@ ast_hover_untyped_string_index :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "test.bar: u8")
}
+
+@(test)
+ast_hover_multi_pointer_slice_range :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ main :: proc() {
+ foo: [^]int
+ b{*}ar := foo[:1]
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "test.bar: []int")
+}
/*
Waiting for odin fix