diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-08 11:51:03 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-08 11:51:03 +0100 |
commit | b88535fe23366ac1112fbbcc7c90a603c37cbd32 (patch) | |
tree | 325d4f259c2f05306f34edc9b54bbee6e2745b74 /modules/gdscript/tests/scripts/lsp/shadowing_initializer.gd | |
parent | a2bd7c3301360945abb4b9b62182e2ba809b10d5 (diff) | |
parent | af4cbaf75125cdb1f37ece93802e75b03af9d96f (diff) | |
download | redot-engine-b88535fe23366ac1112fbbcc7c90a603c37cbd32.tar.gz |
Merge pull request #85178 from HolonProduction/completion-tests
Add unit test runner for autocompletion
Diffstat (limited to 'modules/gdscript/tests/scripts/lsp/shadowing_initializer.gd')
-rw-r--r-- | modules/gdscript/tests/scripts/lsp/shadowing_initializer.gd | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/lsp/shadowing_initializer.gd b/modules/gdscript/tests/scripts/lsp/shadowing_initializer.gd new file mode 100644 index 0000000000..338000fa0e --- /dev/null +++ b/modules/gdscript/tests/scripts/lsp/shadowing_initializer.gd @@ -0,0 +1,56 @@ +extends Node + +var value := 42 +# ^^^^^ member:value -> member:value + +func variable(): + var value = value + 42 + #! | | ^^^^^ -> member:value + # ^^^^^ variable:value -> variable:value + print(value) + # ^^^^^ -> variable:value + +func array(): + var value = [1,value,3,value+4] + #! | | | | ^^^^^ -> member:value + #! | | ^^^^^ -> member:value + # ^^^^^ array:value -> array:value + print(value) + # ^^^^^ -> array:value + +func dictionary(): + var value = { + # ^^^^^ dictionary:value -> dictionary:value + "key1": value, + #! ^^^^^ -> member:value + "key2": 1 + value + 3, + #! ^^^^^ -> member:value + } + print(value) + # ^^^^^ -> dictionary:value + +func for_loop(): + for value in value: + # | | ^^^^^ -> member:value + # ^^^^^ for:value -> for:value + print(value) + # ^^^^^ -> for:value + +func for_range(): + for value in range(5, value): + # | | ^^^^^ -> member:value + # ^^^^^ for:range:value -> for:range:value + print(value) + # ^^^^^ -> for:range:value + +func matching(): + match value: + # ^^^^^ -> member:value + 42: print(value) + # ^^^^^ -> member:value + [var value, ..]: print(value) + # | | ^^^^^ -> match:array:value + # ^^^^^ match:array:value -> match:array:value + var value: print(value) + # | | ^^^^^ -> match:var:value + # ^^^^^ match:var:value -> match:var:value |