Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect existing capitalization in defmodule completion #786

Open
zachallaun opened this issue Jul 5, 2024 · 0 comments · May be fixed by #819
Open

Respect existing capitalization in defmodule completion #786

zachallaun opened this issue Jul 5, 2024 · 0 comments · May be fixed by #819
Labels
completions Enhancements to Lexical's autocompleter enhancement New feature or request good first issue Good for newcomers

Comments

@zachallaun
Copy link
Collaborator

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.

@zachallaun zachallaun added enhancement New feature or request good first issue Good for newcomers completions Enhancements to Lexical's autocompleter labels Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completions Enhancements to Lexical's autocompleter enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant