-
-
Notifications
You must be signed in to change notification settings - Fork 354
[Feature Request] Support nonstandardSymbol for Lambda-Style Functions #2515
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
Comments
I'm working with a similar syntax, I was able to disable warnings for the lines my expression is used on with a plugin, though this doesn't properly integrate with the language server. You might be able to transform your syntax into the regular Lua syntax, which the language server would work with. function OnSetText(uri, text)
local diffs = {}
for line in text:gmatch("->[^\n]*()") do
diffs[#diffs+1] = {
start = line - 1,
finish = line - 1,
text = "--[[@diagnostic disable-line: undefined-global, unknown-symbol, redundant-parameter]]"
}
end
return diffs
end |
Yeah so I looked into this and realized it was the route I would have to take until this is supported. However, your precise solution is brittle from my perspective as it doesn't respect the precise syntax of lua expressions. (Stopping at a newline?). Also wouldn't support nested lambda expressions. |
I've been working on writing a definition file for Tabletop Simulator's Lua API.
The lua runtime used by Tabletop Simulator is a subset of Moonsharp (currently version 2.0.0.0).
While it would be great if we could get support for Moonsharp as a runtime option, I realize the amount of effort that would require.
For the most part, it's straightforward to write definition files for the functionality added by Moonsharp.
However, Moonsharp adds additional syntax: the use of
||
for lambda style functions (aka closures).It looks like this:
Which is shorthand for
Unfortunately,
||
is already used for the "or" nonstandard symbol, so I'm not sure how to mark this.The text was updated successfully, but these errors were encountered: