{"action":"created","issue":{"url":"https://api.github.com/repos/tonini/alchemist.el/issues/181","labels_url":"https://api.github.com/repos/tonini/alchemist.el/issues/181/labels{/name}","comments_url":"https://api.github.com/repos/tonini/alchemist.el/issues/181/comments","events_url":"https://api.github.com/repos/tonini/alchemist.el/issues/181/events","html_url":"https://github.com/tonini/alchemist.el/issues/181","id":112662081,"number":181,"title":"Autocomplete takes precedence over `end` keyword","user":{"login":"lexmag","id":248290,"avatar_url":"https://avatars.githubusercontent.com/u/248290?v=3","gravatar_id":"","url":"https://api.github.com/users/lexmag","html_url":"https://github.com/lexmag","followers_url":"https://api.github.com/users/lexmag/followers","following_url":"https://api.github.com/users/lexmag/following{/other_user}","gists_url":"https://api.github.com/users/lexmag/gists{/gist_id}","starred_url":"https://api.github.com/users/lexmag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lexmag/subscriptions","organizations_url":"https://api.github.com/users/lexmag/orgs","repos_url":"https://api.github.com/users/lexmag/repos","events_url":"https://api.github.com/users/lexmag/events{/privacy}","received_events_url":"https://api.github.com/users/lexmag/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-21T19:28:52Z","updated_at":"2015-10-22T05:23:44Z","closed_at":null,"body":"As you see on the following screenshot it's natural to type \\<tab\\> in order to make indentation but currently it turns into autocompletion.\r\n\r\n<img width=\"184\" alt=\"screen shot 2015-10-21 at 21 21 30\" src=\"https://cloud.githubusercontent.com/assets/248290/10647645/d338612c-7839-11e5-94d0-690dd5b2e48d.png\">\r\n\r\nIt's getting really annoying as `cond`, `case`, `def`, etc. (pretty much everything) ends with `end`."},"comment":{"url":"https://api.github.com/repos/tonini/alchemist.el/issues/comments/150111536","html_url":"https://github.com/tonini/alchemist.el/issues/181#issuecomment-150111536","issue_url":"https://api.github.com/repos/tonini/alchemist.el/issues/181","id":150111536,"user":{"login":"tonini","id":55331,"avatar_url":"https://avatars.githubusercontent.com/u/55331?v=3","gravatar_id":"","url":"https://api.github.com/users/tonini","html_url":"https://github.com/tonini","followers_url":"https://api.github.com/users/tonini/followers","following_url":"https://api.github.com/users/tonini/following{/other_user}","gists_url":"https://api.github.com/users/tonini/gists{/gist_id}","starred_url":"https://api.github.com/users/tonini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonini/subscriptions","organizations_url":"https://api.github.com/users/tonini/orgs","repos_url":"https://api.github.com/users/tonini/repos","events_url":"https://api.github.com/users/tonini/events{/privacy}","received_events_url":"https://api.github.com/users/tonini/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T05:23:43Z","updated_at":"2015-10-22T05:23:43Z","body":"Hi @lexmag \r\n\r\nAlchemist use [company-mode](http://company-mode.github.io/) library to deliver the completion candidates to the `GUI`. The problem you're experienced about that things like `ends_with?` will always try to complete it's because your `company-idle-delay` time is set to `0.3` currently and after that time it tries to complete what it has available, in this case `ends_with?`.\r\n\r\nI don't like the autocompletion all the time so I increase the `company-idle-delay` time to about `3` and then use a custom keybinding to explicit call `company-complete` for get completion candidates.\r\n\r\nYou can bind it to `TAB` for example, there are some Emacs Lisp function example available which first try to indent in context of the current major mode and afterwards try to complete.\r\n\r\nHere you find an interesting discussion about how `TAB` should/could behave https://github.com/company-mode/company-mode/issues/94\r\n\r\nPS: I know that it would be nice if `elixir-mode` or `alchemist` could handle the context and don't try to complete on things like `do` or `end`, but for that you need a really clever parser which you don't write in just an evening. :)\r\n\r\nThere are discussions about creating an AST graph with the `alchemist-server` and get to the next level, but that things we look at it with version 2.0 "}}