summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/lsp/indentation.gd
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-01-08 11:51:03 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-01-08 11:51:03 +0100
commitb88535fe23366ac1112fbbcc7c90a603c37cbd32 (patch)
tree325d4f259c2f05306f34edc9b54bbee6e2745b74 /modules/gdscript/tests/scripts/lsp/indentation.gd
parenta2bd7c3301360945abb4b9b62182e2ba809b10d5 (diff)
parentaf4cbaf75125cdb1f37ece93802e75b03af9d96f (diff)
downloadredot-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/indentation.gd')
-rw-r--r--modules/gdscript/tests/scripts/lsp/indentation.gd28
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/lsp/indentation.gd b/modules/gdscript/tests/scripts/lsp/indentation.gd
new file mode 100644
index 0000000000..c25d73a719
--- /dev/null
+++ b/modules/gdscript/tests/scripts/lsp/indentation.gd
@@ -0,0 +1,28 @@
+extends Node
+
+var root = 0
+# ^^^^ 0_indent -> 0_indent
+
+func a():
+ var alpha: int = root + 42
+ # | | ^^^^ -> 0_indent
+ # ^^^^^ 1_indent -> 1_indent
+ if alpha > 42:
+ # ^^^^^ -> 1_indent
+ var beta := alpha + 13
+ # | | ^^^^ -> 1_indent
+ # ^^^^ 2_indent -> 2_indent
+ if beta > alpha:
+ # | | ^^^^^ -> 1_indent
+ # ^^^^ -> 2_indent
+ var gamma = beta + 1
+ # | | ^^^^ -> 2_indent
+ # ^^^^^ 3_indent -> 3_indent
+ print(gamma)
+ # ^^^^^ -> 3_indent
+ print(beta)
+ # ^^^^ -> 2_indent
+ print(alpha)
+ # ^^^^^ -> 1_indent
+ print(root)
+ # ^^^^ -> 0_indent