As I hinted in a recent PR, I've written a native-messaging helper in Rust that's (I believe) compatible with the official Python one. The code (and instructions, and a pre-built static binary) are here:
The user can build a single binary and copy it to each system where they want to use Textern, instead of having to clone the code and build it for whatever version of Python happens to be present
The single binary can generate and install its own manifest file, rather than requiring it to be installed separately
Currently only installs manifests in the per-user location, not system-wide
The single binary automatically installs itself for Chrome and Chromium, not just Firefox, in case Textern ever gets ported
Rather than async, the Rust version just uses a thread to monitor every edited file
threads are easy and safe in Rust, while the async ecosystem is not yet as mature as Python's
Rather than using inotify or a file-modification-event system, the Rust version just polls the file's mtime once per second
because Textern wants to be notified of file update events and process-exit events, I felt the complexity of plumbing those together wasn't worth the efficiency gain
Probably a lot more status messages to stderr
The generate-and-install-manifest code doesn't work on macOS or Windows, but if you manually generate and install a manifest, I expect the actual native-messaging code would work just fine
For future reference, I filed issues about what it would take to support macOS and Windows fully
I won't claim this code is bullet-proof or beautiful; as soon as it worked for me I decided to publish it. There's certainly things I'd like to change if I need to dive into the code again for whatever reason, but absent any external influence I expect to leave it alone for now.
I'm happy to answer any questions you may have, or take suggestions if you'd like to try out my code, but otherwise feel free to close this issue, and thanks for writing Textern!
As I hinted in a recent PR, I've written a native-messaging helper in Rust that's (I believe) compatible with the official Python one. The code (and instructions, and a pre-built static binary) are here:
https://gitlab.com/Screwtapello/textern-helper/
Compared to the existing Python implementation:
I won't claim this code is bullet-proof or beautiful; as soon as it worked for me I decided to publish it. There's certainly things I'd like to change if I need to dive into the code again for whatever reason, but absent any external influence I expect to leave it alone for now.
I'm happy to answer any questions you may have, or take suggestions if you'd like to try out my code, but otherwise feel free to close this issue, and thanks for writing Textern!