Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 10:48
    jimka2001 opened #467
  • 09:14
    bbatsov commented #2828
  • 09:14

    bbatsov on master

    Bind "L" to toggle locals durin… (compare)

  • 09:14
    bbatsov closed #2828
  • 09:09
    bbatsov commented #465
  • 09:08
    bbatsov closed #465
  • 09:08

    bbatsov on master

    [Fix #465] Fix breakage in cljr… (compare)

  • 09:08
    yuhan0 synchronize #2828
  • 09:07
    yuhan0 opened #2828
  • Apr 03 11:12
    carlduevel commented #465
  • Apr 02 15:37
    chanshunli opened #2827
  • Apr 02 10:20
    stale[bot] unlabeled #2754
  • Apr 02 10:20
    yuhan0 commented #2754
  • Apr 02 06:51
    stale[bot] labeled #2754
  • Apr 02 06:51
    stale[bot] commented #2754
  • Apr 01 23:38
    stale[bot] labeled #2724
  • Apr 01 23:38
    stale[bot] commented #2724
  • Apr 01 21:38
    stale[bot] closed #2766
  • Apr 01 21:38
    stale[bot] commented #2766
  • Apr 01 19:46
    BrunoBonacci commented #2580
Tim
@timofeytt
Hi everyone. I have a clj web project (chestnut app) that I'd like to work on. When I evaluate application.clj there is a main method that starts a web server. However, once I execute the whole buffer in CIDER, there is no local server started.
(defn -main [& _]
  (let [config (config)]
    (-> config
        app-system
        component/start)
    (println "Started chestnut-tutorial on" (str "http://localhost:" (:http-port config)))))
How is CIDER supposed to work with web servers?
To me this appears to be an important use-case that needs documentation.
Tim
@timofeytt
My main question is why is main method not evaluated? Now, I see that the standard procedure is to call (run) from cider-repl.
Neil Okamoto
@gonewest818
With C-c C-k that (defn -main ...) is evaluated but that’s not the same as evaluating -(main). Type (-main) at the repl and the webserver should start, is that right?
If you’re using component, however, you might want to look at this workflow instead. https://github.com/stuartsierra/component/blob/master/README.md#entry-points-for-development
Artur Malabarba
@Malabarba
@timofeytt You can run the main function with M-x cider-run, but that's not how you usually start servers with cider.
Well, actually, it's fine if your function is asyncronous
But if your function is synchronous I think it'll lock up the repl for you
A different way to do it (which I'm pretty sure is documented) is to add cider-nrepl to your project.clj. Then you can start your server normally and connect with M-x cider-connect
The command is pretty smart and should offer tab-completion for your server
Artur Malabarba
@Malabarba
As for your last question. Indeed, Cider doesn't take the liberty of calling functions for you after connecting. That's why there's a command for calling -main
Neil Okamoto
@gonewest818
a few messages ago I think @Malabarba meant to say "...addtools.nrepl to your project.clj"
Artur Malabarba
@Malabarba
Probably :-)
And I probably shouldn't give instructions off the top of my head about stuff I last worked on over a year ago 🙄
Tim
@timofeytt
@Malabarba Yes, it makes sense that it shouldn't automatically evaluate function definitions. You have basically described: 1) start a server and inject your REPL inside it. I see that the current chestnut project supports 2) starting REPL with project context and executing (run) or (go) to launch server. How do these things automagically work? Is it documented somewhere?
Tim
@timofeytt
I mean the function definition is evaluated, but not called as expected.
Lars Andersen
@expez
@timofeytt run and go is typically functions that are part of the 'reloaded workflow'
It goes with https://github.com/stuartsierra/component to manage starting and stopping the system/components
Anyway, you might have better luck in the #clojure channel on freenode or on slackchat, as this doesn't really have anything to do with emacs/cider
Artur Malabarba
@Malabarba
@timofeytt I've included links to the manual in my answer to your SO question
But I think I don't understand what you're asking now.
Tim
@timofeytt
@Malabarba I was wondering where (run) and (cljs-repl) are defined, but now that I've found it inside generated code of the project. It's simpler that I thought. Thank you.
P.S.: It's not my SO question.
Alexander Yakushev
@alexander-yakushev
Hey folks. CIDER used to render asynchronous errors from core.async in the nrepl-server buffer, now it doesn't. Am I missing something?
Alexander Yakushev
@alexander-yakushev
Sorry, my bad.
Adam Faraj
@adamfaraj
Anyone here?
feng lee
@87260280
@ShionAt 👍!
Lispre
@Lispre
happy new year, everyone
Dimitri Fedorov
@ai212983
i'm not sure if you're aware of this, but current build is broken. my spacemacs fails to download latest release from melpa
Shion
@ShionAt
Please allow me to show ShionKeys again
Alex Stokes
@ralexstokes
is there any way to have the buffer-overlay pretty-print?
Neil Okamoto
@gonewest818
No. You pretty-print to a popup, or insert a pretty-printed comment into the current buffer.
Alex Stokes
@ralexstokes
how would i do the latter?
Neil Okamoto
@gonewest818
cider-pprint-eval-last-sexp (C-c C-p) : Evaluate the form preceding point and pretty-print the result in a popup buffer. If invoked with a prefix argument, insert the result into the current buffer as a comment.
Alex Stokes
@ralexstokes
thanks!
Neil Okamoto
@gonewest818
In other words, with the prefix argument would be C-u C-c C-p
no problem!
Alexander Yakushev
@alexander-yakushev
Hey, can anyone help? I'm trying cider-test machinery for the first time, and cider-test-run-loaded-tests furiously opens all of my test files in Emacs. Can I prevent that?
Aleksander Sumowski
@aleksandersumowski
Hi everyone,
when I'm evaluating a piece of code from my project the resulting var gets put in the namespace where its defined. Is there any way to have it defined in the current repl namespace?
Aleksander Sumowski
@aleksandersumowski
I was looking for cider-send-last-sexp-to-repl
dtenny
@dtenny
Hi all. I recently upgraded cider after being a year or two stale in revision level (hey, it worked so well!). However the new emacs cider 0.16.0 revision has two problems for me. (1) Often the source code traversal is very slow when the nrepl is up. For example it can take seconds to start scrolling upward after jumping to end of file. (2) I thought perhaps things might be getter worse as my cider/repl session had been up for a while so was going to try to clear the whole cider buffer with C-c M-o, only the option to clear the buffer appears not to exist any more. Is there a way to do clear the whole cider buffer? I didn't find one after poking around for a bit.
Note that I'm talking about clojure source code traversal, not traversal of the nrepl buffer. I was only trying to clear that in case it was sucking computes as it has been known to do for large print representations and such.
dtenny
@dtenny
testing testing, is this thing on?
Neil Okamoto
@gonewest818
You may get more responses in the Clojurians Slack, specifically the #cider channel. I happen to be working on a feature to avoid long lines of output in the repl (which would eliminate the slowdown problem) but in all my testing I have never seen excessive output lines in the repl affect interactions in other buffers.
The hangs occur specifically in the repl buffer itself.
Also yes, there is a way to clear the entire repl buffer, but I’m blanking on the exact command and it’s a holiday so I’m not at my laptop.
Sean Murphy
@SeanFullstack
Hi, I hope you are well. I have a Clojure 6 month contract just come available in London up to £650 per day - please get intouch urgently if you are open to such a contract - sean@fullstack.london