This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-07
Channels
- # announcements (38)
- # asami (14)
- # beginners (35)
- # biff (3)
- # calva (29)
- # cider (20)
- # clj-kondo (7)
- # cljdoc (38)
- # clojure (64)
- # clojure-art (2)
- # clojure-australia (1)
- # clojure-dev (6)
- # clojure-europe (30)
- # clojure-nl (4)
- # clojure-spec (4)
- # clojure-uk (9)
- # clojured (3)
- # clojurescript (87)
- # cursive (17)
- # datahike (2)
- # datomic (10)
- # defnpodcast (2)
- # emacs (2)
- # events (1)
- # fulcro (25)
- # gratitude (1)
- # introduce-yourself (1)
- # jobs-discuss (21)
- # lsp (103)
- # malli (41)
- # meander (8)
- # minecraft (3)
- # missionary (3)
- # nextjournal (20)
- # off-topic (10)
- # pedestal (1)
- # polylith (15)
- # portal (6)
- # releases (2)
- # ring (1)
- # ring-swagger (2)
- # sci (4)
- # shadow-cljs (5)
- # spacemacs (3)
- # sql (11)
- # xtdb (3)
I have updated my kondo config.edn. Does anyone know how I get Calva to re-lint all the code in my project?
@mac probably re-opening your project. in emacs you can do lsp-workspace-restart, but don't know how that's done in vscode without closing it
@borkdude Hm, I must have made a mistake in my config then.
{:linters
{:unresolved-symbol
{:exclude [(meander.epsilon/search)
(meander.epsilon/$)]}}}
but I still get unresolved symbol
for all logic vars inside the call to meander.epsilon/$
@mac Make a command line repro please, it's easier to exclude editor issues that way
This is the code.
(defn expr-by-type-and-concerns-interval [contract type interval]
(me/search
contract
(me/$
{:type (me/pred #(= % type))
:id ?id
:concerns-interval (me/pred #(intervals-equal? % interval))
:as ?goal-expr})
(assoc ?goal-expr :key ?id)))
(ns example
(:require
[meander.epsilon :as me]))
(defn intervals-equal?
[{start1 :start end1 :end} {start2 :start end2 :end}]
(and (= start1 start2) (= end1 end2)))
using [meander/epsilon "0.0.588"]
I see no errors with:
(ns example
{:clj-kondo/config '{:linters
{:unresolved-symbol
{:exclude [(meander.epsilon/search)
(meander.epsilon/$)]}}}}
(:require
[meander.epsilon :as me]))
(defn intervals-equal?
[{start1 :start end1 :end} {start2 :start end2 :end}]
(and (= start1 start2) (= end1 end2)))
(defn expr-by-type-and-concerns-interval [contract type interval]
(me/search
contract
(me/$
{:type (me/pred #(= % type))
:id ?id
:concerns-interval (me/pred #(intervals-equal? % interval))
:as ?goal-expr})
(assoc ?goal-expr :key ?id)))
Also see:
$ clj-kondo --lint dude.clj
dude.clj:14:10: error: Unresolved symbol: ?id
dude.clj:16:10: error: Unresolved symbol: ?goal-expr
vs
$ clj-kondo --lint dude.clj --config '{:linters
{:unresolved-symbol
{:exclude [(meander.epsilon/search)
(meander.epsilon/$)]}}}'
linting took 13ms, errors: 0, warnings: 0
I would in doubt just restart your VSCode and re-open in. Also make sure your .clj-kondo directory is in the root of your project
I still get the errors. It is a cljs file, would that make a difference?
sudo clj-kondo --lint reporting.cljs --config '{:linters
{:unresolved-symbol
{:exclude [(meander.epsilon/search)
(meander.epsilon/$)]}}}'
reporting.cljs:25:5: warning: Unresolved var: me/$
reporting.cljs:26:18: warning: Unresolved var: me/pred
linting took 37ms, errors: 0, warnings: 2
You can probably fix this with
{:lint-as {meander.epsilon/defsyntax clojure.core/defn}
:linters {...}}
It would be best if meander exported this clj-kondo config so other users can immediately profit from this. cc @U06MDAPTP
If you aren't interested in clj-kondo resolving vars from other namespaces (so you get a warning when you use a non-existing one), then you can also disable the unresolved-var linter
The new vscode release has a new https://code.visualstudio.com/updates/v1_64#_new-side-panel. Not sure how hard it is to put stuff in there, but we might think about displaying the repl inside that instead of the split view.
This is a weak part of VS Code, I think. They have all sorts of different types of panes and containers that need special support to be able to move around. It would be so much easier for them, for extension authors and for users if there was a generic model for panes and the user could host anything, anywhere. Theia has this, so it is not like it isn't possible with a maintained VS Code experience. Yes, I know this is not the right place to complain about this, I'm just venting some frustration. 😃
Yeah, I know what you mean. There are a lot of annoying restrictions in vscode for no reason. E.g. you can resize autocompletion tooltips, but not hovers?