joefitzgerald / autocomplete-go

An Atom autocomplete-plus provider for the Go language that uses gocode to provide suggestions.
Other
29 stars 3 forks source link

why autocompleting inside strings? #16

Closed spf2 closed 8 years ago

spf2 commented 8 years ago
screen shot 2016-03-25 at 2 38 35 pm

(it's hard to see, but the cursor is in the middle of the word "blue")

joefitzgerald commented 8 years ago

This should not be occurring. We specifically suppress autocomplete inside the .string.quoted scope. When you encounter situations like these, can you please ensure you check the scope(s) at the current cursor position by pressing command-option-p, and paste the resulting scopes?

sprt commented 8 years ago

This is what I get: screenshot from 2016-04-05 10-02-14

joefitzgerald commented 8 years ago

Please update to the latest version of the package.

sprt commented 8 years ago

Forgot to mention but I did. That was running v1.0.6.

joefitzgerald commented 8 years ago

So the scopes we block on are configurable in an option for autocomplete-go called "Scope Blacklist". Have you configured your own values here? Take a look at the default values, and then adjust them until the autocomplete dialog stops coming up. Then, let me know if the defaults should be changed.

Note that there is also a blacklist on autocomplete-plus that will suppress all autocomplete providers (of which autocomplete-go is just one). Make sure you don't have any others installed that are active.

spf2 commented 8 years ago

fwiw, i cannot repro anymore. i had had some . includes that i've since removed, i wonder if that was causing some issues?

sprt commented 8 years ago

Alright so it looks like autocomplete-go's suppressBuiltinAutocompleteProvider setting has no effect: I tried copying autocomplete-go's default blacklist to autocomplete-plus' blacklist and the bug went away. Simply disabling autocomplete-plus' enableBuiltinProvider fixes it also.

joefitzgerald commented 8 years ago

OK, so the issue is that there is no way for a specific ac+ provider (like autocomplete-go) to prevent the built-in provider from giving suggestions. It used to be possible, but it was removed as part of the process of bundling ac+ in the core of atom.

suppressBuiltinAutocompleteProvider does work, but it only works if autocomplete-go says it's not blacklisted. I think this is a legitimate scenario where ac+ needs to be changed.