lexical-lsp / lexical

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

Added safe_split to Ast.Module #743

Closed scohen closed 1 month ago

scohen commented 1 month ago

When lexical deals with modules, they can either be erlang or elixir modules. However, Module.split will raise an exception when called on an erlang module. We've implemented safe_split in a couple of places, and this centralizes the base logic.

Safe split will return the type of module, and if it's an erlang or elixir module. It also allows the module's components to be either in bianry or atom form.