Intellisense 在 Ubuntu 上的 VS Code 中不起作用 [英] Intellisense not working in VS Code on Ubuntu

查看:45
本文介绍了Intellisense 在 Ubuntu 上的 VS Code 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 10 中的 VMware Player VM 上的 Ubuntu 16.0.4 上运行 VS Code 版本 1.17.2.我为 VS Code 安装了 C++ 扩展.安装扩展时,有一条消息说扩展安装正常,但之后有很多重复的消息说无法更新数据库".

I am running VS Code version 1.17.2 on Ubuntu 16.0.4 on a VMware Player VM in Windows 10. I installed the C++ extension for VS Code. When installing the extension there was a message to say that the extension installed OK but afterwards there was a lot of repeated messages saying something like "failed to update database".

当我输入一些无效的语法时,没有红色波浪线,如果我按下 Ctl-Space,它只显示正在加载..."但什么也没有.状态栏上的红色火焰图标显示,当我将鼠标悬停在上面时,我看到正在更新 Intellisense...",但该图标似乎从未消失.

When I type something which is invalid syntax there is no red squiggle and if I press Ctl-Space it just shows "Loading..." but nothing comes. The red flame icon on the status bar shows and I see "Updating Intellisense..." when I hover the mouse over but the icon doesn't ever seem to go away.

如果我 #include 一个不存在的标题,则没有绿色波浪线,但如果我保存文件,退出 VS Code 并重新打开,绿色波浪线显示在标题上,但左边距中没有灯泡显示.

If I #include a non existent header, there is no green squiggle but if I save the file, exit VS Code and reopen, them the green squiggle shows on the header but there is no light bulb showing in the left margin.

推荐答案

我遇到了完全相同的问题.我一直在玩设置和禁用/启用扩展.最后通过设置以下内容然后禁用/启用扩展(在它们之后重新加载 VS 代码):

I had exactly the same problem. I've been playing around with settings and disabling/enabling the extension. Finally got it working with setting the followings then disabling/enabling the extension (reload VS code after both of them):

"C_Cpp.errorSquiggles": "Enabled",
"C_Cpp.intelliSenseEngine": "Tag Parser",
"C_Cpp.loggingLevel": "Information"

您也可以使用重置 IntelliSense 数据库"命令,我运行了几次,这可能也有帮助.我怀疑是 intelliSenseEngine 设置成功了.

Also you can play around with "Reset IntelliSense Database" command, I ran it a couple of times, that might have helped too. I suspect the intelliSenseEngine setting was the one that made the trick.

编辑这不会启用所有功能,例如错误的包含标记和转到定义"适用于包含,但代码完成不适用.

Edit This doesn't enable all features, e.g. wrong include markers and "go to definition" works for includes, but code completion doesn't.

这篇关于Intellisense 在 Ubuntu 上的 VS Code 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