shuzijun / leetcode-editor

Do Leetcode exercises in IDE, support leetcode.com and leetcode-cn.com, to meet the basic needs of doing exercises.Support theoretically: IntelliJ IDEA PhpStorm WebStorm PyCharm RubyMine AppCode CLion GoLand DataGrip Rider MPS Android Studio
https://plugins.jetbrains.com/plugin/12132-leetcode-editor
Apache License 2.0
3.71k stars 400 forks source link

GoLand里面,使用Go语言编写代码输入一个 { 的时候会自动补全 }, 再Enter的时候,} 的缩进就错位了 #642

Closed cianfree closed 1 year ago

cianfree commented 1 year ago

1. 输入一个{, 自动补全 }

func test(n int) {
    if n > 0 {}
}

2. 在 {} 中间光标处 按下 Enter

func test(n int) {
    if n > 0 {
        // todo
} // 这个 错位了,而且 按下一次 TAB 还没有用,要按下两次才可以
}

3. 期望的结果,按下 Enter后

func test(n int) {
    if n > 0 {
        // todo
        }
}

希望作者能解决这个问题,这个实在是挺影响编码效率的

shuzijun commented 1 year ago

插件不提供自动补全 功能,自动补全由IDE提供。 出现这个问题的原因可能是go文件不符合规范,猜测可能文件中没有package导致,可以在模版中配置一下。