Skip to content
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

golang auto import fail #5980

Closed
fastfading opened this issue Feb 14, 2023 · 8 comments
Closed

golang auto import fail #5980

fastfading opened this issue Feb 14, 2023 · 8 comments
Labels
C-bug Category: This is a bug

Comments

@fastfading
Copy link

Summary

image

I add below configure, did not help either

[[language]]
name = "go"
config = { goimports = true, gofumpt = true, staticcheck = true, analyses = { unusedparams = true, unreachable = true } }

Reproduction Steps

I tried this:

  1. hx

I expected this to happen:

Instead, this happened:

Helix log

~/.cache/helix/helix.log
please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines

Platform

macos

Terminal Emulator

iterm2

Helix Version

22.12

@fastfading fastfading added the C-bug Category: This is a bug label Feb 14, 2023
@the-mikedavis
Copy link
Member

Could you post the log when running in verbose mode (hx -v) for when this happens? https://github.com/helix-editor/helix/wiki/FAQ#access-the-log-file

@fastfading
Copy link
Author

hx --health go
Configured language server: gopls
Binary for language server: /Users/xxx/go/bin/gopls
Configured debug adapter: dlv
Binary for debug adapter: /Users/xxx/go/bin/dlv
Highlight queries: ✓
Textobject queries: ✓
Indent queries: ✓

@fastfading
Copy link
Author

helix.log.zip

@fastfading
Copy link
Author

it is very easy to duplicate .
write a golang program , remove some imports

package main
//import "fmt"
func main() {
    fmt.Println("hello world")
}

@the-mikedavis
Copy link
Member

Are you looking for the import to happen when using auto-complete of fmt.Println or on save? If it's on save then this is #1565

@fastfading
Copy link
Author

Are you looking for the import to happen when using auto-complete of fmt.Println or on save? If it's on save then this is #1565

yes, this is the same issue.
most editor auto import on save
we expect this in helix too

@pascalkuthe
Copy link
Member

In that case I am closing this as a duplicate of #1565

@pascalkuthe pascalkuthe closed this as not planned Won't fix, can't repro, duplicate, stale Feb 16, 2023
@Sackbuoy
Copy link

Sackbuoy commented May 2, 2023

In case anyone else comes across this, a quick solution to get auto imports with go in helix is this https://bminde.com/2022/08/27/til-helix-editor.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

4 participants