LSP support & at-point functions
info-at-point type-at-point goto-definition
These would be accessible by external tools via command line flags to support these features in editors, etc
The brute force solution is to just walk the whole environment and find the form that has a matching file info.
What about using LSP?
I have an LSP implementation in the back of my mind as a possible project, but it's certainly much bigger than what's implied here.
Looks like starting wouldn't be too hard:
https://github.com/alanz/lsp/blob/master/example/Simple.hs
Sure, that sounds like an even better idea!
Can we use that for flycheck (currently supported via --check) too, then?
I think so. AFAIK flycheck integrates with LSP.
@eriksvedang LSP is well supported in Emacs at this point - I use it for Go, Python and Rust very happily. Flycheck works perfectly.
Awesome, I'm VERY excited about this approach then!
Re @jacereda 's linked Haskel code - as a general question, but wouldn't it be good to implement this in Carp rather than Haskel? The more tooling is in a language other than Carp, the bigger barrier there is to people working on it (in many cases, it requires learning two languages instead of one).
That is true, but considering that the Carp compiler is written in Haskell, hooking into it (which might be required) will probably be simpler from within Haskell.
@hellerve I guess that leads to a bigger topic - a self-hosted compiler, but that's a whole different ball game ;-)
AFAIK LSP is quite messy, piggybacking into whatever that project has to offer can be a great timesaver.
@eriksvedang LSP is well supported in Emacs at this point - I use it for Go, Python and Rust very happily. Flycheck works perfectly.
emacs 29 now has lsp built in
That is great news!