-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement cider-nrepl info #30
Comments
Can you post some example of input + output? I have no idea what to implement without any docs. |
Yeah, I've reverse engineered this myself when implementing this. 😄 This is what Calva sends when I ask for info on {
"op": "info",
"ns": "ring-server.core",
"symbol": "re-matches",
"id": "1290",
"session": "03a1fd4b-3ebc-42d7-a073-3bb5df0e858c"
} This is what I get back: {
"added": "1.0",
"arglists-str": "[re s]",
"column": 1,
"doc": "Returns the match, if any, of string to pattern, using\n java.util.regex.Matcher.matches(). Uses re-groups to return the\n groups.",
"file": "jar:file:/Users/pez/.m2/repository/org/clojure/clojure/1.10.0/clojure-1.10.0.jar!/clojure/core.clj",
"id": "1286",
"line": 4886,
"name": "re-matches",
"ns": "clojure.core",
"resource": "clojure/core.clj",
"see-also": [
"clojure.core/re-find",
"clojure.core/subs",
"clojure.core/re-groups",
"clojure.core/re-pattern"
],
"session": "03a1fd4b-3ebc-42d7-a073-3bb5df0e858c",
"static": "true",
"status": [
"done"
]
} Please let me know if I can provide some more/better info on this. |
Here's another example. Evaluating this form: (defprotocol P
(foo [x])
(bar-me [x] [x y])) And then asking Calva to get me info about {
"op": "info",
"ns": "ring-server.core",
"symbol": "bar-me",
"id": "1296",
"session": "03a1fd4b-3ebc-42d7-a073-3bb5df0e858c"
}
{
"arglists-str": "[x]\n[x y]",
"file": "file:/Users/pez/Projects/tests/ring-server/src/ring_server/core.clj",
"id": "1297",
"line": 13,
"name": "bar-me",
"ns": "ring-server.core",
"protocol": "#'ring-server.core/P",
"session": "03a1fd4b-3ebc-42d7-a073-3bb5df0e858c",
"status": [
"done"
]
} |
Adds handling of :lookup and :info operations, so that IDEs can offer function parameters and documentation strings of functions.
Calva relies heavily on the
info
op. It's how it looks up docs and implements peek at definition and jump to definition, and generally provides info about symbols.Here's the cider-nrepl implementation: https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/info.clj
Not sure where to find documentation on this op...
The text was updated successfully, but these errors were encountered: