Skip to content

Stop appending a trailing dot when autocompleting modules in IEx.#4863

Merged
josevalim merged 1 commit intoelixir-lang:masterfrom
seomoz:myron/no-dot-after-autocorrect
Jun 24, 2016
Merged

Stop appending a trailing dot when autocompleting modules in IEx.#4863
josevalim merged 1 commit intoelixir-lang:masterfrom
seomoz:myron/no-dot-after-autocorrect

Conversation

@myronmarston
Copy link
Contributor

@myronmarston myronmarston commented Jun 23, 2016

I find this behavior to be surprising and annoying. I regularly type h [first few chars of mod name]<tab><enter> in IEx to read the read the moduledoc of a particular module, and the trailing period gets in the way every time.

Here's a demonstration showing what happens to me regularly when I try to read the @moduledoc for a module:

iex_autocomplete_original

With this change, it avoids this problem:

iex_autocomplete_improved

Now, I know the existing behavior must be intentional (after all, it's been there a long time and was specified by tests) so I'm fully expecting that this may not be merged. If the elixir-core team feels the existing behavior is best, that's fine. Figured I'd open the PR and see if @josevalim and the team are open to changing, it, though, since I've found it so consistently annoying.

@ericentin
Copy link
Contributor

I'm not in support of merging this, if only because the vast majority of the time I autocomplete a module in IEx it is to make a remote call. I would be in support of making this configurable, however.

I think you should take this discussion to the core mailing list so that the community can discuss further. :)

@josevalim
Copy link
Member

Thank you @myronmarston. I think it is worth bringing it to the mailing list indeed although I think my thoughts inline well with what @antipax said. :)

@myronmarston
Copy link
Contributor Author

Fair enough. I'll start a thread on the mailing list later this morning when I'm on my computer and not limited to typing on an iPhone keyboard :-).

@josevalim
Copy link
Member

Ok, closing this and we can reopen depending on how it goes. :)

@josevalim josevalim closed this Jun 23, 2016
@myronmarston
Copy link
Contributor Author

Discussion moved to the mailing list:

https://groups.google.com/forum/#!topic/elixir-lang-core/ZDbAdRgCvzw

@josevalim josevalim reopened this Jun 23, 2016
@josevalim
Copy link
Member

I have reopened this because an option is definitely welcome. IEx already has an app configuration and we can have a new key in there. The mailing list conversation will still be useful to choose a proper default value. :)

@myronmarston
Copy link
Contributor Author

Cool. Let me know when you've decided what to call the config option and what default to give it, and I'll update this PR.

@myronmarston myronmarston force-pushed the myron/no-dot-after-autocorrect branch from 818f1d4 to b096959 Compare June 24, 2016 02:44
@myronmarston
Copy link
Contributor Author

OK, I implemented the "double tab" solution discussed in the mailing list that there seemed to be consensus about. Please let me know if you're satisfied with this, @josevalim.

I find this behavior to be surprising and annoying. I regularly
type `h [first few chars of mod name]<tab><enter>` in IEx to read
the read the moduledoc of a particular module, and the trailing
dot gets in the way every time.

Instead, we append a dot when you hit tab after the module name is
already complete--so if you hit tab twice, it will autocomplete the
module name and then append a trailing dot.
@myronmarston myronmarston force-pushed the myron/no-dot-after-autocorrect branch from b096959 to 0f9da74 Compare June 24, 2016 02:48
@josevalim josevalim merged commit ce37b34 into elixir-lang:master Jun 24, 2016
@josevalim
Copy link
Member

❤️ 💚 💙 💛 💜

@myronmarston myronmarston deleted the myron/no-dot-after-autocorrect branch June 24, 2016 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants