Skip to content

macroexpand-1 doesn't work on clojurescript #2099

Open
@jiacai2050

Description

@jiacai2050

Steps to reproduce the problem

(defproject om-tutorial "0.1.0-SNAPSHOT"
  :description "My first Om program!"
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [org.clojure/clojurescript "1.8.51"]
                 [org.omcljs/om "1.0.0-beta1"]
                 [com.cemerick/piggieback "0.2.1"]
                 [figwheel-sidecar "0.5.14"]]
  :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
  :clean-targets ^{:protect false} [:target-path "out" "resources/public/js"]
  :plugins [[lein-figwheel "0.5.14"]
            [lein-cljsbuild "1.1.7"]]
  :cljsbuild {:builds [{:id "dev"
                        :figwheel true
                        :source-paths ["src"]
                        :compiler {:main om-tutorial.core
                                   :asset-path "js"
                                   :output-to "resources/public/js/main.js"
                                   :output-dir "resources/public/js"
                                   :verbose true}}] })

With project.clj above, I was able to launch a figwheel repl.
In core.cljs, I have an om component defined like below

(defui HelloWorld
  Object
  (render [this]
          (dom/div nil (get (om/props this) :title))))

When I expand this macro using C-c RET, it didn't expand at all, in *cider-macroexpansion* buffer I got the same thing back, however, if I expand this manually, macroexpand did work.

(macroexpand-1 '(defui HelloWorld
                 Object
                 (render [this]
                         (dom/div nil (get (om/props this) :title)))))
;; this works as expected.

Is there anything I was missing?
Thanks in advance.

Environment & Version information

CIDER version information

;; CIDER 0.15.1 (London)
;; Clojure 1.8.0, java version "1.8.0_144"

Lein/Boot version

Leiningen 2.7.1 on Java 1.8.0_144 Java HotSpot(TM) 64-Bit Server VM

Emacs version

GNU Emacs 25.3.1 (x86_64-apple-darwin16.7.0) of 2017-09-12

Operating system

macOS Sierra 10.12.6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions