Git Product home page Git Product logo

Comments (10)

Arcanemagus avatar Arcanemagus commented on June 15, 2024

If you open Developer Tools and place a breakpoint here, is it ever hit? If not what does running Editor: Log Cursor Scope from the command palette show?

If you do hit that breakpoint, place another one here and see what output contains.

from linter-clojure.

jefffriesen avatar jefffriesen commented on June 15, 2024

Thanks for the debugging tips.

I've tried it in a few different scenarios:

Brand-new lein project.

I put a console.log here and I get this when I have an obvious error, such as (+ 1 2))):

output:  Exception in thread "main" java.lang.RuntimeException: Unmatched delimiter: ), compiling:(/Users/jeffers/git/learning/clojure-class/myapp3/src/myapp3/core.clj:12:9)
    at clojure.lang.Compiler.load(Compiler.java:7234)
    at clojure.lang.Compiler.loadFile(Compiler.java:7165)

Overall the above scenario is working. I get a linter error when I put in an obvious error. But it only shows errors after saving, even though I set it to show while typing with a 300ms delay (in the settings of the mail linter package). linter-eslint follows these settings and shows errors while typing. Not a big deal, but FYI.

Compile error:

This is a trickier problem. When I have a problem with a project that has a compile error:

output:  Exception in thread "main" java.io.FileNotFoundException: Could not locate guestbook/layout__init.class or guestbook/layout.clj on classpath., compiling:(/Users/jeffers/git/learning/clojure-class/guestbook/src/clj/guestbook/routes/home.clj:1:1)
    at clojure.lang.Compiler.load(Compiler.java:7239)
    at clojure.lang.Compiler.loadFile(Compiler.java:7165)...

The app still renders in the browser, I get no warnings through the terminal (using lein run) and I don't see this error in the repl. But the linter internally gets the error and silently fails (unless I console.log output). Once it's fails it doesn't lint errors anymore. A couple thoughts:

  1. Does it make sense to expose the compile errors, especially inline at the source of the problem in the file?
  2. Does it make sense to keep linting anyway even with errors?

Thanks for looking into this

from linter-clojure.

Arcanemagus avatar Arcanemagus commented on June 15, 2024

Just filed #34, this linter isn't currently setup to run on the fly linting, even though it claims to be to linter.

And exposing errors like that is exactly what this should be doing, @trevershick care to take a look at why that isn't showing up here?

from linter-clojure.

 avatar commented on June 15, 2024

If you open Developer Tools and place a breakpoint here, is it ever hit?

Yes

If you do hit that breakpoint, place another one here and see what output contains.

"Exception in thread "main" java.io.FileNotFoundException: Could not locate compojure/core__init.class or compojure/core.clj on classpath., compiling:(/home/.../my_web/handler.clj:1:1)
 at clojure.lang.Compiler.load(Compiler.java:7239)
 at clojure.lang.Compiler.loadFile(Compiler.java:7165)
 at clojure.main$load_script.invoke(main.clj:275)
 at clojure.main$init_opt.invoke(main.clj:280)
 at clojure.main$initialize.invoke(main.clj:308)
 at clojure.main$null_opt.invoke(main.clj:343)
 at clojure.main$main.doInvoke(main.clj:421)
 at clojure.lang.RestFn.invoke(RestFn.java:421)
 at clojure.lang.Var.invoke(Var.java:383)
 at clojure.lang.AFn.applyToHelper(AFn.java:156)
 at clojure.lang.Var.applyTo(Var.java:700)
 at clojure.main.main(main.java:37)
Caused by: java.io.FileNotFoundException: Could not locate compojure/core__init.class or compojure/core.clj on classpath.
 at clojure.lang.RT.load(RT.java:449)
 at clojure.lang.RT.load(RT.java:412)
 at clojure.core$load$fn__5448.invoke(core.clj:5866)
 at clojure.core$load.doInvoke(core.clj:5865)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
 at clojure.core$load_one.invoke(core.clj:5671)
 at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
 at clojure.core$load_lib.doInvoke(core.clj:5710)
 at clojure.lang.RestFn.applyTo(RestFn.java:142)
 at clojure.core$apply.invoke(core.clj:632)
 at clojure.core$load_libs.doInvoke(core.clj:5749)
 at clojure.lang.RestFn.applyTo(RestFn.java:137)
 at clojure.core$apply.invoke(core.clj:632)
 at clojure.core$require.doInvoke(core.clj:5832)
 at clojure.lang.RestFn.invoke(RestFn.java:551)
 at my_web.handler$eval3$loading__5340__auto____4.invoke(handler.clj:1)
 at my_web.handler$eval3.invoke(handler.clj:1)
 at clojure.lang.Compiler.eval(Compiler.java:6782)
 at clojure.lang.Compiler.eval(Compiler.java:6771)
 at clojure.lang.Compiler.load(Compiler.java:7227)
 ... 11 more"

