Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
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

Closed

Description

@yongkangchen

yongkangchen/atom-ctags#3

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.

Activity

  1. yongkangchen commented on Jul 7, 2014

    @yongkangchen
    ContributorAuthor

    urgly hack for now:

    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
    
  2. yongkangchen commented on Jul 7, 2014

    @yongkangchen
    ContributorAuthor

    atom-ctags-complete

  3. yongkangchen commented on Nov 27, 2014

    @yongkangchen
    ContributorAuthor

    Already find a way to disable FuzzProvider by yongkangchen/atom-ctags@ebcc61a

  4. joefitzgerald commented on Nov 27, 2014

    @joefitzgerald
    Contributor

    Isn't that the purpose of an exclusive provider?

  5. yongkangchen commented on Nov 27, 2014

    @yongkangchen
    ContributorAuthor

    But still need autocomplete-snippets, so I can't use exclusive to exclusive all other provider. 😄

  6. yongkangchen commented on Nov 27, 2014

    @yongkangchen
    ContributorAuthor

    @joefitzgerald for the second need, do you have any ideal? I am finding a way about it.

  7. joefitzgerald commented on Nov 27, 2014

    @joefitzgerald
    Contributor

    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.

  8. yongkangchen commented on Nov 27, 2014

    @yongkangchen
    ContributorAuthor

    Good idea, but a little complex. For now, my hack: yongkangchen/atom-ctags@ebcc61a works well, even though not very graceful.

  9. joefitzgerald commented on Nov 27, 2014

    @joefitzgerald
    Contributor

    Yeah but that is the nuclear option. The fuzzyprovider is dead for the remainder of the Atom session.

  10. joefitzgerald commented on Nov 27, 2014

    @joefitzgerald
    Contributor

    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

  11. yongkangchen commented on Nov 27, 2014

    @yongkangchen
    ContributorAuthor

    Agree with you.

  12. added this to the 2.0 milestone on Dec 31, 2014
  13. joefitzgerald commented on Jan 19, 2015

    @joefitzgerald
    Contributor

    @yongkangchen Would it suffice to simply ensure atom-ctags and autocomplete-snippets suggestions are always more specific (and consequently higher in priority) than FuzzyProvider?

  14. apcshields commented on Jan 25, 2015

    @apcshields

    @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.

  15. joefitzgerald commented on Jan 25, 2015

    @joefitzgerald
    Contributor

    👍 @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.

  16. apcshields commented on Jan 25, 2015

    @apcshields

    Great!

  17. added a commit that references this issue on Jan 26, 2015
    a7f8ffa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions