micro-editor / go-plugin

Auto gofmt/goimports and gorename
43 stars 5 forks source link

Does not show errors in _test.go files #10

Open Jacalz opened 3 years ago

Jacalz commented 3 years ago

I use this package a lot but it seems to fail to provide errors within test files. This is unfortunate as it makes writing tests take a lot more time than what it necessarily needs to.

zyedidia commented 3 years ago

I'm not able to reproduce this issue. When I save in x_test.go the file is reformatted correctly. You could try editing the plugin in ~/.config/micro/plug/go/go.lua and add some micro.Log(...) calls to check what is going wrong (make sure to run micro with -debug to generate the log.txt file).

example log call in lua:

local micro = import("micro")
micro.Log("test")
Jacalz commented 3 years ago

I was initially partially wrong when writing this issue. Formatting seems to work but any code errors are not reported for me (no indication where errors are and no text to show what's wrong).

bjoerndemeyer commented 2 years ago

Indeed, this is because tests need to be compiled with go test -c in order to get detailed syntax errors. I am having the same problem.

EDIT although this might be more related to the linter plugin.