New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClojureScript indentation goes wrong when you have Javascript interop #519
Comments
I'm not seeing this, I get: (let [a (.-body js/document)
])
As I would expect. Can you check your log for exceptions after reproducing this? |
Humm First, when I just open this project I'm getting this:
And actually this error keep repeating all the time... I tried create a new project ( [org.clojure/clojurescript "0.0-2322"] Then ran a REPL with Piggieback, for this I have on my profiles.clj:
(cemerick.piggieback/cljs-repl :repl-env (cemerick.austin/exec-env)) I think I reported this same exception before, I'm noticing this error is getting very frequent on every ClojureScript project that I have here (and I'm working in about 3 of then currently). Since those instabilities on ClojureScript are hitting me so often, I would like to ask if there may be any local cache that can be triggering it? Maybe something that I can cleanup to see if it gets better? |
I wasn't able to reproduce the indentation problem on a new project, so, here is my (defproject captioneer-editor "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0-alpha2"]
[org.clojure/clojurescript "0.0-2322"]
[org.clojure/core.async "0.1.338.0-5c5012-alpha"]]
:plugins [[lein-cljsbuild "1.0.3"]]
:source-paths ["src/clj" "src/cljs"]
:cljsbuild {
:builds {
:dev {
:source-paths ["src/cljs"]
:compiler {
:output-dir "resources/out"
:output-to "resources/compiled/main.js"
:optimizations :whitespace}}}}) |
Ok, I'll take a look at this, thanks. Is this project open source? Can I reproduce this locally? |
The project is not open source, but I sent it to you by email so you can try it. Using the same zip folder that I sent to you, these are the steps that I did to reproduce it here: 1 - drag the extracted project folder into IntelliJ To do the step 3, I have an external tool for leiningen cljs build configured here, you can find the configuration for that in the following screenshot: https://www.dropbox.com/s/u3lw9hu7bpmc0ky/Screenshot%202014-09-29%2019.58.23.png?dl=0 With that, an IDE error prompts here, and I get the same stack I posted here before. Hope with that you can reproduce it. Thanks. |
That's great, thanks Wilker! |
Another thing, using the zip I was also able to reproduce the initial described |
Hi
I was noticing some weirdness on my indentation while working here, and I could isolate the issue, and it seems to happen every time I have code that interop with Javascript variables.
First I wanna point a working example (no issue here):
(consider the ^ to be the cursor place):
(let [a b^])
Pressing return from that, gives me:
(let [a b ^])
But, now try to press return on this:
And you will get:
By that tiny example, I realized that once I put any JS interop into a block, all that top level indentation get's screwed (the return goes to wrong places).
Please let me know if you need any more information.
The text was updated successfully, but these errors were encountered: