{"action":"closed","issue":{"url":"https://api.github.com/repos/commercialhaskell/intero/issues/267","repository_url":"https://api.github.com/repos/commercialhaskell/intero","labels_url":"https://api.github.com/repos/commercialhaskell/intero/issues/267/labels{/name}","comments_url":"https://api.github.com/repos/commercialhaskell/intero/issues/267/comments","events_url":"https://api.github.com/repos/commercialhaskell/intero/issues/267/events","html_url":"https://github.com/commercialhaskell/intero/issues/267","id":177779013,"number":267,"title":"Two completion methods invoked for one completion.","user":{"login":"tshinohara","id":64248,"avatar_url":"https://avatars.githubusercontent.com/u/64248?v=3","gravatar_id":"","url":"https://api.github.com/users/tshinohara","html_url":"https://github.com/tshinohara","followers_url":"https://api.github.com/users/tshinohara/followers","following_url":"https://api.github.com/users/tshinohara/following{/other_user}","gists_url":"https://api.github.com/users/tshinohara/gists{/gist_id}","starred_url":"https://api.github.com/users/tshinohara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tshinohara/subscriptions","organizations_url":"https://api.github.com/users/tshinohara/orgs","repos_url":"https://api.github.com/users/tshinohara/repos","events_url":"https://api.github.com/users/tshinohara/events{/privacy}","received_events_url":"https://api.github.com/users/tshinohara/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/commercialhaskell/intero/labels/priority:%20high","name":"priority: high","color":"b60205"},{"url":"https://api.github.com/repos/commercialhaskell/intero/labels/type:%20bug","name":"type: bug","color":"eb6420"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-19T13:04:14Z","updated_at":"2016-09-27T08:27:39Z","closed_at":"2016-09-27T08:27:39Z","body":"Recently completion stopped working so I was investing the debug log, and realized something weird.\r\nBoth `:complete-at` and `:complete repl` was called for one completion.\r\n\r\n    [Intero] -> :complete-at \"/tmp/intero13143WdZ.hs\" 6 12 6 16 \"putS\"\r\n    [Intero] -> :complete repl \"putS\"\r\n\r\nLooked into the code, I found a problem in `intero-company-callback` function.\r\n\r\n    (defun intero-company-callback (source-buffer prefix-info cont)\r\n      \"Generate completions for SOURCE-BUFFER based on PREFIX-INFO and call CONT on the results.\"\r\n      (cl-destructuring-bind\r\n          (beg end prefix type) prefix-info\r\n        (or (and (bound-and-true-p intero-mode)\r\n                 (cl-case type\r\n                   (haskell-completions-module-name-prefix\r\n                    (intero-get-repl-completions source-buffer (concat \"import \" prefix) cont))\r\n                   (haskell-completions-identifier-prefix\r\n                    (intero-get-completions source-buffer beg end cont)) ;; line A\r\n                   (haskell-completions-language-extension-prefix\r\n                    (intero-get-repl-completions\r\n                     source-buffer\r\n                     (concat \":set -X\" prefix)\r\n                     (-partial (lambda (cont results)\r\n                                 (funcall cont\r\n                                          (mapcar (lambda (x)\r\n                                                    (replace-regexp-in-string \"^-X\" \"\" x))\r\n                                                  results)))\r\n                               cont)))\r\n                   (haskell-completions-pragma-name-prefix\r\n                    (funcall cont\r\n                             (cl-remove-if-not\r\n                              (lambda (candidate)\r\n                                (string-match (concat \"^\" prefix) candidate))\r\n                              intero-pragmas)))))\r\n            (intero-get-repl-completions source-buffer prefix cont))))  ;; Line B\r\n\r\nBecause `intero-get-completions` returns nil, after Line A, Line B is also executed. `cont` for company mode is called twice, which I don't think is intentional.\r\n"}}
{"actor":{"display_login":"chrisdone"}}