lexical-lsp / lexical

Lexical is a next-generation elixir language server
874 stars 80 forks source link

Fix crashing in unsaved vscode files #644

Closed Moosieus closed 6 months ago

Moosieus commented 6 months ago

Pursuant to #641

Moosieus commented 6 months ago

Test at projects/lexical_shared/test/lexical/document/path_test.exs:118 is failing, although vscode's working exactly as intended with the patch in place.

Might need to use a different test case since untitled:* is explicitly handled now, or just forego it entirely.

scohen commented 6 months ago

Also, tests failed, though they look spurious now, in light of the current revelations, though the failures are extremely specific.

scohen commented 6 months ago

I'm actually a bit worried about this change now; we use paths all over the place, and untitled:Untitled-1 is most definitely not a path. What are the ramifications of doing this?

Moosieus commented 6 months ago

Hard for me to say what the ramifications are - here's what I got though:

Everything else seems to work as anticipated.

scohen commented 6 months ago

the misnomer is making me worried, we've assumed paths are... paths, and can be operated on with the Path module

scohen commented 6 months ago

I'm going to land this, and we'll see how it goes.