简体   繁体   English

Unity/C# 自动完成在 Linux 和 .NET 版本 6.x 的 Visual Studio Code 中不起作用

[英]Unity/C# autocomplete not working in Visual Studio Code for Linux with .NET version 6.x

I can't get IntelliSense in to autocomplete or show suggestions for Unity (20.3.30 LTS) methods in Visual Studio Code in Linux (Ubuntu 20.04).我无法在 Linux (Ubuntu 20.04) 的 Visual Studio Code 中让 IntelliSense 自动完成或显示对 Unity (20.3.30 LTS) 方法的建议。 I have downloaded .NET version 6.0.102 on my Ubuntu but the Unity API Compatibility Level only goes as high as 4.x, which is subsequently no longer available for download on Linux... Does anyone have a solution to this problem, or maybe a suggestion on what else to do (maybe use a different IDE)?我已经在我的 Ubuntu 上下载了 .NET 版本 6.0.102,但 Unity API 兼容级别仅达到 4.x,随后不再可在 Linux 上下载...有没有人有解决这个问题的方法,或者也许关于还可以做什么的建议(也许使用不同的 IDE)?

Something that worked for me in the end was to add最终对我有用的是添加

"omnisharp.path": "latest",
"omnisharp.useGlobalMono": "always"

in the settings.json file of Visual Studio Code.在 Visual Studio Code 的 settings.json 文件中。 It still started complaining after that and it turned out that I needed to install Mono still.之后它仍然开始抱怨,结果我仍然需要安装 Mono。 I did that by running我通过跑步做到了

sudo apt install mono-complete

in the terminal after which I restarted omnisharp and everything worked like a charm.在终端中,之后我重新启动了 omnisharp,一切都很顺利。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM