Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labels for Goto not properly working #38

Open
atticus-sullivan opened this issue Dec 23, 2024 · 1 comment
Open

Labels for Goto not properly working #38

atticus-sullivan opened this issue Dec 23, 2024 · 1 comment

Comments

@atticus-sullivan
Copy link

The following code runs in teal, but the language-server shows a syntax error.

local function foo()
	local arr = {1, 2, 3, 4}
	for _,i in ipairs(arr) do
		if i % 2 == 0 then
			goto continue
		end
		print(i)
		::continue::
		print("end loop", i)               -- LSP shows "syntax error, expected '='" here
	end
end

foo()
$ cyan run test.tl
1
end loop        1
end loop        2
3
end loop        3
end loop        4

Version: teal-language-server 0.0.5-1 - A language server for the Teal language installed via luarocks


Btw I'm really happy that someone continued working on the language-server as it really makes developing in teal much easier (some would even say without the language-server it's not even possible).
Also tbh usually I avoid labels and gotos so this is not that important to me, just saw it and though I'd report it so this is know and can eventually get fixed.

@FourierTransformer
Copy link
Collaborator

Oh yeah, this should be resolved in main, but a new version hasn't been released quite yet. The bug had to do with how teal-language-server handled trailing :'s, and the fix was to leave the code as-is before passing it to tl for analysis. (it's sort've discussed in #23)

Thanks for reporting! I'll plan to close this out when the new release it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants