tektronix / tsp-toolkit

VSCode extension for Keithley Instruments' Test Script Processor
Apache License 2.0
9 stars 2 forks source link

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

Open Krampmeier opened 3 weeks ago

Krampmeier commented 3 weeks ago

Pre-check

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 commented 3 weeks ago

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