YarnSpinnerTool / YarnSpinner

Yarn Spinner is a tool for building interactive dialogue in games!
https://yarnspinner.dev
MIT License
2.3k stars 201 forks source link

Some built in functions are saying they return any instead of their appropriate return type in the LSP #384

Open McJones opened 7 months ago

McJones commented 7 months ago

The following yarn should be valid:

<<declare $str = "">>
<<set $str = string(1)>>
<<set $str = format_invariant(1)>>
<<set $str = format("{1}", 1)>>

<<declare $bool = true>>
<<set $bool = bool(1)>>
<<set $bool = visited("node")>>

<<declare $num = 1>>
<<set $num = visited_count("node")>>
<<set $num = number(1)>>
<<set $num = random()>>
<<set $num = random_range(0, 9)>>
<<set $num = dice(6)>>
<<set $num = round(1.5)>>
<<set $num = round_places(1.5, 1)>>
<<set $num = floor(1.5)>>
<<set $num = ceil(1.5)>>
<<set $num = inc(1.5)>>
<<set $num = dec(1.5)>>
<<set $num = decimal(1.5)>>
<<set $num = int(1.5)>>

And inside Unity this compiles without error, but inside vscode only format, visited, and visited_count work, all others are reporting their return type is any. This happens on both the current and WIP 3 branch.