lexical-lsp / lexical

Lexical is a next-generation elixir language server
779 stars 77 forks source link

Included non-deps symbols in fuzzy matcher #704

Closed scohen closed 2 months ago

scohen commented 2 months ago

I noticed that the fuzzy matcher wouldn't match any unit tests. This is because their application is nil, as they're scripts. This change checks for nil applications, and if it finds one, only excludes the mapped entry if the path looks like it comes from a dependencies directory.

Note, the deps directory name is hard coded. I originally queried the project for the deps directory name, but this would include dependencies in the projects directory, which was quite annoying, hence the hard-coding.

scohen commented 2 months ago

@zachallaun please take another look.

scohen commented 2 months ago

FYI, @zachallaun the previous approach wouldn't allow searches for Lexical.Document to succeed either.

scohen commented 2 months ago

One downside is that it finds the existing deps directories once when fuzzy is initialized

There's really no way to fix this. There is a lot of trouble with LSP file watching, several editors (emacs included) simply don't deliver didChangeWatchedFiles messages reliably, which is a shame.