Skip to content

Crash caused by missing name on field definition #453

@bobcozzi

Description

@bobcozzi

New with the latest install of RPGLE while launching my RPGIV2FREE extension in debug mode this new error occurs where it looks like it dumped a ton of javascript to the Output window, I believe it was server.js But here's the start of what I saw:
"[Info - 9:12:08 AM] Connection to server got closed. Server will restart.
[Error - 9:12:08 AM] Request textDocument/codeAction failed.
Error: Connection got disposed.
at Object.dispose (/Users/cozzi/.vscode/extensions/halcyontechltd.vscode-rpgle-0.33.1/out/extension.js:1:56903)
at Object.dispose (/Users/cozzi/.vscode/extensions/halcyontechltd.vscode-rpgle-0.33.1/out/extension.js:1:136997)
at T.handleConnectionClosed (/Users/cozzi/.vscode/extensions/halcyontechltd.vscode-rpgle-0.33.1/out/extension.js:1:137210)
at T.handleConnectionClosed (/Users/cozzi/.vscode/extensions/halcyontechltd.vscode-rpgle-0.33.1/out/extension.js:1:197581)
at t (/Users/cozzi/.vscode/extensions/halcyontechltd.vscode-rpgle-0.33.1/out/extension.js:1:135299)
at r.invoke (/Users/cozzi/.vscode/extensions/halcyontechltd.vscode-rpgle-0.33.1/out/extension.js:1:58517)
at o.fire (/Users/cozzi/.vscode/extensions/halcyontechltd.vscode-rpgle-0.33.1/out/extension.js:1:59278)
at Y (/Users/cozzi/.vscode/extensions/halcyontechltd.vscode-rpgle-0.33.1/out/extension.js:1:46161)
at r.invoke (/Users/cozzi/.vscode/extensions/halcyontechltd.vscode-rpgle-0.33.1/out/extension.js:1:58517)
at o.fire (/Users/cozzi/.vscode/extensions/halcyontechltd.vscode-rpgle-0.33.1/out/extension.js:1:59278)
at d.fireClose (/Users/cozzi/.vscode/extensions/halcyontechltd.vscode-rpgle-0.33.1/out/extension.js:1:67160)
at ChildProcess. (/Users/cozzi/.vscode/extensions/halcyontechltd.vscode-rpgle-0.33.1/out/extension.js:1:78126)
at ChildProcess.emit (node:events:530:35)
at maybeClose (node:internal/child_process:1101:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
at Process.callbackTrampoline (node:internal/async_hooks:130:17)
Debugger listening on ws://127.0.0.1:8789/414b0f83-017c-40bd-99b1-0c29d15933cf
For help, see: https://nodejs.org/en/docs/inspector
{
dynamicRegistration: true,
contextSupport: true,
completionItem: {
snippetSupport: true,
commitCharactersSupport: true,
documentationFormat: [ 'markdown', 'plaintext' ],
deprecatedSupport: true,
preselectSupport: true,
tagSupport: { valueSet: [Array] },
insertReplaceSupport: true,
resolveSupport: { properties: [Array] },
insertTextModeSupport: { valueSet: [Array] }
},
completionItemKind: {
valueSet: [
1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24,
25
]
}
}
Project Mode enabled: false
Server is resolving CUSTMAST
Server is resolving BALANCE
Server is resolving INVENTRY
Server is resolving AIDDATA/MASTR
[Error - 9:12:08 AM] Request textDocument/documentSymbol failed.
Message: Request textDocument/documentSymbol failed with message: Cannot read properties of undefined (reading 'range')
Code: -32603
/Users/cozzi/.vscode/extensions/halcyontechltd.vscode-rpgle-0.33.1/out/server.js:1
(()=>{var e={8505:e=>{"use strict";function t(e,t,o){e instanceof RegExp&&(e=n(e,o)),t instanceof RegExp&&(t=n(t,o));var i=r(e,t,o);return i&&{start:i[0],end:i[1],pre:o.slice(0,i[0]),body:o.slice(i[0]+e.length,i[1]),post:o.slice(i[1]+t........"

==========
This is what GitHub CoPilot said about it:
the RPGLE language server crashing and auto-restarting. Not fatal, but it’s a real bug that can break code actions/symbols until fixed.

What the log means:

“Connection to server got closed. Server will restart.”: VS Code LSP client saw the server process die and restarted it.
“Connection got disposed.” on codeAction: a request hit during shutdown.
“documentSymbol failed … Cannot read properties of undefined (reading 'range')”: a null/undefined node without a position.range triggered an exception in the server.
The “ton of JavaScript” is the bundled, minified server restarting; “Debugger listening …” is Node’s inspector.
When to worry:

If it happens once, you can ignore. If it repeats, features like Outline, Go to Symbol, Code Actions will be flaky for that file.
Quick mitigations:

Reload Window (Cmd+Shift+P → Developer: Reload Window).
Update vscode-rpgle to the latest.
Try disabling it temporarily to confirm it’s the cause (Help → Start Extension Bisect).
If you want to chase it down:

It’s in the server’s documentSymbol path. Likely a symbol node missing position.range (your earlier structs/constants dump shows position.range present; a specific construct may be missing it).
In the repo, search for “documentSymbol” and inspect where it reads node.position.range; add guards or ensure every produced node has a range.
Enable verbose logs if supported (check extension settings for trace) or run the extension from source and set breakpoints around documentSymbol creation.
Workaround in your files:

If a specific member triggers it, isolate a minimal snippet and report it upstream. Ensuring every symbol you emit (constants, structs, subItems) has a valid position.range will avoid this exact error.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions