Looking at morphing https://github.com/Olical/background-check into a LSP server, probably renaming it tc-lsp or something like that too.
The issue I'm thinking about though is that I think typed.clojure needs to run in the JVM and classpath that your actual code you're checking is using. Is that correct?
So basically I can't run a standalone binary containing typed.clojure and statically check the source code, it runs within the JVM itself. So I would need to kind of start a LSP server inside your project with like clojure -M:typed.clojure-lsp then connect your editor to the LSP server through a socket or something. Does that sound about right, @ambrosebs?
Understood, thanks for confirming! Just wanted to make sure my understanding was right and it's sort of a "runtime" thing where the runtime is my development REPL. I'll build with that in mind so you can launch it from the CLI as a standalone thing or as part of your development REPL I think. Then the LSP configuration in your editor will look for a .typedclojure-lsp-port file or something and connect to that.
An interesting thing might fall out of this: LSP as a way to talk to your running REPL instead of nREPL for certain things. And I mean that in a generic sense, typedclojure just happens to be a great first use case. Maybe a more generic fork of this repo can be made some day to implement other features.
I'm curious to see where you end up. My first instinct is to connect to .nrepl-port and call it a day.
I don't know the LSP philosophy.
I've renamed it https://github.com/Olical/typedclojure-lsp - happy to change the name if you have any reservations. I'm proceeding down the "user runs it in their JVM, clients connect over TCP" path because I think that's the way it has to be.
ideally it just shares your project REPL
but if you're not connected to one, yeah you need to boot up a normal repl from your project