This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-13
Channels
- # announcements (14)
- # babashka (13)
- # beginners (25)
- # biff (7)
- # calva (36)
- # clj-kondo (22)
- # clojure (31)
- # clojure-austin (1)
- # clojure-europe (12)
- # clojure-losangeles (4)
- # clojure-nl (1)
- # clojure-norway (61)
- # clojure-uk (4)
- # clojurescript (3)
- # datomic (24)
- # events (1)
- # humbleui (9)
- # leiningen (9)
- # lsp (30)
- # malli (3)
- # missionary (15)
- # off-topic (5)
- # re-frame (4)
- # reitit (7)
- # releases (2)
- # remote-jobs (4)
- # rewrite-clj (11)
- # ring-swagger (2)
- # sci (6)
- # xtdb (2)
- # yamlscript (3)
Is there a way to have a project that is targeted at babashka and get the lsp etc to use the bb.edn rather than expecting either a deps.edn or a project.clj
VS Code just made āsticky scrollingā on by default, which is sort of cool (or maybe annoying, Iām still deciding), but it makes me wonder how I can get reg-event-fx
to be considered part of the outline so it will participate in sticky scrolling?
Maybe @UKFSJSM38 is the best person to help with this.
Thereās a demo GIF that the VS Code team made here: https://code.visualstudio.com/updates/v1_70#_editor-sticky-scroll
if var definitions or namespaces are already sticking, probably they are using the result of the textDocument/documentSymbols from LSP which is a clever idea
so we would need just to add keyword definitions there which is a issue opened recently on clojure-lsp, but would be nice to confirm my first question
It works on Clojure code. There are three options for what it should use for determining what should stick. Which may be a setting for you to experiment with @UTFAPNRPT.
I have experimented with the options. Iāll describe what Iām seeing, even though you may have already experimented and already know this. By default (outlineModel) the same items that show up in the outline are the same items that are āstickyā when scrolling. Specifically: ns
forms act like an āouter wrapperā and are always stuck to the top (which Iām still not sure if I like that or not); then defn
and def
forms are also sticky right underneath the ns
form, but they replace each other as you scroll. That is, you only ever have one defn
or def
stuck right below ns
.
If I switch to folding or identation, then many more things start to become āstickyā, and Iām not even sure the distinction between the two, but basically anything that VS Code recognizes as a foldable or collapsible range, the same items where VS Code gives you a disclosure chevron in the left gutter, those all now become sticky. In these two modes, reg-event-fx becomes sticky, but so does a lot of other stuff. Too much, in my opinion.
Hence my original question how I could get reg-event-fx to be recognized in the outline, and then it will automatically become sticky.
Thanks, @UTFAPNRPT. I havenāt experimented much with this. I disabled it after a few days, because it got too confusing to me. It would take me a lot of time to get used to that the lines in visible part of the buffer are from somewhere else in the file. The confusion remained after some days, and remained worse than the benefit I drew from the feature. š
You have a good point, @U0ETXRFEW. I just noticed it for the first time today (sometimes I am slow to update VS Code), but after updating I certainly did notice it right away, it was obvious that something was definitely different. Iām still trying to decide if I like it or not.
Iāll keep kicking the tires on it for a few days. Iām not sure how often I get ālostā within a single file. Weāll see.
If my function takes up more than a screen height, I rather need to fix that than get help with finding my way around in it. š
However, I now sound like I discourage others from using the feature. I have no opinion on what other do! Just reported on my own results from testing it out.
Keeping functions small is definitely common in Clojure. But Iāve noticed an exception with clojurescript and hiccup. Conceptually the function is small but expressing it in hiccup takes a lot of space.
Bringing the opposing opinion, I love and use this feature. Especially going from js/ts to clj.
If the solution to this involves registering reframe keywords as symbols that would be a dream.
If then, that would make Go To Definition somehow work (better) for reframe subs/fx/event-fx's I could cry haha. Using kondo to treat them as def*
doesn't seem to work very well.
Anyways, I'll clarify that I specifically want the stickiness for the reframe stuff
would be nice to check if any of these 3 providers use LSP, if yes we can support it indeed
The outline model is provided by clojure-lsp, @UKFSJSM38.
Please, so we can know for sure where to change and open an issue in clojure-lsp to support that
I canāt see anything in the Calva code regarding this. The clojure-lsp trace when starting the server looks like so:
[Trace - 1:22:08 PM] Sending request 'initialize - (0)'.
[Trace - 1:22:09 PM] Received response 'initialize - (0)' in 148ms.
[Trace - 1:22:09 PM] Sending notification 'initialized'.
[Trace - 1:22:09 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 1:22:09 PM] Sending request 'clojure/serverInfo/raw - (1)'.
[Trace - 1:22:09 PM] Sending notification 'textDocument/didOpen'.
[Trace - 1:22:09 PM] Sending notification 'workspace/didChangeConfiguration'.
[Trace - 1:22:09 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 1:22:09 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 1:22:09 PM] Received request 'client/registerCapability - (1)'.
[Trace - 1:22:09 PM] Sending response 'client/registerCapability - (1)'. Processing request took 1ms
[Trace - 1:22:09 PM] Sending request 'textDocument/documentSymbol - (2)'.
[Trace - 1:22:09 PM] Sending request 'textDocument/documentSymbol - (3)'.
[Trace - 1:22:09 PM] Received response 'clojure/serverInfo/raw - (1)' in 3ms.
[Trace - 1:22:09 PM] Received response 'textDocument/documentSymbol - (2)' in 8ms.
[Trace - 1:22:09 PM] Received response 'textDocument/documentSymbol - (3)' in 9ms.
[Trace - 1:22:09 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 1:22:09 PM] Sending request 'textDocument/semanticTokens/full - (4)'.
[Trace - 1:22:09 PM] Sending request 'textDocument/semanticTokens/full - (5)'.
[Trace - 1:22:09 PM] Received response 'textDocument/semanticTokens/full - (5)' in 0ms.
[Trace - 1:22:09 PM] Received response 'textDocument/semanticTokens/full - (4)' in 2ms.
And with that I see the outline in the file explorer pane. Nothing is sent to clojure-lsp when I interact with the outline.