aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/analysis.odin7
-rw-r--r--tests/hover_test.odin28
2 files changed, 34 insertions, 1 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index 9ee621a..2278e00 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -1297,6 +1297,13 @@ resolve_index_expr :: proc(ast_context: ^AstContext, v: ^ast.Index_Expr) -> (Sym
return indexed, true
}
return {}, false
+ case SymbolMatrixValue:
+ value := SymbolFixedArrayValue{
+ expr = v2.expr,
+ len = v2.x,
+ }
+ indexed.value = value
+ return indexed, true
}
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 345e9f9..d0b844e 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -5033,7 +5033,6 @@ ast_hover_proc_overload_basic_type_alias :: proc(t: ^testing.T) {
ast_hover_proc_overload_nil_pointer :: proc(t: ^testing.T) {
source := test.Source {
main = `package test
- import "my_package"
foo_int :: proc(i: int) {}
foo_ptr :: proc(s: ^string) {}
@@ -5086,6 +5085,33 @@ ast_hover_package_proc_naming_conflicting_with_another_package :: proc(t: ^testi
test.expect_hover(t, &source, "my_package.foo :: proc()")
}
+
+@(test)
+ast_hover_matrix_index :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ main :: proc() {
+ foo: matrix[3, 2]f32
+ a{*} := foo[0]
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "test.a: [3]f32")
+}
+
+@(test)
+ast_hover_matrix_index_twice :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ main :: proc() {
+ foo: matrix[2, 3]f32
+ a := foo[0]
+ b{*} := a[0]
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "test.b: f32")
+}
/*
Waiting for odin fix