parinfer

mauricio.szabo 2024-04-01T01:15:23.456949Z

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?

👌 1
🙏 1
Tarjei Skjærset 2024-04-27T22:50:03.028629Z

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).

mauricio.szabo 2024-08-05T13:35:50.302799Z

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)

mauricio.szabo 2024-08-05T14:12:41.679909Z

Also, this 3 version might be interesting for very big files that might add latency too thinking-face

shaunlebron 2024-08-04T19:21:41.576809Z

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

shaunlebron 2024-08-04T22:18:49.465499Z

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

shaunlebron 2024-04-04T17:08:20.621289Z

Hey sorry, I don't get notifications here. You can always email. Let me get back to you on this

👍 1
Chris Oakman 2024-04-03T16:59:50.545979Z

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.

Chris Oakman 2024-04-03T17:00:52.822939Z

Incidentally, this would be the same write-up as "why VS Code does not support Parinfer Smart Mode"

mauricio.szabo 2024-04-03T17:10:54.247669Z

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 🙂

mauricio.szabo 2024-04-03T17:11:02.463639Z

Thanks for the help!

mauricio.szabo 2024-04-03T20:07:20.772249Z

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?