Skip to content

The Slang Language Server server crashed when opening a slang file containing an incomplete 'import' statement (import with no module/path) #60

@yundong2001

Description

@yundong2001

Summary

When editing a .slang file in VS Code, typing an incomplete import statement (just import with nothing after it) can crash the Slang Language Server (slangd) on Windows.

[Trace - 22:56:07] Sending request 'textDocument/inlayHint - (2)'.
Params: {
    "textDocument": {
        "uri": "path/Slangpy/Test/a.slang"
    },
    "range": {
        "start": {
            "line": 0,
            "character": 0
        },
        "end": {
            "line": 1,
            "character": 7
        }
    }
}


[Trace - 22:56:07] Received request 'workspace/inlayHint/refresh - (0)'.
[Trace - 22:56:07] Sending response 'workspace/inlayHint/refresh - (0)'. Processing request took 0ms
No result returned.


[Error - 22:56:07] The Slang Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 22:56:07] Server process exited with code 3221225477.

This looks like a robustness bug in slangd’s incremental parsing / LSP request handling (e.g. documentSymbol, inlayHint) when encountering a syntactically incomplete import statement during editing.

Steps to Reproduce (Minimal)

  1. Open VS Code in an empty folder (new workspace).
  2. Create a new file: repro.slang
  3. Type exactly:
   import

(i.e., the keyword import with no module/path/name after it)
4) Save the file (optional; crash may happen even without saving).
5) Observe the language server crashes immediately.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions