{"action":"created","issue":{"url":"https://api.github.com/repos/gtrak/cljs-tooling/issues/20","labels_url":"https://api.github.com/repos/gtrak/cljs-tooling/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/gtrak/cljs-tooling/issues/20/comments","events_url":"https://api.github.com/repos/gtrak/cljs-tooling/issues/20/events","html_url":"https://github.com/gtrak/cljs-tooling/pull/20","id":99928257,"number":20,"title":"Filter foreign protocols from completion candidates","user":{"login":"cichli","id":1759291,"avatar_url":"https://avatars.githubusercontent.com/u/1759291?v=3","gravatar_id":"","url":"https://api.github.com/users/cichli","html_url":"https://github.com/cichli","followers_url":"https://api.github.com/users/cichli/followers","following_url":"https://api.github.com/users/cichli/following{/other_user}","gists_url":"https://api.github.com/users/cichli/gists{/gist_id}","starred_url":"https://api.github.com/users/cichli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cichli/subscriptions","organizations_url":"https://api.github.com/users/cichli/orgs","repos_url":"https://api.github.com/users/cichli/repos","events_url":"https://api.github.com/users/cichli/events{/privacy}","received_events_url":"https://api.github.com/users/cichli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-09T20:51:13Z","updated_at":"2015-08-31T17:20:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/gtrak/cljs-tooling/pulls/20","html_url":"https://github.com/gtrak/cljs-tooling/pull/20","diff_url":"https://github.com/gtrak/cljs-tooling/pull/20.diff","patch_url":"https://github.com/gtrak/cljs-tooling/pull/20.patch"},"body":"If you have these two namespaces:\r\n\r\n```clojure\r\n(ns test-ns)\r\n\r\n(defrecord TestRecord [a b c])\r\n\r\n(defprotocol TestProtocol\r\n  (test-method [_]))  \r\n```\r\n\r\n```clojure\r\n(ns test-ns-2\r\n  (:require [test-ns :as t :refer [TestProtocol]]))\r\n\r\n(extend-protocol TestProtocol\r\n  t/TestRecord\r\n  (test-method [_]))\r\n```\r\n\r\nThen `test-ns-2/TestProtocol` is returned as a completion candidate, which causes `var-candidates` to throw an exception - the (rather large) stacktrace is unfortunately printed to the REPL every time the complete op is called if the completion prefix is `test-ns-2`. `format-var` also throws when calling the info op on the candidate.\r\n\r\nThe root cause is possibly a bug in the cljs analyzer - the protocol has an entry in `:defs` in the _extending_ namespace with incomplete metadata, but only when it's referred directly - we should still filter it regardless of if this changes in a future version of cljs."},"comment":{"url":"https://api.github.com/repos/gtrak/cljs-tooling/issues/comments/136433821","html_url":"https://github.com/gtrak/cljs-tooling/pull/20#issuecomment-136433821","issue_url":"https://api.github.com/repos/gtrak/cljs-tooling/issues/20","id":136433821,"user":{"login":"bbatsov","id":103882,"avatar_url":"https://avatars.githubusercontent.com/u/103882?v=3","gravatar_id":"","url":"https://api.github.com/users/bbatsov","html_url":"https://github.com/bbatsov","followers_url":"https://api.github.com/users/bbatsov/followers","following_url":"https://api.github.com/users/bbatsov/following{/other_user}","gists_url":"https://api.github.com/users/bbatsov/gists{/gist_id}","starred_url":"https://api.github.com/users/bbatsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbatsov/subscriptions","organizations_url":"https://api.github.com/users/bbatsov/orgs","repos_url":"https://api.github.com/users/bbatsov/repos","events_url":"https://api.github.com/users/bbatsov/events{/privacy}","received_events_url":"https://api.github.com/users/bbatsov/received_events","type":"User","site_admin":false},"created_at":"2015-08-31T17:20:38Z","updated_at":"2015-08-31T17:20:38Z","body":"@gtrak Maybe we should move the project to `clojure-emacs` so more people can be involved with its maintenance?"}}