Closed kcaashish closed 1 year ago
You should try reaching out to null-ls devs about this, as it likely needs some edits in the builtin itself (related to reading the old saved file, but not the new unsaved version).
hi @kcaashish I'm not familiar with null-ls, but I guess the problem is in your configuration to the plugin. Try to find out correct example for null-ls which will cover your case
Hey @incu6us, we did solve it by writing into a temp file. I think the issue here is taking input from stdin. Possibly this https://github.com/incu6us/goimports-reviser/issues/94! We had a discussion over at null-ls and chose to use temp file for now until this gets fixed in goimports-reviser. The discussion: https://github.com/jose-elias-alvarez/null-ls.nvim/discussions/1472#discussioncomment-5480747 Anything on this?
So instead of :
args = { "-output", "stdout", "$FILENAME" },
to_stdin = true,
we are using:
args = {"$FILENAME"},
to_temp_file = true,
Anyway to fix this?
fixed stdin feature in v3.5.6
My config for
goimports-reviser
is:In a very simple go project with
go.mod
:main.go
:Notice the absence of imports statment as well. So there should be a
undeclared name: fmt
error. If I format the code, the imports are not auto imported.If I delete the line fmt.Println()
dd
then hit:w
, the line pops back up.