Hi, @shaunlebron. I just saw this info at the Readme of parinfer: > Editors simply are not yet designed to allow an ideal version of Parinfer to exist > So... now that Atom is dead and the one keeping a fork of it is me, maybe I can design some API for this ideal version to exist? What do you think is needed?
Could someone link me that post as well? I too am curious (although I'm into neovim, but would love to know what's missing).
Looking at this, it seems that the problem in Pulsar is copy/paste and buffer refreshes from changes on disk - these indeed are not implemented.
If I'm not mistaken, it's possible to get every change from every cursor using the change callback; still, it might have some trouble in case of some "API text change" (which is something I am experimenting on a different plug-in I'm writing)
Also, this 3 version might be interesting for very big files that might add latency too thinking-face
Hi @mauricio.szabo, coming back to this, I think the third paragraph of the section you quoted from has the most details about what Smart Mode requires from an editor: https://github.com/parinfer/parinfer.js?tab=readme-ov-file#status-update-2019-smart-mode
I might try a Dumb Mode actually:
1. Add two file hooks:
• Format on open: when opening a file, run clojurefmt with https://github.com/oakmac/clojurefmt-js/blob/d221663d6386312a1e6c4c198b2bebc152194c7a/test_format/format.eno#L265-L328
• Unformat on save: when saving a file, run parstager on it to undo formatting on top-level forms when possible
2. Override tab and shift+tab:
• Indent to tab-stops: when indenting a line or selection of lines, snap to structural tab-stops
3. Add two hotkeys for “infer” or “format”:
• Infer on command: run Indent Mode on command (not every time you type)
• Format on command: auto-format with clojurefmt, which runs on command
Hey sorry, I don't get notifications here. You can always email. Let me get back to you on this
I can probably be of some assistance here. I should do a write-up of exactly what API calls Parinfer needs in order to be implemented 100% in editors.
Incidentally, this would be the same write-up as "why VS Code does not support Parinfer Smart Mode"
These API calls would be really useful - we are already adding new API, meaning that we're already "our own thing", not limited by what Atom used to offer only 🙂
Thanks for the help!
Also, I remember seeing the write-up about VSCode, but unfortunately I'm not finding it - can you link it to me, so I can see if the same problems exist in Pulsar too?