-
Notifications
You must be signed in to change notification settings - Fork 42
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
Emacs respect string delimiter default #142
base: master
Are you sure you want to change the base?
Emacs respect string delimiter default #142
Conversation
I just noticed now that part of the changes are also included in #133 which is going to be shorter to review, but will still fail to take non-default options into account (so it will keep |
Hi @gagbo, thanks for calling this to my attention. I don't have much time to test this myself. However, I have some simple integration tests defined here that could probably be used to validate that the changes here don't break anything. I run them using |
The issue with |
If this takes a while to get merged, and if it doesn't have breaking changes, I'd be happy to add it to my fork as some form of beta release. I'd love it if it was easier for users to better support their lisp of choice. Which, if I understand correctly, this would allow due to being able to configure the options object |
Yeah, sorry I forgot to rebase the PR on that, but indeed I tried to make all the knobs accessible, so that at least we can configure parinfer as well from lisp. But the PR is also going to be blocked by nix not using a recent version of Rust, and I don't have the courage to delve into that yet |
2f6582d
to
89b878f
Compare
yeah I tried update nixpkgs to 23.05 on my fork but neovim and vim tests were failing on me and i have no clue how to approach those, so I have to leave that work to more capable hands. |
In some cases, when bad data is passed in as a set of change to parinfer-rust it can cause parinfer-rust to crash. This crash is caused by trying to add indents to a line. When the delta calculated turns out to be negative and when that is added to orig_indent that can cause issues when type casting to usize (Column). This is because the combination of these two variables can be negative and when type cast to a usize it causes the number to be very large, in my case something like 1.8 trillion. So when this number is then used to determine how many times to repeat a string, it causes the library to run out of memory and crash.
Update release script
…e to upstream) Update to use flakes and latest version of nixpkgs Do not move upstream due to this commit breaking integration tests
Hey, @gagbo this has been sitting here for awhile. So, I'll just say again that I'd be happy if you opened a PR for this on my fork, https://github.com/justinbarclay/parinfer-rust, so we can work on getting this into |
Yeah makes sense. I’ll need some time to figure things out and remember where I was with this, but I’ll try to make a PR to your fork this week |
89b878f
to
ed7d868
Compare
For ease of development make sure that the emacs features are always tested against
Using the configuration `tab_spaces = 2` to minimize the impact on formatting src/emacs_wrapper.rs
This is redone by using `saturating_add_signed` instead of having an extra helper function. The function is stable since Rust 1.66
c73800a
to
adb89df
Compare
Upgrade to emacs crate 0.19 Fix all conversions to/from Lisp except the Vec<String> <-> Vector equivalence Apparently one reference to env keeps escaping
adb89df
to
180acb8
Compare
Hello,
Following the discussion in #139 I wanted to provide a potential fix so everyone sees what I meant. There are mainly 2 "big" things and a small thing changing in this PR:
parinfer-make-option
in Emacs, instead of producing an empty option, it produces the default option (coming fromcli_options
and the serde default values intypes::Options
)rustfmt.toml
file because when I tried to format the file calling my formatter it didn't follow at all the existing style in the file. To help possible future contributors, I added a small config so that the 2-space width is preserved.Note: I didn't test the FFI changes Since I'm just adding functions, I don't think it's too bad if something broken is pushed, but it's a bit hard to setup everything to test it in Emacs; so I'll just be confident that the simple functions here are correct, given that Emacs crate API isn't too bad.
We probably still want proper testing, so if @justinbarclay you have any "parinfer-rust dev testing" tips I'm all ears
Fixes #139