diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-09-07 22:34:43 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-09-07 22:34:43 -0400 |
| commit | fd12714250f96b8dbdb65825ac8b265edbe3bd10 (patch) | |
| tree | dea664ed82d7f5671adaf28203165aa7689ef227 | |
| parent | a3ebb67fd1893881a7e88021341f712461fc3a79 (diff) | |
Proc named returns should not be marked as parameters
| -rw-r--r-- | src/server/locals.odin | 4 | ||||
| -rw-r--r-- | tests/semantic_tokens_test.odin | 19 |
2 files changed, 21 insertions, 2 deletions
diff --git a/src/server/locals.odin b/src/server/locals.odin index 267a2a2..e6cf70e 100644 --- a/src/server/locals.odin +++ b/src/server/locals.odin @@ -998,7 +998,7 @@ get_locals_proc_param_and_results :: proc( false, true, "", - true, + false, ) } else { str := get_ast_node_string(name, file.src) @@ -1012,7 +1012,7 @@ get_locals_proc_param_and_results :: proc( false, true, "", - true, + false, ) } } diff --git a/tests/semantic_tokens_test.odin b/tests/semantic_tokens_test.odin index 35714df..8fd8468 100644 --- a/tests/semantic_tokens_test.odin +++ b/tests/semantic_tokens_test.odin @@ -102,3 +102,22 @@ semantic_tokens_struct_fields :: proc(t: ^testing.T) { {0, 4, 3, .Property, {}}, // [7] bar }) } + +@(test) +semantic_tokens_proc_return :: proc(t: ^testing.T) { + src := test.Source { + main = `package test + foo :: proc() -> (ret: int) { + ret += 1 + return + } + ` + } + + test.expect_semantic_tokens(t, &src, { + {1, 2, 3, .Function, {.ReadOnly}}, // [0] foo + {0, 18, 3, .Variable, {}}, // [1] ret + {0, 5, 3, .Type, {.ReadOnly}}, // [2] proc + {1, 3, 3, .Variable, {}}, // [3] ret + }) +} |