Skip to content

LSP crashes on didOpen for non-file URIs (mendix-mdl: scheme) #1245

Description

@kaspergff

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

  1. Open a Mendix project folder in VS Code with the MDL extension active.
  2. Open a virtual document with the mendix-mdl: scheme, for example an extension preview or a describe view.
  3. 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.

Activity

  1. github-actions commented on Oct 1, 2026

    @github-actions

    Issue Triage

    Summary
    The mxcli language server panics and exits when it receives a didOpen notification for a document whose URI scheme is not file: (e.g., mendix-mdl: virtual documents).

    Checklist of required bug‑report information

    Required info Present? Notes
    mxcli version (output of mxcli --version or commit/build) ❌ Not mentioned
    Mendix version of the project (e.g., 10.x, 9.x) ❌ Not mentioned
    Scenario – what the user was trying to do ✅ Opening a Mendix project in VS Code with the MDL extension and opening a virtual document
    Expected output – what should have happened ✅ Server should ignore or handle non‑file documents without crashing
    Experienced output – what actually happened (error, crash) ✅ Panic stack trace and server exit code 2
    AI bug report – output of mxcli diag --bundle or session log ❌ Not provided

    What’s missing
    To help us reproduce and fix the issue, could you please add:

    1. The version of mxcli you’re running (mxcli --version or the commit/build identifier).
    2. The Mendix version of the project you’re working with (e.g., 10.6, 9.24).
    3. If possible, a diagnostic bundle (mxcli diag --bundle) or at least the relevant session log from the crash.

    Once we have those details, we’ll be able to investigate further. Thanks for reporting this!


    Automated triage via OpenRouter — workflow source

  2. ako commented on Oct 2, 2026

    @ako
    Collaborator

    Thanks for reporting this. It's fixed on main (f6f3956, synced in #1259): the language server no longer crashes on didOpen for a non-file URI. The fix is ako#919, with a regression test. Closing; if you still see it with a build from today or later, please reopen with a reproduction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions