Summary
mxcli lsp --stdio panics when the client opens a document whose URI scheme is not file:. The VS Code MDL extension opens virtual documents with the mendix-mdl: scheme. Each open crashes the server. VS Code restarts it, the document is reopened, and the server crashes again. After 5 crashes in 3 minutes, VS Code stops restarting the server.
Environment
- MDL extension build:
nightly-20260927-95091765 (2026-09-27T08:03:28Z)
- OS: Windows 11 Enterprise 10.0.26200
- Server command:
mxcli lsp --stdio
Steps to reproduce
- Open a Mendix project folder in VS Code with the MDL extension active.
- Open a virtual document with the
mendix-mdl: scheme, for example an extension preview or a describe view.
- The language server crashes.
Actual result
panic: only file URIs are supported, got mendix-mdl
go.lsp.dev/uri.URI.Filename(...)
go.lsp.dev/uri@v0.3.0/uri.go:52
main.checkableDocument(...)
github.com/mendixlabs/mxcli/cmd/mxcli/lsp_diagnostics.go:32
main.(*mdlServer).publishDiagnostics(...)
github.com/mendixlabs/mxcli/cmd/mxcli/lsp_diagnostics.go:104
main.(*mdlServer).DidOpen(...)
github.com/mendixlabs/mxcli/cmd/mxcli/lsp_diagnostics.go:128
The server exits with code 2. VS Code then reports: "The MDL Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted."
Expected result
The server ignores non-file documents for file-based diagnostics, or handles them in memory. It must not crash.
Suggested fix
In checkableDocument (lsp_diagnostics.go:32), check uri.Scheme before calling uri.Filename(). Return early when the scheme is not file. Other handlers that call Filename() probably need the same guard.
Workaround
Close all mendix-mdl: tabs and reload the VS Code window.
Summary
mxcli lsp --stdiopanics when the client opens a document whose URI scheme is notfile:. The VS Code MDL extension opens virtual documents with themendix-mdl:scheme. Each open crashes the server. VS Code restarts it, the document is reopened, and the server crashes again. After 5 crashes in 3 minutes, VS Code stops restarting the server.Environment
nightly-20260927-95091765(2026-09-27T08:03:28Z)mxcli lsp --stdioSteps to reproduce
mendix-mdl:scheme, for example an extension preview or a describe view.Actual result
The server exits with code 2. VS Code then reports: "The MDL Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted."
Expected result
The server ignores non-file documents for file-based diagnostics, or handles them in memory. It must not crash.
Suggested fix
In
checkableDocument(lsp_diagnostics.go:32), checkuri.Schemebefore callinguri.Filename(). Return early when the scheme is notfile. Other handlers that callFilename()probably need the same guard.Workaround
Close all
mendix-mdl:tabs and reload the VS Code window.