Idea for a code action: copy symbol with namespace
(ns my.app)
(defn f [x] 3)
Place cursor on f, run "copy symbol with namespace", then my.app/f is on the clipboard.
Not sure if this is possible from inside an LSP process, perhaps somebody can correct me if it won't work?
Use case: "I'm looking at a symbol and want to discuss the code with other people"it's possible from java process, not sure if graalvm supports it, even so looks like a quite specific code action
This seems like a thing that any editor could support without lsp, copy the current token to the clipboard...
True!
I think no editor will know/have a logic that copying f will result in copying
oh right
now I understand your question, my bad
I use the repl for this (symbol #'f)
yeah, that's something more suitable for REPL
could also shell out to pbcopy for the clipboard part or build a variant of cider-eval that copies the result to the clipboard (or just copy the normal eval output 🙃 )
I mean, it's something clojure-lsp/kondo could easily do, but it's the copy/paste thing that is gnarly in the JVM ;)
or just hand-write the symbol... ;)
or use the sharp quote. Nice thing about the var is autocompletion and errors on typos though
I think that's something that the editor should handle. You could easily write an Emacs command that runs (symbol (var ,,,)) on the current form and put it on the kill ring / native clipboard
maybe there's an LSP command to return the fully qualified symbol?