GoLand IDE无法识别Go文件,智能感知/代码补全不起作用。

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

GoLand IDE cannot recognize Go files, intellisense/code completion not working

问题

我正在尝试编写一些基本的Go文件,但是当我只使用Go文件时,没有代码补全/智能感知。

另外,当我尝试编写JS代码时,它运行得很好。

有什么想法吗?

英文:

I'm trying to write some basic Go file and I don't have any code completion / intellisense when working only with go files.

GoLand IDE无法识别Go文件,智能感知/代码补全不起作用。

Otherwise, when trying to write JS code for example it works great:

GoLand IDE无法识别Go文件,智能感知/代码补全不起作用。

Any thoughts?

答案1

得分: 1

你需要在你的IDE中设置一些设置,比如GOPATH和GOROOT。这是一个IDE设置的安装过程截图。

GoLand IDE无法识别Go文件,智能感知/代码补全不起作用。

GoLand IDE无法识别Go文件,智能感知/代码补全不起作用。

英文:

You have to set some settings like GOPATH and GOROOT in your IDE.
This is a setup process screenshot of an IDE setting.

GoLand IDE无法识别Go文件,智能感知/代码补全不起作用。

GoLand IDE无法识别Go文件,智能感知/代码补全不起作用。

答案2

得分: 0

导航到“首选项 | 编辑器 | 文件类型”,找到“文本”或“根据上下文自动检测的文件类型”,然后从文件名模式列表中删除main.go

英文:

Navigate to Preferences | Editor | File Types, find Text or File type auto-detected by context and remove main.go from the file name patterns list.

huangapple
  • 本文由 发表于 2022年8月18日 00:51:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/73392241.html
匿名

发表评论

匿名网友

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

确定