Skip to content
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

Expose clojurescript repl-env directly #476

Merged
merged 1 commit into from
Sep 27, 2016

Conversation

SevereOverfl0w
Copy link
Contributor

This is an alternative to, and builds heavily upon,
#457 (big thanks to to
@Deraen)

It exposes the repl-env in the same way, and is intended for
vim-fireplace.

Example usage from vim-fireplace:

:Piggieback (figwheel-sidecar.repl-api/repl-env)

Tested via:

cd sidecar
lein repl
figwheel-sidecar.repl-api=> (def proj (config/->config-data (config/->lein-project-config-source)))
#'figwheel-sidecar.repl-api/proj
figwheel-sidecar.repl-api=> (launch-from-lein (:data proj) ["dev"])

in vim:

:Piggieback (figwheel-sidecar.repl-api/repl-env)

I was able to use K to view docs, evaluate code, and jump to source.

This is an alternative to, and builds heavily upon,
bhauman#457 (big thanks to to
@Deraen)

It exposes the repl-env in the same way, and is intended for
vim-fireplace.

Example usage from vim-fireplace:
```vim
:Piggieback (figwheel-sidecar.repl-api/repl-env)
```
@@ -83,7 +83,10 @@
(first (string/split x #"\?")))))
stack-trace))

(defrecord FigwheelEnv [figwheel-server]
(defrecord FigwheelEnv [figwheel-server repl-opts]
cljs.repl/IReplEnvOptions
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's important to know what version of CLJS introduced this IReplEnvOptions. Is this going to cause legacy nightmares or has it been around long enough that this isn't a problem.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clojure/clojurescript@1e5580c

First version to include this should be 0.0-2719

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK this is cool then... :)

opts)]
(assoc figwheel-repl-env
;; these are merged to opts by cljs.repl/repl*
:repl-opts repl-opts))))
Copy link
Owner

@bhauman bhauman Sep 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again how many version back has this :repl-opts merging been going on.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added in the same commit as the IReplEnvOptions. cljs.repl/repl* doesn't directly use this :repl-opts key but instead calls the -repl-options method of the protocol and after this PR FigwheelRepl record implements that method and uses repl-opts property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants