Skip to content

Respect existing capitalization in defmodule completion #786

@zachallaun

Description

@zachallaun

When completing defmodule, Lexical infers the default module name from the path and file name. For instance:

# lib/my_app/foo/bar.ex
defmodule MyApp.Foo.Bar do
  |
end

How you capitalize acronyms in modules is a point of preference. For instance, lib/my_app/http.ex might contain MyApp.Http or MyApp.HTTP; both are equally valid. Lexical will always generate the camel-case version, which is fine.

However, if you've chosen uppercase and have an existing module MyApp.HTTP and then complete defmodule at lib/my_app/http/request.ex, the default module will be MyApp.Http.Request.

It should be possible for Lexical to infer that you want MyApp.HTTP.Request based on the existence of MyApp.HTTP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    completionsEnhancements to Lexical's autocompleterenhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions