Giter VIP home page Giter VIP logo

autocomplete's People

Contributors

abe33 avatar benogle avatar jonrohan avatar kevinnathan avatar kevinsawicki avatar maxbrunsfeld avatar mcolyer avatar mnquintana avatar mutle avatar peterdavehello avatar probablycorey-and-nathan avatar probablykevin avatar steveluscher avatar thedaniel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autocomplete's Issues

Undo breaks if autocomplete gets activated

I'm not sure if this is a bug with atom core or this package, basically when I undo in the editor, if the undo activates the autocomplete, e.g.

div
undo
di

It triggers autocomplete for div, which is fine, but then it causes the cursor to disappear / the editor window to become inactive, and you have to click inside the editor again to be able to carry on undoing.

Sort results based on case of completed text

I start typing "status" lowercase:
screen shot 2013-11-25 at 2 15 53 pm

But the first result shown to me is uppercase.
screen shot 2013-11-25 at 2 15 59 pm

I would expect if I type "status" things matching "status" lowercase will match before "Status" uppercase. I find the majority of the time case matching is important and it always seems to choose the wrong case first.

Issue with history transactions and autocomplete

I am having this issue when running autocomplete and vim-mode together. It autocompletes but also joins the next line and removes a few characters.

autocompletebug

Steps to reproduce:

  • make sure you have vim-mode installed
  • open autocomplete/spec/fixtures/sample.js
  • move to the end of the first line in insert mode
  • press enter
  • type "quick"
  • press ctrl-space.

The issue is happening because autocomplete is not committing the current transaction in AutocompleteView.attach so when it runs editor.abortTransaction in AutocompleteView.cancel, it aborts autocomplete's transaction + the previous vim-mode transaction.

A way to take care of this is to commit any existing transaction in AutocompleteView.attach:

  attach: ->
    @editor.commitTransaction() if @editor.getBuffer().history.isTransacting()
    @editor.beginTransaction()

This issue affects vim-mode and any package that could potentially have an unfinished transaction before AutocompleteView.attach is executed.

Autocomplete allows CTRL-Z (undo) in textbox

From @GameplayJDK on January 16, 2015 19:54

The autocomplete feature allows CTRL-Z (undo) shortcut in it's textbox.. I don't know if that's how it's supposed to be...

bug3

Example (html): When I typed body once and pressed enter, the next time I enter something, I can use CTRL-Z to revert the content of the little textbox to body again.

Copied from original issue: atom/atom#5115

Loss of focus

when I bring up the code completion box and start typing , it feels like I have loosed focus from the code at which I am editing. It could jut be a perception thing, but it is distracting. hopefully this makes sense.

Uncaught Error: Cannot create a checkpoint inside of a transaction

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.176.0
System: Mac OS X 10.10.1
Thrown From: autocomplete package, v0.43.0

Stack Trace

Uncaught Error: Cannot create a checkpoint inside of a transaction

At /Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js:174

Error: Cannot create a checkpoint inside of a transaction
  at History.module.exports.History.createCheckpoint (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js:174:15)
  at TextBuffer.module.exports.TextBuffer.createCheckpoint (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:710:27)
  at TextEditor.module.exports.TextEditor.createCheckpoint (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1197:26)
  at AutocompleteView.module.exports.AutocompleteView.attach (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/lib/autocomplete-view.js:182:37)
  at AutocompleteView.module.exports.AutocompleteView.toggle (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/lib/autocomplete-view.js:215:21)
  at atom-text-editor.deactivationDisposables.add.atom.commands.add.autocomplete:toggle (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/lib/autocomplete.js:48:70)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
  at /Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:558:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:396:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:170:20)

