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

[Bug]: Lua diagnostics in Visual Studio are not aware of the target Lua version (on hardware) #69

Open
2 tasks done
Krampmeier opened this issue Nov 1, 2024 · 1 comment
Labels
bug Something isn't working triage This issue needs to be triaged by the development team.

Comments

@Krampmeier
Copy link

Pre-check

  • I have searched the existing issues and discussions to make sure my problem has not already been addressed.
  • I have looked at the "Known Issues" Section of the marketplace page of all TSP Toolkit extensions.

Search Terms

Visual studio will strikeout certain functions, like table.getn(), and flag them as deprecated. That's not correct for the target system, as the DMM 6500 has an old Lua interpreter which does support table.getn().
On the ther hand, things like #t (with t being a table) are not marked as an error, even though the Lua on the machine does not support these new language features.
I have found several table functions which do not work on the 6500's interpreter, and it would be good if the IDE could indicate those.
Using 0.18.2 of the toolkit, which pulled in lua-language-server 3.12.2

TSP Toolkit Version

None

TSP Toolkit Develop Version

None

Steps to Reproduce

Write a script containing
local gridLines = {} gridLines[1] = display.create(swipe_id, display.OBJ_LINE, 1, 5, 1, 200) gridLines[2] = display.create(swipe_id, display.OBJ_LINE, 270, 5, 270, 200) gridLines[3] = display.create(swipe_id, display.OBJ_LINE, 600, 5, 600, 200) for i = 1, table.getn(gridLines) do display.setcolor(gridLines[i], 0x7f7f7f) end
print (#t)

Expected Behavior

table.getn(gridLines) should not be flagged as deprecated
#t should be flagged as not supported by the target platform

Actual Behavior

table.getn(gridLines) is printed in strikethrough font and flagged deprecated
#t is not flagged

@Krampmeier Krampmeier added bug Something isn't working triage This issue needs to be triaged by the development team. labels Nov 1, 2024
@Krampmeier
Copy link
Author

Updated to V1.0.0 --> table.getn is no longer flagged - excellent!
However, #t still does not get flagged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage This issue needs to be triaged by the development team.
Projects
None yet
Development

No branches or pull requests

1 participant