summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/lsp/enums.gd
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/tests/scripts/lsp/enums.gd')
-rw-r--r--modules/gdscript/tests/scripts/lsp/enums.gd26
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/lsp/enums.gd b/modules/gdscript/tests/scripts/lsp/enums.gd
new file mode 100644
index 0000000000..38b9ec110a
--- /dev/null
+++ b/modules/gdscript/tests/scripts/lsp/enums.gd
@@ -0,0 +1,26 @@
+extends Node
+
+enum {UNIT_NEUTRAL, UNIT_ENEMY, UNIT_ALLY}
+# | | | | ^^^^^^^^^ enum:unnamed:ally -> enum:unnamed:ally
+# | | ^^^^^^^^^^ enum:unnamed:enemy -> enum:unnamed:enemy
+# ^^^^^^^^^^^^ enum:unnamed:neutral -> enum:unnamed:neutral
+enum Named {THING_1, THING_2, ANOTHER_THING = -1}
+# | | | | | | ^^^^^^^^^^^^^ enum:named:thing3 -> enum:named:thing3
+# | | | | ^^^^^^^ enum:named:thing2 -> enum:named:thing2
+# | | ^^^^^^^ enum:named:thing1 -> enum:named:thing1
+# ^^^^^ enum:named -> enum:named
+
+func f(arg):
+ match arg:
+ UNIT_ENEMY: print(UNIT_ENEMY)
+ # | ^^^^^^^^^^ -> enum:unnamed:enemy
+ #<^^^^^^^^ -> enum:unnamed:enemy
+ Named.THING_2: print(Named.THING_2)
+ #! | | | | | ^^^^^^^ -> enum:named:thing2
+ # | | | ^^^^^ -> enum:named
+ #! | ^^^^^^^ -> enum:named:thing2
+ #<^^^ -> enum:named
+ _: print(UNIT_ENEMY, Named.ANOTHER_THING)
+ #! | | | | ^^^^^^^^^^^^^ -> enum:named:thing3
+ # | | ^^^^^ -> enum:named
+ # ^^^^^^^^^^ -> enum:unnamed:enemy