oppiliappan / statix

lints and suggestions for the nix programming language
https://git.peppe.rs/languages/statix/about
MIT License
557 stars 21 forks source link

vim ALE support #10

Closed SuperSandro2000 closed 2 years ago

SuperSandro2000 commented 2 years ago

It would be great if vim ale support could be added.

cyntheticfox commented 2 years ago

I can look into adding it. I've added some tools to ale before, though I'm currently adding statix to nvim-lint.

cyntheticfox commented 2 years ago

So I was thinking it'd be required to have stream support for ALE to support it as I said in #16, but ALE does support creating a temporary file. It would still be advantageous to have stream support, but until that's implemented, it should still be possible.

oppiliappan commented 2 years ago

Oh no worries, I have nearly got the stdin flag ready, thanks again, for picking this up!

cyntheticfox commented 2 years ago

I'm a lot worse with regex than I remember, but I've got https://github.com/dense-analysis/ale/pull/3967 submitted

cyntheticfox commented 2 years ago

Since #16's implemented, I'll see about adding ALE fixer support next

Edit: Doing it, I now realize there is an arg to allow you to do it with a temporary file. Oh well, the stream feature is still very nice to have

cyntheticfox commented 2 years ago

I didn't realize until I tried to test it, now that 0.4.0 is implemented, and that uses stdout instead of stderr, that PR I made is pretty much outdated. I'll also for now have to use a nix shell to test since 0.4.0 hasn't yet hit nixpkgs-unstable

cyntheticfox commented 2 years ago

Okay, I've got a full v0.4.0 version at https://github.com/houstdav000/ale/tree/feature/statix that implements both check and fix properly, but since that's not the version in nixpkgs-unstable, I'm unsure whether to wait or just make the PR now

oppiliappan commented 2 years ago

I'll open a PR with v0.4.0 later today.

and that uses stdout instead of stderr

Ah yeah, I decided that diagnostics would go to stdout and errors raised by statix during its run (things like IO errors, CLI errors etc.) would go into stderr. What do you think?

cyntheticfox commented 2 years ago

Ah yeah, I decided that diagnostics would go to stdout and errors raised by statix during its run (things like IO errors, CLI errors etc.) would go into stderr. What do you think?

It makes sense to me, and works pretty well from what I saw when testing it.

cyntheticfox commented 2 years ago

nixpkgs-unstable has v0.4.0, and I made a minor fix for that previous implementation, so it should be good now in https://github.com/dense-analysis/ale/pull/3969

cyntheticfox commented 2 years ago

https://github.com/dense-analysis/ale/pull/3969 has been merged :tada:

oppiliappan commented 2 years ago

Thanks @houstdav000 for working on this :partying_face:

oppiliappan commented 2 years ago

I'll create a section on the readme with all the editor integrations so far.