在*File上没有`f.Close()`的自动完成功能

huangapple go评论71阅读模式
英文:

vscode: No autocomplete for `f.Close()` on *File

问题

有没有什么原因,为什么vscode不建议使用f.Close()

我已经安装了gopls,昨天自动完成功能还正常工作。

重新启动vscode没有帮助。

英文:

Is there a reason, why vscode does not suggest to use f.Close()?

在*File上没有`f.Close()`的自动完成功能

I have gopls installed, and yesterday autocomplete worked fine

Restarting vscode did not help.

答案1

得分: 1

我找到了解决我的问题的方法:

上面的代码属于模块"read-bytes"。

我在一个不同的模块中打开了这个文件。

即使重新启动vscode也没有帮助。

为了解决这个问题,我使用了"文件/打开文件夹",并打开了"read-bytes"的文件夹。

现在自动完成功能正常工作。

相关链接:单文件夹工作区

英文:

I found the solution for my problem:

Above code belongs to the module "read-bytes".

I opened the file from within a different module.

Even restarting vscode did not help.

To solve this, I used "File / Open Folder", and opened the folder of "read-bytes".

Now autocomplete works fine.

Related: Single-folder workspaces

huangapple
  • 本文由 发表于 2022年6月24日 18:53:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/72743002.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定