Skip to content

Comments

fix(expert): don't crash on missing root_uri#412

Open
evnu wants to merge 1 commit intoelixir-lang:mainfrom
evnu:fix-397-single_file-crash
Open

fix(expert): don't crash on missing root_uri#412
evnu wants to merge 1 commit intoelixir-lang:mainfrom
evnu:fix-397-single_file-crash

Conversation

@evnu
Copy link

@evnu evnu commented Feb 19, 2026

Opening an .exs file outside of a mix project results in a crash as described in #397. As described in GenLSP.Structures.InitializeParams, the root_uri is allowed to be nil and must be handled accordingly. To avoid crashing on start up in such a case, this PR drops setting the workspace URI in this case. While this doesn't make expert fully functional in single-file mode, with this change allows debugging further problems in the case of root_uri not being set.

Fix #397.

The root_uri is allowed to be nil according to the spec. Fix elixir-lang#397.
@mhanberg
Copy link
Member

@katafrakt can you take a gander at this

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Crash in XPExpert.State.initialize/2 if root_uri is nil

2 participants