I am using Leiningen and it can build my project.

from linter-clojure.

 avatar commented on June 15, 2024

Same with ClojureScript code:

"Exception in thread "main" java.io.FileNotFoundException: Could not locate reagent/core__init.class or reagent/core.clj on classpath., compiling:(/home/.../mwe/core.cljs:1:1)
 at clojure.lang.Compiler.load(Compiler.java:7239)
 at clojure.lang.Compiler.loadFile(Compiler.java:7165)
 at clojure.main$load_script.invoke(main.clj:275)
 at clojure.main$init_opt.invoke(main.clj:280)
 at clojure.main$initialize.invoke(main.clj:308)
 at clojure.main$null_opt.invoke(main.clj:343)
 at clojure.main$main.doInvoke(main.clj:421)
 at clojure.lang.RestFn.invoke(RestFn.java:421)
 at clojure.lang.Var.invoke(Var.java:383)
 at clojure.lang.AFn.applyToHelper(AFn.java:156)
 at clojure.lang.Var.applyTo(Var.java:700)
 at clojure.main.main(main.java:37)
Caused by: java.io.FileNotFoundException: Could not locate reagent/core__init.class or reagent/core.clj on classpath.
 at clojure.lang.RT.load(RT.java:449)
 at clojure.lang.RT.load(RT.java:412)
 at clojure.core$load$fn__5448.invoke(core.clj:5866)
 at clojure.core$load.doInvoke(core.clj:5865)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
 at clojure.core$load_one.invoke(core.clj:5671)
 at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
 at clojure.core$load_lib.doInvoke(core.clj:5710)
 at clojure.lang.RestFn.applyTo(RestFn.java:142)
 at clojure.core$apply.invoke(core.clj:632)
 at clojure.core$load_libs.doInvoke(core.clj:5749)
 at clojure.lang.RestFn.applyTo(RestFn.java:137)
 at clojure.core$apply.invoke(core.clj:632)
 at clojure.core$require.doInvoke(core.clj:5832)
 at clojure.lang.RestFn.invoke(RestFn.java:421)
 at mwe.core$eval3$loading__5340__auto____4.invoke(core.cljs:1)
 at mwe.core$eval3.invoke(core.cljs:1)
 at clojure.lang.Compiler.eval(Compiler.java:6782)
 at clojure.lang.Compiler.eval(Compiler.java:6771)
 at clojure.lang.Compiler.load(Compiler.java:7227)
 ... 11 more"

Fun fact: Reagent is a ClojureScript library, as opposed to a Clojure library, and thus neither reagent/core__init.class nor reagent/core.clj are expected to exist.

trevershick was unassigned by urzds 7 minutes ago

This was not intentional.

from linter-clojure.

Arcanemagus avatar Arcanemagus commented on June 15, 2024

Huh, I'm not sure how you were even able to do that, I thought assigning people required permissions on the repo...

In any case, those errors look to be coming from clojure, not this package. Does it work for you from the CLI?

from linter-clojure.

 avatar commented on June 15, 2024

In any case, those errors look to be coming from clojure, not this package. Does it work for you from the CLI?

I can run my project from the CLI using Leiningen, yes.

My guess is that:

  1. The Clojure vs. ClojureScript detection could be somehow broken, hence leading to the search for reagent/core__init.class.
  2. The classpath might not be setup according to the Leiningen project.clj, hence leading to linter-clojure's Clojure being unable to find compojure/core__init.class.

from linter-clojure.

Arcanemagus avatar Arcanemagus commented on June 15, 2024

Unfortunately this project has no active maintainer and I personally have no experience with Clojure so I can't really help much further here as I'm out of ideas 😕

from linter-clojure.

Arcanemagus avatar Arcanemagus commented on June 15, 2024

Since there were a few different things reported in this thread, some of them have been fixed, and the majority of them are fixed in an upcoming PR, I'm marking this as a duplicate of the issue that was just talking about the unfixed problem in here.

from linter-clojure.

Arcanemagus avatar Arcanemagus commented on June 15, 2024

Duplicate of #51

from linter-clojure.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.