Error: Illegal argument: character must be non-negative
renpytom opened this issue · 7 comments
I've been getting the attached error in language-renpy v , in vs code 1.79.2. When it happens, it interrupts my typing, with a second-long pause. I'm seeing this in the extension host output - not sure if there's something more directly part of vs code. It seems to happen when editing strings in the renpy/common directory.
I'm also seeing a lot of "The token tree is not covering the entire match range" errors in the developer tools console.
To repeat, go to renpy/common/00director.rpy, line 1372, and add a space after int(v), at the end of the line.
2023-06-22 23:03:23.278 [error] [LuqueDaniel.languague-renpy] provider FAILED
2023-06-22 23:03:23.285 [error] Error: Illegal argument: character must be non-negative
at m (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:7:1267)
at new s (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:97:13554)
at t.getSignatureHelp (/home/tom/.vscode/extensions/luquedaniel.languague-renpy-2.2.1/dist/extension.js:2:73557)
at Object.provideSignatureHelp (/home/tom/.vscode/extensions/luquedaniel.languague-renpy-2.2.1/dist/extension.js:2:29736)
at be.provideSignatureHelp (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:101:56126)
at /usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:101:73424
at oe.s (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:101:63904)
at oe.$provideSignatureHelp (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:101:73410)
at s.N (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:11717)
at s.M (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:11435)
at s.H (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:10477)
at s.G (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:9494)
at /usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:8282
at b.invoke (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:145)
at deliver (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:2121)
at n.fire (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:1729)
at p.fire (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:73:14783)
at /usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:127:32461
at b.invoke (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:145)
at deliver (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:2121)
at n.fire (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:1729)
at p.fire (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:73:14783)
at MessagePortMain.<anonymous> (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:127:30587)
at MessagePortMain.emit (node:events:513:28)
at Object.MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:367)
Hi tom, it seems you are still using v2.2.1.
at t.getSignatureHelp (/home/tom/.vscode/extensions/luquedaniel.languague-renpy-2.2.1/dist/extension.js:2:73557)
In 2.2.1 we had a bug in the tokenizer that would cause an infinite loop or major slowdown in some cases. v2.2.2 stable was just released with all the bug fixes from the pre-release version so it should be okay in the latest build.
I did try to reproduce it, but I was unable to do so. Let me know if you are still experiencing issues in the latest build and I'll be happy to take another look :)
I actually did manage to find the error you got. #352 should fix that, though it seems the error is unrelated to the interrupted typing
Is this still an issue or can this be closed ?
It can be closed.
"The token tree is not covering the entire match range" still seems to happen a lot.
Yeah true, that warning message is from my custom parser. It's caused by the tokenizer either skipping over some tokens because the patterns didn't match everything, or the pattern didn't specify a token type for some characters.
It's mostly whitespace and some punctuation tokens. Though some of them are actually correct and require some syntax file updates since some features are still missing or broken
I'm wondering if it makes sense to add a configuration variable to control that output, as it seems to flood the console (which might have some peformance implications, at least during development).
Yeah, might be good to reduce the output. I can take a look tomorrow. Though technically you can already remove it locally by picking a logger output category higher than info (which I believe is the default currently)