daixiang0 / gci

GCI, a tool that control golang package import order and make it always deterministic.
BSD 3-Clause "New" or "Revised" License
407 stars 62 forks source link

vscode integration? #213

Open guettli opened 1 month ago

guettli commented 1 month ago

What version of GCI are you using?

I am using GCI via golangci-lint

❯ golangci-lint --version
golangci-lint has version v1.59.1 built with go1.22.5 from (unknown, modified: ?, mod sum: "h1:CRRLu1JbhK5avLABFJ/OHVSQ0Ie5c4ulsOId1h3TTks=") on (unknown)

What did you expect to see?

If I save the file in vscode, I would like my file to get automatically formatted correctly.

What did you see instead?

I see a warning in vscode (and unfortunately no quick-fix action is available)

daixiang0 commented 1 month ago

It should be done by golangci-lint first then GCI can support it.

guettli commented 1 month ago

@daixiang0 can you please elaborate? What needs to be done by golangci-lint? Is this something I can configure, or is this an open feature request of golangci-lint?

daixiang0 commented 1 month ago

There would be a vscode extension about golangci-lint, then as a part of it, GCI would do some implement to support.

Yep, should post a feature request to golangci-lint first.

guettli commented 1 month ago

I use the documented vscode integration of golangci-lint:

https://golangci-lint.run/welcome/integrations/

"go.lintTool": "golangci-lint",
"go.lintFlags": [
  "--fast"
]