summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/lsp/local_variables.gd
blob: 43e8937800a8f10c59260bfdc3b32a41f15862c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
extends Node

var member := 2
#   ^^^^^^ member -> member

func test_member() -> void:
	var test := member + 42
	#   |  |    ^^^^^^ -> member
	#   ^^^^ test -> test
	test += 3
	#<^^ -> test
	member += 5
	#<^^^^ -> member
	test = return_arg(test)
	#  |              ^^^^ -> test
	#<^^ -> test
	print(test)
	#     ^^^^ -> test

func return_arg(arg: int) -> int:
#               ^^^ arg -> arg
	arg += 2
	#<^ -> arg
	return arg
	#      ^^^ -> arg