This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (6)
- # architecture (2)
- # babashka (30)
- # beginners (90)
- # calva (21)
- # cider (22)
- # clj-kondo (27)
- # cljs-dev (7)
- # clojure (132)
- # clojure-europe (51)
- # clojure-nl (12)
- # clojure-norway (3)
- # clojure-spec (3)
- # clojure-uk (5)
- # clojurescript (69)
- # cloverage (9)
- # conjure (5)
- # core-async (54)
- # cursive (14)
- # datomic (34)
- # emacs (7)
- # fulcro (10)
- # graalvm (40)
- # graalvm-mobile (2)
- # gratitude (2)
- # improve-getting-started (1)
- # introduce-yourself (1)
- # jobs-discuss (61)
- # leiningen (5)
- # malli (6)
- # off-topic (59)
- # pathom (11)
- # polylith (38)
- # reagent (3)
- # reitit (3)
- # rewrite-clj (3)
- # shadow-cljs (53)
- # tools-build (35)
- # transit (8)
- # vim (62)
- # web-security (26)
- # xtdb (4)
@james.amberger I have some useful mappings for Conjure and CoC here
May be useful. Take what you like, reject what you don't 🙂
Hey all - I just switched from CoC to nvim-lsp/cmp/treesitter. I’m using the recommended cmp treesitter plugin - https://github.com/sogaiu/tree-sitter-clojure - and the syntax highlight is terrible. Not even keys are highlighted for me, which is an absolute no go. Does anyone have any suggestions on configuring lsp/cmp/treesitter with clojure? Or alt tools they’d recommend that work with LSP for highlighting?
Hey, have you enabled syntax highlight for treesitter? https://github.com/lispyclouds/dotfiles/blob/main/nvim/lua/treesitter.lua#L15-L17 it needs to be enabled explicitly
my setup too is lsp/conjure/treesitter
right, does your colorscheme supports treesitter maybe?
I'd love to know if there is anything on treesitter that semantic tokens from LSP doesn't have?
i remember getting weird highlights when using a colorscheme that doesnt support treesitter
yeah, maybe vim doesn't play well if you enable both, it s worth to test both I think
I wonder if vim uses semantic-tokens, I've seen some strange highlights even after I want back to clojure.vim from treesitter
In some cases just forcing vim to reload file fixes them, so could just be vim not triggering update
I don't remember nvim-lspconfig mentioning anything about highlight
One benefit for neovim-treesitter over lsp would be that neovim can also use treesitter to indent code while you are writing. (Experimental feature) Lsp can format file or range but it needs to be called separately.
yeah, I think semantic tokens from lsp would be the best as it has static analysis and everything to know what each token is and color it properly
Neovim doesn't support Semantic tokens yet, there is a WIP PR: https://github.com/neovim/neovim/pull/15723
So eventaully got into the weeds and getting closer to a theme. However, my warnings for linting are coming up in green. Does anyone happen to know either where those warnings are coming from (lsp or treesitter) and how to colorize or highlight them? If I could highlight them I could figure out their highlihgt group 😂
Is there a consensus around here for Conjure over Fireplace? I’m pretty loyal to tpope (sure I’m not the only one)
To make choice even harder, I can say that I've used vim-iced over fireplace since 2020-01 and I like it a lot. I haven't tried to configure Conjure for my use ever so I can't comment on the differences.
Okay, cool. I’ve shaved enough yaks over the past week or so that I’ll chill with Fireplace for now.
I do have some questions about whether I am leveraging this repl/editor thing correctly
I will say that Conjure provides a great out-of-the-box experience, in my opinion. @U38J3881W has taken a lot of care to make it so that it "just works" with no configuration necessary. The only effort on the user's part is just reading through the help text and learning the key bindings, etc.
But are these packages roughly equivalent? so if I start a “new to repl-ing” thread here should it be fireplace-specific or, not?
When I switched from Fireplace, it didn't yet have async eval, which is now has.
Fireplace, Conjure, Iced, and Acid are all equivalent in that they provide REPL/editor integration. Besides that, there are big differences in the features that each provides.
The overall workflow is the same, though: you start an nREPL server, connect to it from your editor, type code into your editor (usually in a comment block) and eval the code to see the results without leaving your editor
so far, if I’m working on a function, I eval the definition and then call it with
cqc (fireplace command-line editor
but I’m sure I’m missing something, for example if I want to eval some subform in the function that contains a function parameter
I mean how would I go about providing argument and then evaluating a subform, and is that even a typical approach
And I'm pretty used to my way of working with REPL over 9 years so any plugin I choose will need bunch of configuration to fit my use and bindings. So I don't know about default vim-iced setup, and Conjure would need configuration just to fit what I'm used to 🙂
isn’t that the point of vim, to have things exactly the way you want them 🙂
There isn't much ways around evaling code from defn/let which requires some bindings. Just avoid needing to eval such code. I usually have the function call in a comment or somewhere instead of using comething similar to cqc.
oh yeah, that will work in a comment?
(comment (println "1")) yeah
cpp would eval the println depending a bit where your cursor is
ahh (comment) not
If you often need to eval only some part of fn or let, maybe it is good place to split it into a separate fn.
is it typical to define functions you’re pretty sure will only ever be called within one other function?
If I'm testing a function that I'm writing, I will sometimes
def an example value with the same name as the parameter. For example:
If I eval the form
(defn add-five [x] (+ x 5))
(+ x 5), it won't work because
xisn't defined. Most of the time, to test my function, I would just add this below:
And eval the
(comment (add-five 42))
(add-five 42)expression, which works. Sometimes, if it's a more complex function and I just want to test a sub-expression within the function body, I'll eval, like
(def x 42)and then I can eval
(+ x 5). It's not always a good idea to do this because you're messing with your global definitions, but it's a useful trick sometimes.
> is it typical to define functions you’re pretty sure will only ever be called within one other function? I think this is very subjective! It depends on who you ask.
I think more about if the function does something useful by itself, than if the fn is called from multiple places. If you have lots of context, separating a part into own fn might not be that clear as you need many parameters. You can also marks functions private so they aren't used from other namespaces accidentally, if they are "internal implementation".
IMO, it is a good idea to break up larger functions into smaller ones, even if the smaller function is only called in one place, because it can improve the clarity of your code.
Dave, I like it.
juhoteperi is that enforced or just conventional
In Clojure JVM side the private functions can't be called directly, compiler enforces that. They can still be accessed using clojure.test util fn or by accessing the fn through the var
(#'foo-ns/private-fn ...). In Cljs compiler will print warning, but the function will get called if you run the resulting JS.
@james.amberger if you want to explore that whole "evaluate expressions in a comment block" workflow they are referred to as "rich comments" in the community https://betweentwoparens.com/blog/rich-comment-blocks/#rich-comment
pretty amazing how quickly people pitch in on here
I held off because I don’t really have any other use for Slack, but
odds of actually using Clojure for something have definitely gone up