gleam icon indicating copy to clipboard operation
gleam copied to clipboard

LSP doesn't work until the the first insert/edit command if the project directory name contains a period

Open joshi-monster opened this issue 6 months ago • 1 comments

I checked out a Gleam project into a directory containing a period. The package name in gleam.toml is just website, the directory name I checked it out to is the domain.

After opening a file in Helix, I used selections, delete, and paste commands which should have produced some syntax errors, but none showed up. I tried some more things like goto definition, to which the LSP responded with "No definition found". Everything started working as expected after I made the first manual insert.

Steps to reproduce

  1. Create a new gleam project: gleam new bug
  2. Rename the directory to contain a period: mv bug b.ug
  3. Open the directory in Helix (see other editors below), and use xd to delete the import statement in the src/bug.gleam file.
  4. No error will show up until an insert was made by entering insert mode, pasting doesn't work

Other characters that are not valid package names work; I've tried $, -, ~, and (space). If the file is saved manually (:w), errors will begin to show up, even if no edit was made. Restarting the LSP (or editor) means that the error will again not show up until an insert was made.

Other editors: I've also tried Zed and VS Code which exhibit the same bug, but there doesn't seem to be a difference between deletes or inserts, so any edit to the file will make the LSP start.

(Gleam 1.4.1)

joshi-monster avatar Aug 18 '24 13:08 joshi-monster