autocomplete-plus icon indicating copy to clipboard operation
autocomplete-plus copied to clipboard

Make "additional word characters" configurable via UI

Open AlexWayfer opened this issue 8 years ago • 4 comments

Prerequisites

  • [x] Put an X between the brackets on this line if you have done all of the following:
    • Reproduced the problem in Safe Mode: http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
    • Followed all applicable steps in the debugging guide: http://flight-manual.atom.io/hacking-atom/sections/debugging/
    • Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
    • Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
    • Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages

Description

Make additionalWordCharacters (since 705f7f1328d3996eb1a6772b0d3cd9c5a0741c23) available for configuring via UI, please.

I have _ in Non-word characters Editor settings for simpler navigation and selection in Ruby code.

But suggestions worked greats for me before this change.

Steps to Reproduce

  1. Have _ in Non-word characters Editor setting
  2. Have foo_bar in file
  3. Type foo

Expected behavior: foo_bar suggestion.

Actual behavior: foo suggestion.

Reproduces how often: 100%.

Versions

$ atom --version
Atom    : 1.22.0
Electron: 1.6.15
Chrome  : 56.0.2924.87
Node    : 7.4.0

$ apm --version
apm  1.18.8
npm  3.10.10
node 6.9.5 x64
python 2.7.14
git 2.15.0

autocomplete-plus 2.36.8

Arch Linux, 4.13.11-1.

Additional Information

Without _ in Non-word characters (default):

image

With _:

image

AlexWayfer avatar Nov 08 '17 17:11 AlexWayfer

Hi @AlexWayfer! Thanks for the report. In the new autocomplete-plus provider, we tried to make autocomplete and the editor agree on what constitutes a word boundary. The old provider had its own ideas of what determines a word boundary.

Could you elaborate a bit more on why you'd like to see the editor and autocomplete have different notions of a word boundary?

In the meantime, you could switch back to the Symbol provider if you'd like in the autocomplete-plus settings: screen shot 2017-11-08 at 4 46 29 pm

leroix avatar Nov 08 '17 23:11 leroix

Hi!

In the new autocomplete-plus provider, we tried to make autocomplete and the editor agree on what constitutes a word boundary.

I'm understanding, I'm not against that.

I'm just suggesting to add the new option to autocomplete-plus settings UI.

Could you elaborate a bit more on why you'd like to see the editor and autocomplete have different notions of a word boundary?

I tried… Ruby Language is not camelCase, it's snake_case. And you can have two local variables (or methods, etc.): file_name and file_mtime, for example. When you decide to add file_basename variable — it's very comfortable to move through name-parts via Ctrl+Arrows. Yes, there are Alt+Arrows, but Ctrl is more comfortable. And when you want to see all of your file_* variables (with highlighting plugin) — just double-click on file and it will select file, not file_something. Or if you want to rename file_* to original_file_* or something else — same selecting with Ctrl+D.

There are many cases of comfortable usage. But for all of them you need to add _ into Non-word characters in Editor settings.

But for now, autocomplete-plus takes it into account, and all my suggestions, like as file_name, file_mtime, file_etc disappeared. It took me a while to figure out the reason. Before that, I just didn't notice any problems.

I hope, I explained it quite clearly enough with my far from perfect English :)

In the meantime, you could switch back to the Symbol provider if you'd like in the autocomplete-plus settings:

Sorry, but it doesn't help.

image

AlexWayfer avatar Nov 09 '17 10:11 AlexWayfer

@AlexWayfer nothing has changed with the Symbol provider. It just doesn't seem to gather words from an untitled buffer for some reason. I verified that the scenario you depicted works in a saved buffer.

I do think it could be a good idea to give the user the power to override additionalWordCharacters like you're saying. Is that something you'd be interested in implementing?

leroix avatar Nov 09 '17 19:11 leroix

@AlexWayfer nothing has changed with the Symbol provider. It just doesn't seem to gather words from an untitled buffer for some reason. I verified that the scenario you depicted works in a saved buffer.

Okay, like so. It's strange, but thank you.

I do think it could be a good idea to give the user the power to override additionalWordCharacters like you're saying.

Cool!

Is that something you'd be interested in implementing?

Sorry, but I have almost no free time, and I have worked very little with Atom Plugins. Adding an one line to the configuration UI can take me a few hours :sweat_smile:

AlexWayfer avatar Nov 09 '17 19:11 AlexWayfer