Fork me on GitHub

I'm trying to figure out which way to fix a bug introduced here: introduce-let at the bottom of a file will wrap the whole file in a let binding. My idea is to only skip-whitespace z/up when we're not at edit/top? . The problem is that it breaks the from trailing comment test in introduce-let-test Is it ok if this test produced nil? If not, these tests are all pretty inconsistent as it stands, feels weird that a trailing comment is "part of" the previous form depending on if the cursor is touching it or if something comes after it. Any ideas?:

(h/code "(inc a)|" ";; comment")
(h/code "(inc a)" "|;; comment")
(h/code "(inc a)" "|;; comment" "")
(h/code "(inc a)" "|;; comment" "x")
cc @jacob.maine


@U0BUV7XSA it’s fine to return nil in that case. Those tests were all added when we changed the parser to return a comment or whitespace node if that’s what the cursor was on. There were lots of refactorings that threw errors if they were invoked on a comment at the end of a file, and the fix was usually to move to some valid node before continuing with the refactoring. I wasn’t always sure whether the exceptions had always been there or if they were from the parser change, but in any case, I fixed as many as I could find. It wasn’t too important to me what was returned in those locations, just that there weren’t any exceptions. So, those tests were added at that time to prevent regressions. There are other scenarios where I think it does make sense to move up before introducing a let, if you’re on whitespace or comment. There should be tests for those cases. But I agree, it obviously doesn’t make sense if you’re already at the top.

👍 1

Since lately (roundabout 3 weeks) I was not able anymore to use go to definition anymore when the definition is in a different namespace. lsp logs "No location found". I am using Neovim and was using latest release of clojure-lsp, today I tried with the latest build on CI. It was working and then stopped working after I updated nvim-plugins and clojure-lsp. Anyone has an idea where to search for the problem? Anyone ever seen this behaviour?


Is the different namespace in a library or in your same project source?


same project source. but it does not jump to library as well


Are you perchance using coc-clojure?


no, using nvim-lspconfig


it was leiningen-projects that had these problems. now trying a deps-project and it does not even send the event. :thinking_face:


Ah, well, okay, not sure. I don't use nvm-lspconfig


I'm using coc


I have the feeling that it is a classpath problem but not sure why. it works on one machine...same setup but this one it does not


so it seems just to be very slow in analyzing classpath. now 10 minutes in into a new project and it just logged 36 percent analyzed


maybe that's a thing....wait now it finished...


ok, it works fine in the deps-project but not in the leiningen-project... :thinking_face:


oh no...found it... leiningen was printing Warning: profile :profiles/dev not found. to stdout before printing the classpath facepalm


maybe it would be good to give a more concise message when the classpath can not be parsed?


seeing same problem in another repo though 😢 there the classpath is properly printed to stdout


Clojure-lsp already prints to editor when classpath is not found properly


What prints to you?


I saw it throwing when pedantic was a problem. can't see anything on the borked project


it does load the project it seems though


ok, will do that otherwise I'll open an issue


Funny development shot 🧵


Ops, I accidentally made clojure-lsp print as word art 😂

❤️ 1
😂 1
🆒 1

Looks cooler, I think I'll keep this way 😛

Noah Bogart00:03:51

I love it. How did this happen?


a wrong apply 😅

(defn my-print [msg]
  (apply println msg))

(my-print "foo")
f o o
=> nil


since a string is still a coll of chars


println receives multiple chars as separated args

Noah Bogart12:03:34

Oooh yeah haha nice