Open jdoklovic opened 6 years ago
liteide gotools internal gofmt include goimports function. please download liteide latest version x33.2 and test. https://github.com/visualfc/liteide/releases if use archlinux download https://github.com/visualfc/liteide/releases/download/x33.2/liteidex33.2.archlinux-pkgbuild.zip
I upgraded to x33.2 and the same issue exists, however, I think I know the problem...
in gosrc.xml on master the GOFMT variable is set to golang's gofmt command, NOT gotools gofmt:
But that's not the only issue... later in the file, the GoFmt action in the utils menus is set as go fmt
not even gofmt.
I think the internal command mapping and gosrc.xml are getting in each other's way. Also, I noticed that keyboard mapping Ctrl+Alt+I is supposed to map to "GoImports" but that doesn't work either.
To fix, this is what I had to do:
With that in place, I could use the build menu to properly format and adjust imports, however, the key command Ctrl+Alt+I didn't work.
At this point, I removed the key mapping from GoImports and put it on Build|GoFmt. This worked as expected until I restarted liteIDE and then it didn't work anymore.
To get it working between restarts, I had to add key = "Ctrl+Alt+i" to the GoFmt action in gosrc.xml
Hope this helps!
CTRL+ALT+I
Works for me.
LiteIDE Version: X38.3 Go Version: 1.22.5 OS: Linux amd64
LiteIDE Version: X33.1 Go Version: 1.9 OS: Linux amd64
There used to be an option unfer the GolangFmt options to "use goimports" instead of go fmt. That option is no longer there and now just has "enable update imports..." which I have checked.
When I use CTRL+ALT+I to reformat code and update imports, it no longer adds/removes imports that I expect.
I expect that all missing imports are added which they are not.
As a test, I changed to gofmt command in gosrc.xml to be:
With that in place, when I use the GoFmt build menu action, it runs goimports and I get the expected result.
Question is, why doesn't LiteIDE do this when using CTRL+ALT+I ??