Fork me on GitHub
#emacs
<
2019-05-22
>
vemv20:05:26

I'm surprised by the Show documentation in a WebKit widget screenshot at the bottom https://github.com/emacs-lsp/lsp-ui I thought Webkit support was still experimental/fringe in Emacs? (or maybe I have bad memory and it only was on macOS)

dadair20:05:38

How does clojure-lsp play with CIDER? Are they complimentary?

vemv20:05:10

They might play well together (as in: not clash) but CIDER is so complete it's unlikely that c-lsp adds extra value c-lsp might be recommendable if you are big on LSP and pursue a simple / uniform setup and are willing to drop CIDER for that

dpsutton20:05:26

c-lsp adds a lot of functionality. i really like it

didibus21:05:23

c-lsp supports things that don't require a repl which is noce

vemv21:05:25

@U11BV7MTK which would be some nice examples?

dpsutton21:05:10

rename, find-references, go to location are all quite nice

dpsutton21:05:21

emacs has go to location but it requires active nrepl and file loaded

dpsutton21:05:33

there are other refactorings i haven't gotten setup yet in emacs but are nice in neovim

vemv21:05:24

I use clj-refactor (presumably a very usual choice between CIDER users) and I'm quite happy with it (plus I assume it will have superior accuracy) Personally the "no repl" argument is quite irrelevant to me, I don't work without a repl. It can lead to committing stuff one didn't even bother trying out. Plus spawning a repl is easy enough

bozhidar14:05:13

Well, you always have to be running some server (a REPL server or an LSP server). Obviously, I’m fond of the REPL approach, but some people might prefer the other one.

bozhidar14:05:07

If you’re using some very basic REPL (e.g. inf-clojure or another editor) probably c-lsp’s value proposition becomes way more appealing.

richiardiandrea19:05:56

I am going to write my dream here 🙂 A server is a server so it could answer to the nRepl protocol on a port and to LSP commands on another port

vemv19:05:10

😄 one also could think of a LSP server that "best-guesses" as its baseline smartness, but later if you fire up a repl, it will get CIDER-like smartness

didibus22:05:22

Not all server are made equal though

didibus22:05:18

An lsp server auto-sync with buffers, and its state can not be altered through a repl or in ad-hoc ways that don't match the source buffers.

👍 4
didibus22:05:01

And the best appeal to me, is that parsing for them is generally focused on being loose and heuristicall

didibus22:05:04

Wheres as if you leverage the Clojure compiler and runtime for parsing, it will be very strict, as it should. But that's a different goal to what you'd want your editor to do.

didibus22:05:04

Nothing specific to lsp. I mean, nRepl functionality could be designed with that in mind as well. But I'd argue at the very least, there should be one nRepl reserved to the editor, which is kept in perfect sync with the buffers automatically, and is relaxed in its parsing and used for auto-complete, refactors, go-tos, etc.

didibus22:05:05

And another one for repl usage. Where the user is free to manually control what gets loaded, and can run code directly in it. Etc.

didibus22:05:20

Not complaining, I love cider, nrepl and clj-refactor, but lsp has a simplicity to it which is appealing, and more of a it just works all the time. Where as normal nRepl requires more out of me, to make sure I'm in sync, I reloaded things properly, that I don't have any unbalanced parens, or syntax errors, etc.

richiardiandrea01:05:27

You are right state management is completely different, probably none is probably shared between the two. We might discover some neat thing by going through the exercise, very interesting..

bozhidar10:05:34

I don’t get how state management can be a server’s responsibility. Typically clients should decide what they want to sync. I think you actually meant to say that LSP actually operates on the raw source code of the project, otherwise it can’t really have meaningful AST for the entire project. That’s certainly a reasonable approach for finding usages/definitions/etc. There’s nothing preventing nREPL clients from auto-loading all project files on every change to those files, btw, but it’s generally a bad idea to evaluate unconditionally code that might have some side effects.

dpsutton12:05:21

another nice aspect of the static analysis is that it is instantly up for new projects. No messing with figuring out which profiles are needed, how to get nrepl up, possible clojurescript choices, it just starts analyzing symbols. Its quite nice.

bozhidar12:05:43

Well, you still need to setup the LSP server and clients, though.

bozhidar12:05:55

I think the only free lunch is something like ctags. 😉

bozhidar12:05:07

Anyways, I haven’t used LSP much, so perhaps this works better than I think it does.

didibus14:05:24

Lsp-mode currently starts the lsp server automatically mostly. But ya, there's still some setup required for the classpath.

didibus14:05:56

Using the repl for a lot of these features make sense, since static analysis is hard. That said, I think static analysis could be a nicer UX once it works. You'd still want a repl for all eval related tasks.

didibus14:05:51

The lsp server is just a good way to allow to not have to re-built that analyses in every editor

didibus14:05:44

That said, as an Emacs user, I'd also be happy with Emacs natively being able to analyze and perform these features just with Clojure mode 😋

richiardiandrea14:05:32

Ctags/ggtags is awesome I tried to use it but the built in parser is not that sophisticated