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

Use cljfmt from inside NodeJS #106

Open
marcomorain opened this issue May 12, 2018 · 2 comments
Open

Use cljfmt from inside NodeJS #106

marcomorain opened this issue May 12, 2018 · 2 comments

Comments

@marcomorain
Copy link
Contributor

The current system to format a file only works when the REPL is connected, and the project has a dependency on cljfmt.

I have an idea on how to run formatting without needing the REPL:

We can compile cljfmt from Clojure to JavaScript using the ClojureScript compiler. We can then call the cljfmt code directly from TypeScript in the extension (in-process).

This will enable really quick format-on-save behavior.

@avli
Copy link
Owner

avli commented May 15, 2018

@marcomorain, correct me if I wrong: you suggest to compile cljfmt to a JavaScript module and distribute it alongside with the extension, right? Have you checked if cljfmt compatible with ClojureScript? Otherwise, sounds great. I believe, it will make it easier to use native VSCode formatting protocol in this case.

@marcomorain
Copy link
Contributor Author

Yeah, it seems possible based on this module: https://github.com/snoe/node-cljfmt/tree/master/bin

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

No branches or pull requests

2 participants