Closed bi1yeu closed 2 years ago
Hi, I can reproduce this. I'll have a look to see what can be done about it.
I'm wondering, does this package otherwise work alongside org-mode as you'd expect?
I'm not a heavy user of either prettier nor org babel, but I only recently installed prettier and noticed this issue.
Upon further investigation, it does not look like the JavaScript code inside of the Org source code block is being formatted by prettier when the buffer is saved. E.g., I put console.log( "Hello, World");
in a source code block and it's not reformatted. The same code in a js-mode buffer is reformatted as expected.
This should be fixed in the latest release.
I've also added an (experimental) function prettier-prettify-org-src-code-at-point
. I might build this out into something more fully featured at a later point, perhaps spun out into its own package. If you are going to use it I'd be keen to hear how you go with it.
Thanks!!
On Thu, May 26, 2022, at 3:40 AM, Julian Scheid wrote:
This should be fixed in the latest release.
I've also added an (experimental) function
prettier-prettify-org-src-code-at-point
. I might build this out into something more fully featured at a later point, perhaps spun out into its own package. If you are going to use it I'd be keen to hear how you go with it.— Reply to this email directly, view it on GitHub https://github.com/jscheid/prettier.el/issues/100#issuecomment-1138397563, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJBK2JXCD57QHUQWLZSCGTVL5IK5ANCNFSM5K47DM5A. You are receiving this because you authored the thread.Message ID: @.***>
Describe the bug
Hi! I'm using Org Babel with a JavaScript code block like this:
Whenever I create a new line inside the source code block, the message "Prettier syncing config" appears in the minibuffer, and Emacs hangs for a moment. I don't know if this is a bug, per se, or even whether it's something than can be fixed by prettier.el, but it's impeding my workflow so I figured I'd ask. Any advice is appreciated, thanks in advance!
Link to
M-x prettier-info
output We suggest you copy the output into a Gist after sanitizing it. Make sure to runprettier-info
in the buffer where you experienced the problem. If possible, include a copy of that buffer's contents in the Gist.prettier-info.el
To Reproduce
Expected behavior A clear and concise description of what you expected to happen.
I'd expect prettier config to sync only once (I think?)
Additional context Add any other context about the problem here.
I'm using doom-emacs.