You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Need api: disable FuzzyProvider, let typedText.length > 0 #90
1、I need a provider api to disable just FuzzyProvider
for reason is: atom-ctags auto update symbols when file save, there no need to enable FuzzyProvider. But still need autocomplete-snippets, so I can't use exclusive to exclusive all other provider.
2、I need a provider api to let typedText.length > 0 instead of typedText.length is 1 in autocomplete-view.coffee#L188
for reason is: when input (, bracket-matcher auto insert ), lead to typedText.length == 2, and I need autocomplete to show symbol for pre word which include function param.
diff --git a/lib/autocomplete-view.coffee b/lib/autocomplete-view.coffee
index 3c4b5e1..d8ba104 100644
--- a/lib/autocomplete-view.coffee
+++ b/lib/autocomplete-view.coffee
@@ -26,7 +26,7 @@ class AutocompleteView extends SimpleSelectListView
return if @currentFileBlacklisted()
- @registerProvider new FuzzyProvider(@editorView)
+ # @registerProvider new FuzzyProvider(@editorView)
@handleEvents()
@setCurrentBuffer @editor.getBuffer()
@@ -185,7 +185,7 @@ class AutocompleteView extends SimpleSelectListView
# e - The change {Event}
onChanged: (e) =>
typedText = e.newText.trim()
- if typedText.length is 1 and atom.config.get "autocomplete-plus.enableAutoActivation"
+ if typedText.length > 0 and atom.config.get "autocomplete-plus.enableAutoActivation"
@contentsModified()
else
# Don't refocus since we probably still have focus
If we allowed a registering provider to optionally specify a list of grammars (including an "all" specified - "*"?) for which it wanted to have the built-in provider disabled, you could then use that in fuzzyprovider to avoid autocomplete for those grammars.
I would much rather we don't encourage others to mess with the internals of autocomplete-plus, and instead provide a clean API to disable the fuzzyprovider when required
@yongkangchen Would it suffice to simply ensure atom-ctags and autocomplete-snippets suggestions are always more specific (and consequently higher in priority) than FuzzyProvider?
@joefitzgerald I'd like to be able to disable FuzzyProvider without disabling all other providers as well, but I'd specifically like the user to be able to decide to disable it or not.
With an earlier version of autocomplete-plus, I could simply use a fork of autocomplete-plus which had FuzzyProvider stripped out. That way the user could install autocomplete-plus or not, or adjust the individual fileBlacklist settings of the two autocomplete engines so that they didn't overlap. This doesn't seem possible anymore (without significant inconvenient rewriting), since providers are expected to use the atom.services api.
I'm chiming in here because I think it's important that however this issue is resolved, the user be in control. I think most of the users of my provider don't want to see the default provider options at all, but some may, and some may want to see them in some contexts but not in others. My solution wasn't optimal, but it let the user decide whether and when they would be presented with the different options. Now that I'm migrating back to the stock autocomplete-plus, I'd still like to provide my users with that same configurability.
👍 @apcshields: I'm going to provide two ways to suppress FuzzyProvider: 1) a preference to disable it entirely 2) a way for providers to add to a blacklist of selectors where the FuzzyProvider doesn't get used.
This provides flexibility for the user and provider authors.
Activity
yongkangchen commentedon Jul 7, 2014
urgly hack for now:
yongkangchen commentedon Jul 7, 2014
yongkangchen commentedon Nov 27, 2014
Already find a way to disable FuzzProvider by yongkangchen/atom-ctags@ebcc61a
joefitzgerald commentedon Nov 27, 2014
Isn't that the purpose of an exclusive provider?
yongkangchen commentedon Nov 27, 2014
But still need autocomplete-snippets, so I can't use exclusive to exclusive all other provider.😄yongkangchen commentedon Nov 27, 2014
@joefitzgerald for the second need, do you have any ideal? I am finding a way about it.
joefitzgerald commentedon Nov 27, 2014
If we allowed a registering provider to optionally specify a list of grammars (including an "all" specified - "*"?) for which it wanted to have the built-in provider disabled, you could then use that in fuzzyprovider to avoid autocomplete for those grammars.
yongkangchen commentedon Nov 27, 2014
Good idea, but a little complex. For now, my hack: yongkangchen/atom-ctags@ebcc61a works well, even though not very graceful.
joefitzgerald commentedon Nov 27, 2014
Yeah but that is the nuclear option. The fuzzyprovider is dead for the remainder of the Atom session.
joefitzgerald commentedon Nov 27, 2014
I would much rather we don't encourage others to mess with the internals of autocomplete-plus, and instead provide a clean API to disable the fuzzyprovider when required
yongkangchen commentedon Nov 27, 2014
Agree with you.
joefitzgerald commentedon Jan 19, 2015
@yongkangchen Would it suffice to simply ensure atom-ctags and autocomplete-snippets suggestions are always more specific (and consequently higher in priority) than FuzzyProvider?
apcshields commentedon Jan 25, 2015
@joefitzgerald I'd like to be able to disable FuzzyProvider without disabling all other providers as well, but I'd specifically like the user to be able to decide to disable it or not.
With an earlier version of autocomplete-plus, I could simply use a fork of autocomplete-plus which had FuzzyProvider stripped out. That way the user could install autocomplete-plus or not, or adjust the individual fileBlacklist settings of the two autocomplete engines so that they didn't overlap. This doesn't seem possible anymore (without significant inconvenient rewriting), since providers are expected to use the atom.services api.
I'm chiming in here because I think it's important that however this issue is resolved, the user be in control. I think most of the users of my provider don't want to see the default provider options at all, but some may, and some may want to see them in some contexts but not in others. My solution wasn't optimal, but it let the user decide whether and when they would be presented with the different options. Now that I'm migrating back to the stock autocomplete-plus, I'd still like to provide my users with that same configurability.
joefitzgerald commentedon Jan 25, 2015
👍 @apcshields: I'm going to provide two ways to suppress FuzzyProvider: 1) a preference to disable it entirely 2) a way for providers to add to a blacklist of selectors where the FuzzyProvider doesn't get used.
This provides flexibility for the user and provider authors.
apcshields commentedon Jan 25, 2015
Great!
Crude Support For Blacklisting FuzzyProvider By Scope