This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-21
Channels
- # announcements (1)
- # beginners (20)
- # biff (5)
- # calva (43)
- # cider (5)
- # clj-commons (7)
- # clj-kondo (11)
- # clojure (58)
- # clojure-brasil (1)
- # clojure-denmark (1)
- # clojure-europe (27)
- # clojure-nl (1)
- # clojure-norway (13)
- # clojure-uk (2)
- # clojurescript (71)
- # data-science (32)
- # datalevin (6)
- # datomic (19)
- # emacs (1)
- # gratitude (3)
- # honeysql (8)
- # hoplon (15)
- # hyperfiddle (3)
- # introduce-yourself (1)
- # lsp (19)
- # malli (4)
- # nbb (7)
- # other-lisps (5)
- # practicalli (1)
- # re-frame (14)
- # releases (1)
- # ring-swagger (1)
- # squint (118)
- # xtdb (9)
- # yada (2)
funny situation: i type in (set/union a b)
and lsp suggests set/union
as i type, showing me the docstring. once the whole form is typed, it shows red squiggles because i've not required clojure.set :as set
. i use CodeAction to see the pop up that suggests add require '[clojure.set :as set]'
. However, until i press that, "show docs at cursor" won't show me the docs for set/union
, and "go to definition" doesn't work. if I change it to (clojure.set/union)
, it still doesn't go to definition or show the docs, while still showing me the docs as I type it in. Is this intended? Is there a way to get lsp to show me this stuff without having to require it first?
when you complete set/union it should automatically require the clojure.set, unless your editor doesn't support that capability
I'm using clojure-lsp for ClojureDart. Is it possible for LSP not to give "Unresolved symbol" for vars which are defined later in the file? The cljd dialect doesn't require a var be defined or declared before use.
would be tricky I guess to make clj-kondo do that, maybe @U04V15CAJ knows more, but can't you follow the clojure convention of declaring it before?
yes, this would be possible, but it's currently not there. feel free to post an issue
Thanks for the quick response guys, I will follow up with a repro. > can't you follow the clojure convention of declaring it before? It feels, I dunno, inelegant or something to let a tool dictate coding style contrary to the dialect.
It was unclear to me in the #C03A6GE8D32 discussion whether the "forgiven missing declare" is considered a feature or an unflagged error. (But, if we're harrumphing, then it seems inelegant for a dialect to desecrate a foundational principle of the original; perhaps we depend on the linter to help people write code that could be ported back to Clojure.)
> it seems inelegant for a dialect to desecrate a foundational principle of the original I don't disagree ;)
It might be that I'll change my mind once CLJD has a REPL, but as long as I'm working with https://github.com/Tensegritics/ClojureDart/blob/main/doc/differences.md#lazy-defs and tools (hot-reload and LSP) which can accomodate its goals, I'd like to fully explore the Dart-idiomatic way of doing things.
bit of a bikeshedding question: I've been repurposing the ^:deprecated
metadata to provide this helpful little safety reminder when I'm working at the design/get-it-working level. This is neovim/conjure/clojure-lsp.
Is the machinery for this accessible and generic enough that something like ^:stub
and a floating warning like "HEY DON'T FORGET TO FIX THIS` is straightforward?
There is a :discouraged-var
linter where you can set custom warnings about vars, but this doesn't use var metadata
I'm sure that's good for somewhere else. Right here I think I'm just looking for the code equivalent of a big fluorescent orange traffic cone and this works fine
If you're using git
and don't mind waiting to get yelled at till you go to commit, I've used https://jakemccrary.com/blog/2015/05/31/use-git-pre-commit-hooks-to-stop-unwanted-commits/ very successfully as a way of reminding myself to go back in and finish something