This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
goImports: avoid collapsing new imports into pseudo import line (#3045)
* goImports: avoid collapsing new imports into pseudo import line getTextEditForAddImport tries to insert a newly added package into an existing import group. If no import group exists, it tries to merge single line import statements and create a group. In this process, import statements like import "C" are pseudo imports and shouldn't be grouped with other imports. This CL changes parseFilePrelude to detect such pseudo imports and excludes such imports from the grouping logic. Fixes #1701 * correct the file name mac and vsccode ignored casing, but linux and git were unhappy.
- Loading branch information
Showing
4 changed files
with
42 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package main | ||
|
||
//#include <stdlib.h> | ||
import "C" | ||
|
||
import "math" | ||
|
||
func main() { | ||
_ = math.Max(1, 2) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters