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

Invalid double function call syntax is not squiggled for Lua version 5.2 and prior #1422

Closed
sewbacca opened this issue Aug 1, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@sewbacca
Copy link
Contributor

sewbacca commented Aug 1, 2022

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Diagnostics/Syntax Checking

Expected Behaviour

Syntax squiggles, notifying invalid Lua code, if the version is set to Lua 5.2, Lua 5.1 or Lua JIT.
Expected error: lua5.1: luatest.lua:9: ambiguous syntax (function call x new statement) near '('

Actual Behaviour

Syntax is accepted, as it would be expected for Lua 5.3 and Lua 5.4.

Reproduction steps

local function nestedFunction(name)
	return function(f)
		f()
	end
end

nestedFunction "My function"
(function ()
	print "Hello"
end)

Additional Notes

Correct function call for 5.2 and prior would be:

nestedFunction "My function" (
function ()
	print "Hello"
end)

Log File

No response

@sewbacca sewbacca changed the title Invalid syntax double function call syntax is not squiggled for Lua version prior 5.2 Invalid syntax double function call syntax is not squiggled for Lua version and prior 5.2 Aug 1, 2022
@sewbacca sewbacca changed the title Invalid syntax double function call syntax is not squiggled for Lua version and prior 5.2 Invalid syntax double function call syntax is not squiggled for Lua version 5.2 and prior Aug 1, 2022
@sewbacca sewbacca changed the title Invalid syntax double function call syntax is not squiggled for Lua version 5.2 and prior Invalid double function call syntax is not squiggled for Lua version 5.2 and prior Aug 1, 2022
@sumneko sumneko added the bug Something isn't working label Aug 2, 2022
@sumneko
Copy link
Collaborator

sumneko commented Aug 8, 2022

I have tested it is valid in Lua 5.2

@sumneko sumneko closed this as completed in 13bb2c6 Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants