japhib / pico8-ls

PICO-8 Language Server
MIT License
64 stars 8 forks source link

print shorthand ? stops outline view from updating #17

Closed TheRoboZ closed 2 years ago

TheRoboZ commented 2 years ago

If the current open document or any of its includes uses pico's print shorthand ?STR, X, Y, [COL], the outline view is not populated or updated anymore. If you comment out the line or change it to a standard print function it works

japhib commented 2 years ago

Fixed with 0.4.2

TheRoboZ commented 2 years ago

I just tried but it's still happening to me. I Not sure what warning this was giving but it stops the outline view from populating, even if the ? print is in an included file.

japhib commented 2 years ago

The outline view populates fine for me when there’s a ? print statement — can you provide more information to help me reproduce? Like full file contents, what exactly are you typing, maybe a video of your screen to show me?

TheRoboZ commented 2 years ago

One more detail, I found this error in Log(Extension Host) every time I type an ?

[2022-06-09 14:19:18.493] [exthost] [error] [PollywogGames.pico8-ls] provider FAILED [2022-06-09 14:19:18.493] [exthost] [error] Error: selectionRange must be contained in fullRange at Function.validate (c:\Users\Andrea\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:76:96849) at new s (c:\Users\Andrea\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:76:96717) at new s (c:\Users\Andrea\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:76:83077) at ot (c:\Users\Andrea.vscode\extensions\pollywoggames.pico8-ls-0.4.2\client\out-min\main.js:33:50124) at Array.map () at Object.un [as asDocumentSymbols] (c:\Users\Andrea.vscode\extensions\pollywoggames.pico8-ls-0.4.2\client\out-min\main.js:33:50095) at c:\Users\Andrea.vscode\extensions\pollywoggames.pico8-ls-0.4.2\client\out-min\main.js:34:30962 at async r.provideDocumentSymbols (c:\Users\Andrea\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:83:97721)

japhib commented 2 years ago

Looking at this a bit now, it appears that the parser is having issues with ? when there is more than one argument. I had only tested it with one argument 🤦

japhib commented 2 years ago

Not fixed yet, looks like there's another issue that needs to be addressed. But I'm able to consistently repro the problem.

japhib commented 2 years ago

Hey, I believe I've fixed this! Just released 0.4.3 with the fix. Lmk if it's still not working.