Fork me on GitHub
Mateusz Mazurczak13:01:32

Hi, I use clj-kondo with cursive (clojure-extras). Clj-kondo highlights <! function as an error "Unresolved symbol <!".


Can you give more context?

Mateusz Mazurczak13:01:34

Whole clojure.core.async library functions are highlighted as unresolved


ok, let me check how they are defined

Mateusz Mazurczak13:01:58

example: (buffer 5) clj-kondo: Unresolved symbol: buffer


but how are you importing them


I need a complete reproduction file to be able to reproduce it locally


Are you using :refer :all perhaps?

Mateusz Mazurczak13:01:01

Ah yeah, sorry

(ns app.home2.panel
  (:require [app.state.core :as state]
            [app.state.panel :as panel]
            [ :as search-podcast]
            [ :as audio-upload]
            [app.view.util :as utils]
            [app.getting-started.wizard :as wizard]
            [app.util :as u]
            [app.util.string :as util-string]
            [cljs-http.client :as http]
            [clojure.string :as str]
            [app.view.colors :as c]
            [ :as home-help])
  (:require-macros [cljs.core.async.macros :refer [go]]))

(defn find-rss-url
  "If the user has provided a website link instead of a RSS feed URL,
   the server tries to find a link to the RSS feed in the website."
    (let [response (<! (http/request
                         {:request-method :post
                          :url "/podcast-import/find-rss-url"
                          :transit-params {:url url}}))]
          (get-in response


Don't you need to :refer [<!] as well?

☝️ 1
Mateusz Mazurczak16:01:58

Code works without the reference, but this helps with the highlighting error. Thank you very much


I have no idea why it works without the refer, but you're supposed to do it like this :)

👍 1
Mateusz Mazurczak18:01:20

One more thing in cljs, about js/window.location.hash Some functions from js are not higlighted. (js is not required in any way). But the window.location is highlighted as "cannot be resolved"

Mateusz Mazurczak18:01:33

example: (js/console "smth") <- it's fine (set! js/window.location.hash ..) js/window.location.hash cannot be resolved


@U0281QDFE1X does it say "clj-kondo" in that message? otherwise it might be coming from Cursive.


I don't think clj-kondo has a problem with this:

$ clj-kondo --lint - --lang cljs <<< '(set! js/window.location.hash "foo")'
linting took 15ms, errors: 0, warnings: 0

Mateusz Mazurczak18:01:30

Oh right, sorry, it is not clj-kondo

Mateusz Mazurczak18:01:35

Thank you very much for your help


you can disable the cursive linting separately I think