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.

ngc resolves to ngResource #169

Closed
Closed

Description

@demisx

Atom: 0.158.0
Autocomplete: 0.22.14
Angularjs: 0.0.5

Typing ngc and hitting Tab auto completes to ngResource instead of Angular controller code snippet. Everything goes back to normal if I disable this package.

Activity

  1. joefitzgerald commented on Dec 16, 2014

    @joefitzgerald
    Contributor

    Do you have autocomplete-snippets installed?

  2. demisx commented on Dec 16, 2014

    @demisx
    Author

    I don't think so. Here is my ~/.atom/packages/:

    angularjs
    atom-color-highlight
    autocomplete-plus
    blackspace
    coffee-lint
    demisx-light-syntax
    demisx-light-ui
    language-coffee-script-angular
    language-typescript
    linter-scss-lint
    open-last-project
    preview-tabs
    project-manager
    todo-show
    trailing-spaces
    
  3. joefitzgerald commented on Dec 16, 2014

    @joefitzgerald
    Contributor

    Interesting. Can you try pressing ESC prior to pressing tab after you type ngc? The fix may be to undefine tab as a keybinding for autocomplete-plus:confirm, and redefine a different keybinding (like Enter).

  4. joefitzgerald commented on Dec 16, 2014

    @joefitzgerald
    Contributor

    The other option would be to redefine the keybinding for snippet expansion (which is also tab). unset! is what you want to use to undefine the default keybinding, whichever way you want to go.

  5. demisx commented on Dec 17, 2014

    @demisx
    Author

    Can you try pressing ESC prior to pressing tab after you type ngc? The fix may be to undefine tab as a keybinding for autocomplete-plus:confirm, and redefine a different keybinding (like Enter).

    If I hit ESC then the ngResource hint goes away. I press TAB afterwords, then ngc is properly expanded to the Angular controller snippet. However, this is a cumbersome workaround and will not work in real life. Honestly, I don't get why ngResource shows up in the autocompletion when I type ngc. The later is not even a subset of ngResource word.

    The other option would be to redefine the keybinding for snippet expansion (which is also tab). unset! is what you want to use to undefine the default keybinding, whichever way you want to go.

    Sorry, but I have no clue where and how to do this. I do like to preserve TAB for the keyword expansion though.

  6. joefitzgerald commented on Dec 17, 2014

    @joefitzgerald
    Contributor

    @demisx: Atom > Open Your Keymap, then paste the following text in it:

    'atom-text-editor:not(mini) .autocomplete-plus.autocomplete-suggestion-list':
      'tab': 'unset!'
      'enter': 'autocomplete-plus:confirm'

    You can swap out enter for whichever key or combination of keys you want.

    Update: New selector for the keybinding.

  7. joefitzgerald commented on Dec 17, 2014

    @joefitzgerald
    Contributor

    Regarding ngc resolving to ngResource - this is likely an issue with the FuzzyProvider. What kind of file are you editing (i.e. what file extension / grammar are you using)?

  8. demisx commented on Dec 17, 2014

    @demisx
    Author

    Thanks Joe. But I'd prefer to keep tab for autocompletion. If I could just disable the ngResource poping up as match for ngc, then I should be OK. I edit Javascript files in AngularJS framework. ngResource is specific to AngularJS.

  9. joefitzgerald commented on Dec 31, 2014

    @joefitzgerald
    Contributor

    This will be fixed in #184.

  10. added this to the 2.0 milestone on Dec 31, 2014
  11. joefitzgerald commented on Jan 24, 2015

    @joefitzgerald
    Contributor

    To enable strict matching, just enable the preference for it. Right now you have to manually set the preference, but it will be included in the preference UI in the next version of the package. This will prevent the fuzzy matching that allows ngResource to appear for the prefix ngc.

  12. demisx commented on Jan 24, 2015

    @demisx
    Author

    Sorry, where would I set this? I don't see this setting on the Autocomplete Plus settings page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions