Open Dragonisser opened 1 year ago
Are you able to reproduce this in the latest versions?
I haven't encountered it yet, tho i wasn't really using it either lately. If i run into it again ill let you know.
Still happens:
[2023-10-10T11:55:21.977Z WARN] Unknown notification: textDocument/didSave
[2023-10-10T11:55:26.594Z WARN] Unknown notification: textDocument/didSave
[2023-10-10T11:55:29.461Z WARN] Unknown notification: textDocument/didSave
[Error - 1:55:42 PM] Request textDocument/documentSymbol failed.
Error: name must not be falsy
at r.validate (c:\Users\acks\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:121:16990)
at new r (c:\Users\acks\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:121:17285)
at ye (c:\Users\acks\.vscode\extensions\sarrus.sourcepawn-vscode-6.1.0-win32-x64\dist\spIndex.js:34:73456)
at ye (c:\Users\acks\.vscode\extensions\sarrus.sourcepawn-vscode-6.1.0-win32-x64\dist\spIndex.js:34:73637)
at o (c:\Users\acks\.vscode\extensions\sarrus.sourcepawn-vscode-6.1.0-win32-x64\dist\spIndex.js:34:48563)
at Object.oj [as map] (c:\Users\acks\.vscode\extensions\sarrus.sourcepawn-vscode-6.1.0-win32-x64\dist\spIndex.js:34:48649)
at Object.wr [as asDocumentSymbols] (c:\Users\acks\.vscode\extensions\sarrus.sourcepawn-vscode-6.1.0-win32-x64\dist\spIndex.js:34:73423)
at c (c:\Users\acks\.vscode\extensions\sarrus.sourcepawn-vscode-6.1.0-win32-x64\dist\spIndex.js:38:56041)
at async r.provideDocumentSymbols (c:\Users\acks\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:127:37581)
[2023-10-10T11:55:51.922Z WARN] Unknown notification: textDocument/didSave
[2023-10-10T11:55:53.431Z WARN] Unknown notification: textDocument/didSave
It's happening consistently for me in the TF2 RTD plugin, though its code is old and convoluted and I wasn't able to track it down to anything specific.
It only happens when you're editing the main scripting/rtd.sp
file. If you go to scripting/rtd/perks/drugged.sp
(or pretty much any other script file) then there aren't any issues.
A better repro is Found the issue for that file, I had an empty enum like this:scripting/rtd/storage/precached.sp
. It's smaller, relatively self-contained and doesn't include anything.
enum TEParticleId
{
}
If I add ex. INVALID_PARTICLE_ID = -1
as a field it fixes the error. However, it's still popping up in the main rtd.sp
file.
My issue is likely related to overabundant use of macros in methodmaps, ex. in scripting/rtd/classes/perk.sp
. Which probably isn't OP's problem.
[2023-11-01T03:31:22.950Z INFO] Telemetry is enabled. To disable it, use the --disable-telemetry flag.
[2023-11-01T03:31:22.951Z INFO] Starting sourcepawn-lsp version 0.12.0
[2023-11-01T03:31:22.957Z INFO] Received config [
Object {
"disableSyntaxLinter": Bool(false),
"includesDirectories": Array [],
"linterArguments": Array [],
"mainPath": String("U:\\Work\\Code\\RTD\\scripting\\rtd.sp"),
"spcompPath": String("U:\\Work\\Code\\RTD\\scripting\\spcomp.exe"),
},
]
[2023-11-01T03:31:23.746Z ERROR] Unknown token: Range {
start: Position {
line: 206,
character: 54,
},
end: Position {
line: 206,
character: 55,
},
}
[2023-11-01T03:31:23.832Z ERROR] Unknown token: Range {
start: Position {
line: 206,
character: 54,
},
end: Position {
line: 206,
character: 55,
},
}
[2023-11-01T03:31:24.014Z ERROR] Unknown token: Range {
start: Position {
line: 206,
character: 54,
},
end: Position {
line: 206,
character: 55,
},
}
[2023-11-01T03:31:24.164Z WARN] Unknown notification: $/setTrace
[2023-11-01T03:31:24.164Z WARN] Unknown notification: $/setTrace
[2023-11-01T03:31:24.164Z WARN] Unknown notification: $/setTrace
[2023-11-01T03:31:24.520Z WARN] Unknown notification: $/setTrace
[2023-11-01T03:31:24.520Z WARN] Unknown notification: $/setTrace
[2023-11-01T03:31:24.520Z WARN] Unknown notification: $/setTrace
[Error - 4:31:24 AM] Request textDocument/documentSymbol failed.
Error: name must not be falsy
at r.validate (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:121:16990)
at new r (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:121:17285)
at ye (c:\Users\phil\.vscode\extensions\sarrus.sourcepawn-vscode-6.2.0-win32-x64\dist\spIndex.js:34:73456)
at ye (c:\Users\phil\.vscode\extensions\sarrus.sourcepawn-vscode-6.2.0-win32-x64\dist\spIndex.js:34:73637)
at o (c:\Users\phil\.vscode\extensions\sarrus.sourcepawn-vscode-6.2.0-win32-x64\dist\spIndex.js:34:48563)
at Object.oj [as map] (c:\Users\phil\.vscode\extensions\sarrus.sourcepawn-vscode-6.2.0-win32-x64\dist\spIndex.js:34:48649)
at Object.wr [as asDocumentSymbols] (c:\Users\phil\.vscode\extensions\sarrus.sourcepawn-vscode-6.2.0-win32-x64\dist\spIndex.js:34:73423)
at c (c:\Users\phil\.vscode\extensions\sarrus.sourcepawn-vscode-6.2.0-win32-x64\dist\spIndex.js:38:56041)
at async r.provideDocumentSymbols (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:127:37581)
Thanks for the details, will look into that!
In my case its with this plugin, but i couldnt narrow it down. https://github.com/tf2td/towerdefense
I have the same problem as well, fortunately I have reproduced the bug. The bug only occurs when an EMPTY enum exists in a file, doesn't matter if an inc file or an sp file.
enum Test
{
// This will result in "Request textDocument/documentSymbol failed."
// L Error: name must not be falsy
}
But this will not:
enum Test
{
TEST_ENUM1
}
However, sadly none of the files the OP and others commented on have empty enums in them, I guess I just encountered another producer of the bug.
( Also autocompletion seems to be broken in .inc files but that is another issue for another day :) )
the same error occurs when the extension tries to show an overview of the function, idk, maybe it's somehow related to enums.
enum UITaskMessage_Color {
UITaskMessage_Fail,
UITaskMessage_Success
}
void UITaskMessage_Display(WCPlayer pl, UITaskMessage_Color color, )
{
}
[Error - 11:43:06 PM] Request textDocument/documentSymbol failed.
Error: name must not be falsy
at d.validate (c:\Users\*\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:137:17256)
at new d (c:\Users\*\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:137:17551)
at ye (c:\Users\*\.vscode\extensions\sarrus.sourcepawn-vscode-6.2.0-win32-x64\dist\spIndex.js:34:73456)
at ye (c:\Users\*\.vscode\extensions\sarrus.sourcepawn-vscode-6.2.0-win32-x64\dist\spIndex.js:34:73637)
at o (c:\Users\*\.vscode\extensions\sarrus.sourcepawn-vscode-6.2.0-win32-x64\dist\spIndex.js:34:48563)
at Object.oj [as map] (c:\Users\*\.vscode\extensions\sarrus.sourcepawn-vscode-6.2.0-win32-x64\dist\spIndex.js:34:48649)
at Object.wr [as asDocumentSymbols] (c:\Users\*\.vscode\extensions\sarrus.sourcepawn-vscode-6.2.0-win32-x64\dist\spIndex.js:34:73423)
at c (c:\Users\*\.vscode\extensions\sarrus.sourcepawn-vscode-6.2.0-win32-x64\dist\spIndex.js:38:56041)
at async d.provideDocumentSymbols (c:\Users\*\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:143:39616)
Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
Date: 2023-12-13T09:49:37.021Z
Electron: 25.9.7
ElectronBuildId: 25551756
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19044
Extension version: v6.2.0
Sadly its still happening and i have no idea why.
This is terrible, I just type "char" and this window immediately pops up and even the AI can’t help turn off this annoying window. It's strange that there is no setting in VS Code to disable it. This is just spam that prevents you from writing code.
I will look into this again, it seems like the empty enum name error is back.
Basic informations
Further Information
Error below keeps popping up from time to time
Afterwards i cant ctrl+leftclick on functions to jump to its declaration I need to restart the sourcepawn-lsp server to make it work again
To Reproduce
Code to reproduce the behaviour
https://github.com/tf2td/towerdefense
Expected behaviour
No error
Error messages