go-group-imports-vscode icon indicating copy to clipboard operation
go-group-imports-vscode copied to clipboard

Never-ending changes to commented-out imports

Open stefanb opened this issue 2 years ago • 1 comments

When imports are commented out it tries to fix them, altering them

Example

package main

// import (
// 	"fmt"

// 	"github.com/some/library"
// )

When saved it becomes:

package main

// import (
// 	"fmt"
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

// 	"github.com/some/library"
// )

And it is NOT stopping - new empty comment lines are being inserted until forcibly stopped.

stefanb avatar Apr 12 '22 05:04 stefanb

It seems that the checks like https://github.com/beerose/go-group-imports-vscode/blob/9a0fb15e57d69ef1dfaf42c8d9a6bfde39147422/src/utils.ts#L94 and https://github.com/beerose/go-group-imports-vscode/blob/9a0fb15e57d69ef1dfaf42c8d9a6bfde39147422/src/utils.ts#L102 should also check if the line is commented out

stefanb avatar Apr 12 '22 06:04 stefanb