FPtje / GLuaFixer

Linter for Garry's mod Lua.
https://fptje.github.io/glualint-web/
GNU Lesser General Public License v2.1
142 stars 19 forks source link

String literals offset warning squiggle positions for some rules #169

Closed robotboy655 closed 1 year ago

robotboy655 commented 1 year ago

Started using this project again, and started noticing weird offsets on warning squiggles that I do not believe were there before.

image

it works correctly when there are no string literals before the warning: image

Sample code that reproduces the issue:

function PrintTable()

    t = "" or ""

    key = "" and "" and "dddd" || "[]"

end

The more string literals you put on a line before the warning, the more the warning will be offset to the left.

Edit: Forgot to mention I am using 1.26.0 build with VSCode plugin, but the issue exists on the web version as well.

FPtje commented 1 year ago

Thanks for reporting, looks like 0d32e506623388a45a8c584cfc6ff3db4367e945 is a suspect commit for this regression.

FPtje commented 1 year ago

Fixed, and added a regression test