goland 转 cursor ,遇到一个问题,就是 import 排序,总是把项目包和内置包混在一起,找了个插件 Go Group Imports 也不好使,实在没办法了想要禁用自动排序,可不管怎么设置,都没用,保存的时候依然会自动排序,实在无解,求教大佬们要怎么搞啊
1 concernedz 154 天前 |
2 fruitmonster 154 天前 |
![]() | 3 Vegetable 154 天前 When the language server is enabled and one of default/gofmt/goimports/gofumpt is chosen, the language server will handle formatting. If custom tool is selected, the extension will use the customFormatter tool in the Go: Alternate Tools section. 根据配置说明,默认情况下 vscode 使用 gopls 进行代码格式化,可以通过配置修改为自定义的格式化工具,比如 goimports 。你可以找一下有没有人做了 goland 的 formatter 的移植,或者探索一下其他格式化工具。 |
4 kfpenn OP @fruitmonster 哈哈哈,这也是一种办法 |
6 kfpenn OP @concernedz 不知道怎么修改 |
7 fruitmonster 154 天前 @kfpenn #4 我就开俩,因为我习惯了 goland 的 debug |
8 dickfu 154 天前 用 vim 写 go 的时候,我记得自己分好类了在不同类之间加空行,他就只在分类里自动排序了,而不会调整分类之间的顺序 |