lexical-lsp / lexical

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

Fixed two bugs with alias calculation #726

Closed scohen closed 2 months ago

scohen commented 2 months ago

My prior PR gave aliases ranges, and determined that an alias start at the end of its range. This meant that all the aliases inside a curly-brace defined alias wouldn't be added to the alias mappings until after the closing curly, which meant the aliases indexer wouldn't get the correct module names for them.

The second bug was always there. We look for the first item in the alias segments in the aliases mapping, and return error if it's not there. However, in a multiple alias, you can do alias Foo.{Bar.Baz}. In that instance, Baz, is the last thing in the segment list, and it wouldn't be found.