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.

FuzzyProvider Should Remove Words Which Are No Longer In Any Open Buffer #196

Closed

Description

@DiThi
  • Open a new buffer.
  • Write bogos = 1, then press enter.
  • Correct that word to "bogus" by replacing one letter.

Now it's only autocompleting "bogos" and not "bogus". If you write "bogus" later, both versions are in the autocompletion list.

There's no way to remove words with typos without closing the document or rebooting atom (if configured to use other buffers).

When typing a word then pressing enter, it's not added to autocompletion (hence the = 1 in the example).

Activity

  1. joefitzgerald commented on Jan 19, 2015

    @joefitzgerald
    Contributor

    What is the filetype of the file you opened prior to typing bogos = 1? We will create a test and then fix in #186.

  2. DiThi commented on Jan 19, 2015

    @DiThi
    Author

    No type, just creating a new empty document. It also happened to me with CoffeeScript and Python.

  3. joefitzgerald commented on Jan 19, 2015

    @joefitzgerald
    Contributor

    Got it. Thanks!

  4. changed the title [-]Can't autocomplete changed word, can't remove word with typo, some words not added.[/-] [+]FuzzyProvider Should Remove Words Which Are No Longer In Any Open Buffer[/+] on Jan 19, 2015
  5. added this to the 2.0 milestone on Jan 19, 2015
  6. DiThi commented on Jan 19, 2015

    @DiThi
    Author

    I think this is a bug. Also the new title doesn't reflect that changed words and words in end of line aren't added. But maybe that should be filed in a different issue?

  7. joefitzgerald commented on Jan 19, 2015

    @joefitzgerald
    Contributor

    Bug or enhancement, it doesn't change anything :) Reality is the current FuzzyProvider implementation is a holdover from autocomplete, and needs significant enhancement to be more useful. If you would like to open additional issues feel free, or edit this issue to describe the use cases you'd like covered by a set of tests so we can lock in the behavior.

  8. joefitzgerald commented on Jan 24, 2015

    @joefitzgerald
    Contributor

    As far as I can tell from the code, saving the open buffer should cause the word list to be rebuilt. If that doesn't remove the extraneous suggestion, we have an issue. I'm a little hesitant to rebuilt the word list in a single buffer continuously, so despite having a test for this that reliably reproduces it, I'm not sure the fix should be put in place for performance reasons. Thoughts @park9140?

    it "removes words from the wordlist when they no longer exist in any open buffers", ->
          provider = autocompleteManager.providerManager.fuzzyProvider
    
          expect(provider.wordList.indexOf("bogos")).toEqual(-1)
          editor.insertText("bogos = 1")
          editor.insertText(" ")
          expect(provider.wordList.indexOf("bogos")).not.toEqual(-1)
          expect(provider.wordList.indexOf("bogus")).toEqual(-1)
          editor.backspace() for [1..7]
          editor.insertText("us = 1")
          editor.insertText(" ")
          expect(provider.wordList.indexOf("bogus")).not.toEqual(-1)
          expect(provider.wordList.indexOf("bogos")).toEqual(-1)
  9. added a commit that references this issue on Jan 24, 2015
  10. park9140 commented on Jan 24, 2015

    @park9140
    Contributor

    @joefitzgerald , honestly, I don't think we should continuously rebuild, this scan already drastically drops performance in large files.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions