lsp

wcohen 2025-06-21T09:48:30.350639Z

Hi all — I’ve got a macro that blows through a big edn map and defns a bunch of things based on what’s in there. None of those new functions — while they ARE in the namespace, they are not showing up in calva via LSP. (I’m sorry if this is answered above, I couldn’t find a good answer.) Is this a limitation of LSP or is this something silly I should be flagging internally somehow? Here’s one of the fns that the macro makes — it evals and even has a docstring.

clj꞉net.willcohen.proj.proj꞉> (proj-get-codes-from-database {:auth_name "EPSG"})
["10150" "10151" "10156" "10157" "10158" "10160" ... ]
clj꞉net.willcohen.proj.proj꞉> (meta #'proj-get-codes-from-database)
{:arglists ([] [opts]), :doc "Calls the native `proj_get_codes_from_database` function.\n\nOptions:\n- `:context` (`pointer`): PROJ context. If not provided, a new one is created.\n- `:auth_name` (`string`): Argument.\n- `:type` (`int32`): Argument. (Default: `8`)\n- `:allow_deprecated` (`int32`): Argument. (Default: `1`)\n\nReturns a string-list object.", ... :name proj-get-codes-from-database, :ns #object[clojure.lang.Namespace 0xedac3c "net.willcohen.proj.proj"]}
clj꞉net.willcohen.proj.proj꞉> 

exitsandman 2025-06-21T09:52:11.362779Z

Look into creating a clj-kondo hook. If all you care about is telling the linter that you defined the symbols, you can start with a macroexpand hook that declares them; if you want to also lint the outputs you might need to port the whole logic over.

wcohen 2025-06-21T09:57:02.119689Z

Amazing. Thank you very much!

wcohen 2025-07-08T14:16:45.680759Z

Follow-up to this. I’ve got a macro that defns things based on a key in an EDN map, another macro that runs that across all the keys in that edn map, and hooks that create analyze paths to make the defns for the first macro and run the do defns in the second macro. They show up as popups in the clj file itself, but the evaluated NS repl doesn’t autocomplete anything in calva. Does LSP handle resolving the repl functions differently than in the file itself? I’m trying to figure out if this is an LSP issue or a Calva issue.

ericdallo 2025-07-08T18:05:41.837469Z

The LSP has nothing related to repl, so it's based on what is on the files

wcohen 2025-07-08T19:35:47.814589Z

Lovely. Thank you!