Commands

     -0:22.0 core:backspace (atom-text-editor.editor.vim-mode.insert-mode)
     -0:20.4 core:move-down (input.hidden-input)
     -0:19.8 core:move-up (atom-text-editor.editor.vim-mode.insert-mode)
     -0:19.3 editor:select-to-first-character-of-line (atom-text-editor.editor.vim-mode.insert-mode)
     -0:18.9 core:delete (atom-text-editor.editor.vim-mode.insert-mode)
     -0:17.4 core:close (atom-text-editor.editor.vim-mode.insert-mode)
     -0:16.6 fuzzy-finder:toggle-file-finder (atom-workspace.workspace.scrollbars-visible-always.theme-atom-dark-syntax.theme-atom-dark-ui)
     -0:15.7 core:confirm (atom-text-editor.editor.mini)
     -0:12.3 vim-mode:reset-command-mode (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
 12x -0:11.1 vim-mode:move-down (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:09.3 vim-mode:move-up (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:08.6 vim-mode:activate-insert-mode (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
  5x -0:06.6 core:backspace (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
  2x -0:03.3 core:move-down (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:01.8 core:backspace (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:00.7 autocomplete:toggle (atom-text-editor.editor.vim-mode.is-focused.insert-mode)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ]
  }
}

Installed Packages

# User
atom-grails, v0.1.0
autocomplete-plus, v2.0.1
file-icons, v1.4.8
language-groovy, v0.3.0
travis-ci-status, v0.11.2
vim-mode, v0.30.0

# Dev
No dev packages

/cc @atom/core

Feature request: Pneumonic matching a la ST3

In Sublime Text, you can autocomplete by an in-order pneumonic or any sequence of characters. For example, I can type gln<tab> and have getLastName as a possible completion. I am addicted to this and consider it a killer feature of ST. Would love to see it available in this package for atom.

We might be leaking autocomplete mini editors

Atom was getting slow and I found what seemed like too many editors that I traced back to autocomplete code. I'm not sure I totally trust heap profiler anymore so I'm going to investigate further.

Less intrusive autocomplete

Would it be possible to get a less intrusive autocomplete, something more like TextMate's where you press escape to cycle through alternatives.

When I code I almost always know what I want to autocomplete to, I just don't want to type it. Having to select from a list makes me slower, not faster.

At the same time, I know that many like autocomplete with a list and are used to that from other editors, so I'm just asking for a way to run the autocomplete in a less UI-driven manner. If there were actions for autocomplete with next suggestion I could hook up the keymappings myself, but as far as I can tell it's not currently possible, at least I didn't manage to autocomplete without showing the alternatives panel.

Just STEAL IT FROM brackets

As of now, brackets has (in my opinion) better autocomplete than atom. It's fast, unobtrusive, lightweight, and it seems to be using the syntax file for the language being edited to compile the list of completions which to me is as important as including symbols from the file being edited.

Here is a screenshot of brackets editing in a less file (would be the same in a comparable css file):

image

In use, it feels right and like it is helping me. Autocomplete in atom so far feels clumsy and like it is getting in my way.

null is entered when calling on a space

atom 0.94.0

  • Open a new blank editor
  • Press control+space

the literal null is entered. Pressing the key combo again brings up the autocomplete box saying no matches as expected. The initial null entering is not expected.

Doesn't work with valid unicode characters in variables

I don't want to discuss, whether unicode characters in varnames are good or bad. They work. And they should be respected by autocomplete.

Currently this doesn't work:

var gründe = 'foo';
alert(g// if I press ctrl+space here, if suggests only "gr", not "gründe"

Autocomplete only works on last selection if multiple insertion points are active

Platform: Ubuntu GNOME 14.04, 64-bit

Basic steps to repro

  1. Create multiple insertion points (e.g. ctrl-click)
  2. Attempt to tab-complete a word
  3. Only the last insertion point made will have the snippet, and that snippet will not overwrite the prefix of that last occurence.

Expected behavior

All insertion points will autocomplete with the word, as would normally happen with a single insertion point. Different words aren't necessecarily expected to autocomplete.

Observed behavior

(vertical bar == insertion point)

Known word: MyClass

MyC|
MyC|
MyC|

Expands to:

MyC
MyC
MyCMyClass|

I don't expect this specific case to work:

Known words: foobar, barfoo

foo|
bar|

Expands to:

foobar|
barfoo|

I use the multiple insertion point feature somewhat extensively, given it's very high usefulness when refactoring masses of code quickly.

Add file path autocompletion.

I write a lot of js code with require statements in them. We have files all over the place, and it's hard to remember where everything is. It would be great if I could autocomplete file paths (relative to the current file). What would it take to implement something like this?

For reference, neocomplete in vim does a great job of this: https://github.com/Shougo/neocomplete.vim

Comment Tags

Make it so that when you open a comment, e.g /** make it auto-complete it.

e.g

    /**
     * 
     *
     *
     */

This type of stuff is very useful in IDE's like Eclipse, Netbeans, etc.
Another suggest would be once this feature is implement allow the user to choose to add stuff like,
@author
@Date <date this file was commented/made
@Version
@see
etc.

Uncaught TypeError: undefined is not a function

[Enter steps to reproduce below:]

  1. Cmd+Shift+P
  2. enter 'autocomplete'
  3. select "autocomplete next"
    python code

Atom Version: 0.176.0
System: Mac OS X 10.10.1
Thrown From: autocomplete package, v0.43.0

Stack Trace

Uncaught TypeError: undefined is not a function

At /Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/lib/autocomplete.js:42

TypeError: undefined is not a function
  at /Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/lib/autocomplete.js:42:68
  at atom-text-editor.deactivationDisposables.add.atom.commands.add.autocomplete:next (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/lib/autocomplete.js:53:29)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
  at /Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61
  at CommandPaletteView.module.exports.CommandPaletteView.confirmed (/Applications/Atom.app/Contents/Resources/app/node_modules/command-palette/lib/command-palette-view.js:120:32)
  at CommandPaletteView.module.exports.SelectListView.confirmSelection (/Applications/Atom.app/Contents/Resources/app/node_modules/archive-view/node_modules/atom-space-pen-views/lib/select-list-view.js:335:21)
  at space-pen-div.atom.commands.add.core:confirm (/Applications/Atom.app/Contents/Resources/app/node_modules/archive-view/node_modules/atom-space-pen-views/lib/select-list-view.js:109:19)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
  at /Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:558:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:396:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:170:20)

Commands

     -2:56.2 editor:consolidate-selections (atom-text-editor.editor.mini)
     -2:56.2 core:cancel (atom-text-editor.editor.mini)
     -2:38.7 command-palette:toggle (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -2:36.4 core:confirm (atom-text-editor.editor.mini)
     -2:36.4 window:install-shell-commands (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -0:50.4 command-palette:toggle (atom-text-editor.editor.is-focused)
     -0:46.6 core:confirm (atom-text-editor.editor.mini)
     -0:46.6 autocomplete:toggle (atom-text-editor.editor.is-focused)
  2x -0:44.9 editor:consolidate-selections (atom-text-editor.editor.mini)
     -0:44.9 core:cancel (atom-text-editor.editor.mini)
 19x -0:39.7 core:backspace (atom-text-editor.editor.is-focused)
     -0:08.7 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -0:08.7 core:cancel (atom-text-editor.editor.is-focused)
     -0:07.3 command-palette:toggle (atom-text-editor.editor.is-focused)
     -0:00.6 core:confirm (atom-text-editor.editor.mini)
     -0:00.6 autocomplete:next (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "base16-tomorrow-dark-theme"
    ]
  }
}

Installed Packages

# User
linter-python-pep8, v0.2.0
linter-python-pyflakes, v0.1.0

# Dev
No dev packages

/cc @atom/core

Uncaught Error: Can't undo with an open transaction

Uncaught Error: Can't undo with an open transaction

Atom Version: 0.158.0
System: Mac OS X 10.10.1
Thrown From: autocomplete package, v0.34.0

Steps To Reproduce

  1. Just pressed Ctrl + Space to autocomplete a variable name (in Elixir), it displayed this error and didn't autocomplete. It's not happening consistently.

Stack Trace

At /Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js:73

Error: Can't undo with an open transaction
  at History.module.exports.History.undo (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js:73:15)
  at History.module.exports.History.revertToCheckpoint (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js:185:16)
  at TextBuffer.module.exports.TextBuffer.revertToCheckpoint (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:710:27)
  at TextEditor.module.exports.TextEditor.revertToCheckpoint (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1166:26)
  at AutocompleteView.module.exports.AutocompleteView.cancelled (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/lib/autocomplete-view.js:172:21)
  at AutocompleteView.module.exports.SelectListView.cancel (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/node_modules/atom-space-pen-views/lib/select-list-view.js:260:14)
  at atom-text-editor.<anonymous> (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/node_modules/atom-space-pen-views/lib/select-list-view.js:76:26)
  at atom-text-editor.jQuery.event.dispatch (/Users/ricardopinto/.atom/packages/build/node_modules/space-pen/vendor/jquery.js:4676:9)
  at atom-text-editor.elemData.handle (/Users/ricardopinto/.atom/packages/build/node_modules/space-pen/vendor/jquery.js:4360:46)
  at atom-text-editor.jQuery.event.special.focus.trigger (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4842:11)
  at Object.jQuery.event.trigger (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4565:60)
  at atom-text-editor.<anonymous> (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5124:17)
  at Function.jQuery.extend.each (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:590:23)
  at TextEditorView.jQuery.fn.jQuery.each (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:237:17)
  at TextEditorView.jQuery.fn.extend.trigger (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5123:15)
  at TextEditorView.jQuery.fn.trigger (/Applications/Atom.app/Contents/Resources/app/src/space-pen-extensions.js:56:28)
  at TextEditorView.jQuery.fn.(anonymous function) [as focus] (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:6733:9)
  at AutocompleteView.module.exports.AutocompleteView.cancel (/Users/ricardopinto/.atom/packages/autocomplete-plus-async/lib/autocomplete-view.coffee:143:19)
  at AutocompleteView.cancel (/Users/ricardopinto/.atom/packages/autocomplete-plus-async/lib/autocomplete-view.coffee:1:1)
  at AutocompleteView.module.exports.AutocompleteView.onChanged (/Users/ricardopinto/.atom/packages/autocomplete-plus-async/lib/autocomplete-view.coffee:226:8)
  at /Users/ricardopinto/.atom/packages/autocomplete-plus-async/lib/autocomplete-view.coffee:1:1
  at TextBuffer.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/emissary/lib/emitter.js:118:15)
  at TextBuffer.module.exports.TextBuffer.applyPatch (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:591:12)
  at TextBuffer.module.exports.TextBuffer.setTextInRange (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:503:12)
  at TextBuffer.module.exports.TextBuffer.delete (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:600:19)
  at Selection.module.exports.Selection.deleteSelectedText (/Applications/Atom.app/Contents/Resources/app/src/selection.js:556:37)
  at /Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/lib/autocomplete-view.js:258:23
  at Array.forEach (native)
  at /Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/lib/autocomplete-view.js:254:22
  at History.module.exports.History.transact (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js:112:18)
  at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:683:27)
  at TextEditor.module.exports.TextEditor.transact (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1146:26)
  at AutocompleteView.module.exports.AutocompleteView.replaceSelectedTextWithMatch (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/lib/autocomplete-view.js:250:26)
  at AutocompleteView.module.exports.AutocompleteView.selectItemView (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/lib/autocomplete-view.js:93:21)
  at AutocompleteView.module.exports.SelectListView.populateList (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/node_modules/atom-space-pen-views/lib/select-list-view.js:207:21)
  at AutocompleteView.module.exports.AutocompleteView.populateList (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/lib/autocomplete-view.js:329:54)
  at /Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/node_modules/atom-space-pen-views/lib/select-list-view.js:347:26

/cc @atom/core

Error raised on tab close

Started with v0.101.0, whenever I close a tab, the autosave package raise an exception. The autosave option is disabled.

Uncaught TypeError: Object #<PaneView> has no method 'getModel' autosave.coffee:9
(anonymous function) autosave.coffee:9
jQuery.event.dispatch /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4676
elemData.handle /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4360
jQuery.event.trigger /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4594
jQuery.event.simulate /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4893
handler /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:5009
jQuery.fn.extend.remove /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:5501
module.exports.EditorView.remove editor-view.coffee:805
module.exports.PaneView.onItemRemoved pane-view.coffee:170
(anonymous function) pane-view.coffee:1
(anonymous function) /Users/cedric/github/atom/node_modules/emissary/lib/emitter.js:133
module.exports.Emitter.emit /Users/cedric/github/atom/node_modules/emissary/lib/emitter.js:132
module.exports.Pane.removeItem pane.coffee:173
module.exports.Pane.destroyItem pane.coffee:200
module.exports.Pane.destroyActiveItem pane.coffee:191
module.exports.Workspace.destroyActivePaneItem workspace.coffee:268
_results.push._this.(anonymous function) /Users/cedric/github/atom/node_modules/delegato/lib/delegator.js:67
(anonymous function) workspace-view.coffee:157
jQuery.event.dispatch /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4676
elemData.handle /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4360
module.exports.KeymapManager.dispatchCommandEvent /Users/cedric/github/atom/node_modules/atom-keymap/lib/keymap-manager.js:395
module.exports.KeymapManager.handleKeyboardEvent /Users/cedric/github/atom/node_modules/atom-keymap/lib/keymap-manager.js:176
(anonymous function) window-event-handler.coffee:61
jQuery.event.dispatch /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4676
elemData.handle /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4360

It does not prevent the tab from being closed but just pop the console out.

When there are no matches

If you type something in, and there are no autocomplete matches, pressing enter makes what you've typed in disappear. It might be quite nice if what you've typed gets put in even if there are no matches.

For instance, sometimes I use autocomplete just to see if a variable name exists already, and if it doesn't then I use that name, but pressing enter makes what I've typed vanish, and then I have to type the name in again, which is a waste of time.

Word RegExp fails to match valid words and closes dialog

Whenever I use autocomplete in CSS mode, any time I type the hyphen in a CSS property name, the whole dialog disappears. So if I type in font, it shows all of the CSS properties starting with font but as soon as I type the - after font to find things like font-family, font-size, etc., the dialog disappears. I checked the developer tools and there were no errors.

This is my first bug/feature request for Atom.io so if I missed something in the guidelines, let me know. I did search to see if anyone had reported this and didn't see anything. Also, if I can provide more details or help with the fix, let me know.

Feature Request: ignore words in comments

Autocomplete words that are previously typed in comments it's not very useful :)

e.g.

/**
  * this is a comment
  */

if I type "co" and autocomplete, it should no propose "comment" (make this configurable would be great!)

Proactive autocomplete

I love this! Amazing! Whats stopping me from switching from sublime is I've alway's loved sublime's proactive autocomplete ( I don't have to press anything and it shows me my autocomplete options) I press enter and it picks the top autocomplete option. If atom/autocomplete could do that... I'm a switching!

Live autocomplete without interfering with snippets

Would love to have something similar to Sublime, where the autocomplete would be automatically shown while typing. Theres a plugin that does that but sadly it completely breaks the snippets and emmet features.

I believe the "official" plugin should have something like this built-in.

Show suggestions from n-th character

It would be great if we could set the autocompleter to make suggestions only after you type n-th letters of a word. E.g. from 3rd character, fu wouldn't trigger autocomplete, while fun would.

This is useful when you have 1-2 letter snippets, and both autocomplete and snippets are triggered/ confirmed via tab key (I know you can map custom keys, but it's useful to use just one).

Map 'tab' to core:confirm inside mini editor

Behavior expected

The 'tab' key should confirm a selection in the autocomplete view.

Behavior observed

The 'tab' key does not confirm a selection and instead inserts a tab in the text while the autocomplete view is open.

Other editors implementing this behavior

IntelliJ, Eclipse, probably others? I don't usually use autocomplete in vim, so I can't say for sure if it's valid there.

I was going to make a pull request for this, but since it's just a single line I decided it wasn't worth the trouble of forking. However, I modified my local Atom and it works as it should.

the keymap of "autocomplete:toggle"

In my country , the Keystroke of "ctrl-space" is always regarded as the operation of switchover input method. So I think that using "ctrl-alt" or "alt-enter" as default just like the eclipse ,will be better. Thanks.

Ability to make autocomplete case sensitive

Perhaps this feature request already exists, but I can't find it.

I'd love if it possible to change my autocomplete to become case sensitive. Probably something that's pref'ed off by default.

When I type "Fo" and there is "foobar" and "Foodmixer" in the buffer I only want it to autocomplete suggest "Foodmixer".

Error binding to escape

In waiting for #7 i'm trying to bind the autocomplete popup to escape for easier access, it works but when pressing escape again the console pops up with this error

Uncaught NotFoundError: An attempt was made to reference a Node in a context where it does not exist. /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5825
jQuery.extend.buildFragment /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5825
jQuery.fn.extend.domManip /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5631
jQuery.fn.extend.append /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5453
jQuery.fn.(anonymous function) /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/lib/space-pen.js:336
module.exports.EditorView.appendToLinesView /Applications/Atom.app/Contents/Resources/app/src/editor-view.js:1455
module.exports.AutocompleteView.attach /Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/lib/autocomplete-view.js:187
(anonymous function) /Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete/lib/autocomplete-view.js:65
jQuery.event.dispatch /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4676
elemData.handle /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4360
jQuery.event.trigger /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4594
(anonymous function) /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5119
jQuery.extend.each /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:590
jQuery.fn.jQuery.each /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:237
jQuery.fn.extend.trigger /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:5118
module.exports.Keymap.triggerCommandEvent /Applications/Atom.app/Contents/Resources/app/src/keymap.js:267
module.exports.Keymap.handleKeyEvent /Applications/Atom.app/Contents/Resources/app/src/keymap.js:249
(anonymous function) /Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:93
jQuery.event.dispatch /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4676
elemData.handle /Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4360

Unexpected autocompleting in C++ code

Atom on Windows 8.1

Simply open a new C++ file and start typing #include <iostream and when you'll write the > character, Atom will autocomplete this.

I think this absolutely isn't feature, it's a bug.

Focus lost when using autocomplete

Pressing control+space brings popup with substitution options with following focus lost in current tab. This triggers autosave plugin which is unwanted in most situations.
It would be great to configure somehow communication between plugins and prevent this.

Atom 0.125.0
Autocomplete 0.31.0
Autosave 0.15.0

Document how this package is designed to be used.

If the package is still so much in flux that it doesn't make sense to document the API right now, then just say so. It's understandable and unambiguous.

Currently, I'm looking at https://github.com/yasuyuky/autocomplete-clang/blob/master/lib/autocomplete-clang-view.coffee as an example of how to subclass AutocompleteView, and it seems like that subclass is doing a lot more than it should (e.g., adding all sorts of listeners to @editorView that I would expect to come "for free"). It would be helpful to see what a "proper" use of this package is. Ideally, a minimal one.

Similarly, there is no inline documentation in the code about which methods are designed to be overridden and which should be treated as final.

Type past suggestions box & remove extra input box.

piggy backing off of #11, basically lets just simplify autocomplete. So lets say you have the suggestions: "a", "ab", and "abc". If you type abcd it should auto close the suggestions box and keep going. Additionally lets get rid of the extra input box. Like this:

better

your input box would just be the regular buffer.

Or do you guys think that this behavior is too different and should be some kind of sub class of autocomplete?

Autocomplete adds spurious undo entries to history

To reproduce:

  • type prefix (e.g. sandw)
  • ctrl-space, select completion (e.g. sandwich)
  • cmd-z, see entire word removed
  • cmd-z again, see the original prefix reappear (sandw)
  • cmd-z a third time, see nothing change
  • cmd-z a fourth time, see prefix disappear

The behavior is the same whether there is only one completion or there are multiple completions and the select list appears.

Add An API For Package Authors To Augment Autocomplete List

This is somewhat of a tangent to #10, which requests an API to trigger autocomplete functionality.

The language-go package could potentially integrate with gocode to provide autocomplete suggestions (feature request here: atom/language-go#2).

It would be nice if the following were true:

  • The package provides a mechanism for other packages to require an autocomplete API or otherwise get access to it (autocomplete = require('atom').autocomplete?)
  • The package emits events that can be bound on (autocomplete.on 'trigger', => @askGocodeForSuggestions?)
  • The package provides a mechanism for an external package to augment and/or order the autocomplete suggestions provided by default (autocomplete.on 'display', (suggestions) => @injectSuggestions suggestions?)

Feature request: Context-aware hints

One of my favourite features in all IDE's from JetBrains is it's hinting and auto-completion. I call it context-aware hinting.

When you're writing HTML and you're about to add a class to an element, it lists all known classnames defined anywhere else in your project. In PHP, when you've created an instance of class X and want to call a function, it lists all known methods of just that class. It looks at where your cursor is, identifies the syntax before it and lists only relevant information.

PHPStorm
Atom

PHP classes seem to work OK, could be improved a little. However, I'd like to see this extended over other languages as well like the HTML-CSS example I mentioned.

So, can we have this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.