Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code VSCode,智能感知C++;自动完成不工作,ubuntu 20.04_Visual Studio Code_Intellisense_Vscode Settings_Ubuntu 20.04 - Fatal编程技术网

Visual studio code VSCode,智能感知C++;自动完成不工作,ubuntu 20.04

Visual studio code VSCode,智能感知C++;自动完成不工作,ubuntu 20.04,visual-studio-code,intellisense,vscode-settings,ubuntu-20.04,Visual Studio Code,Intellisense,Vscode Settings,Ubuntu 20.04,我已经在ubuntu 20.04下安装了Vscode。如果没有intellisense自动完成功能,我无法编写代码。但它不起作用。我在以前的UbuntuLTS(16.04,18.04)中使用过autocomplete,没有问题 我已经配置了c\u cpp\u properties.json { "configurations": [ { "name": "Linux",

我已经在ubuntu 20.04下安装了Vscode。如果没有intellisense自动完成功能,我无法编写代码。但它不起作用。我在以前的UbuntuLTS(16.04,18.04)中使用过autocomplete,没有问题

我已经配置了
c\u cpp\u properties.json

    {
    "configurations": [
        {
            "name": "Linux",
            "browse": {
                "path": [
                    "/usr/include",
                    "/usr/include/x86_64-linux-gnu/qt5",
                    "/usr/include/pcl",
                    "/usr/include",
                    "/usr/lib",
                    "/usr/share"
                ],
                "limitSymbolsToIncludedHeaders": true
            },
            "includePath": [
                "/home/atas/colcon_ws/src/ROS_CB/chiconybot_ui/include/",
                "/home/atas/colcon_ws/build/chiconybot_ui/",
                "/usr/include/opencv4/",
                "/opt/ros/foxy/include/",
                "/usr/include/",
                "/usr/include/x86_64-linux-gnu/qt5/"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}
已正确找到头文件。我还安装了VSCode marketplace中所有必要的扩展。

我在这里遵循了配置
settings.json
的步骤

最后,my settings.json看起来像

{
    "files.associations": {
        "cctype": "cpp",
        "cmath": "cpp",
        "csignal": "cpp",
        "cstdarg": "cpp",
        "cstddef": "cpp",
        "cstdio": "cpp",
        "cstdlib": "cpp",
        "cstring": "cpp",
        "ctime": "cpp",
        "cwchar": "cpp",
        "cwctype": "cpp",
        "atomic": "cpp",
        "strstream": "cpp",
        "chrono": "cpp",
        "cstdint": "cpp",
        "initializer_list": "cpp",
        "iosfwd": "cpp",
        "mutex": "cpp",
        "ratio": "cpp",
        "system_error": "cpp",
        "thread": "cpp",
        "cinttypes": "cpp",
        "typeindex": "cpp",
        "deque": "cpp",
        "vector": "cpp",
        "array": "cpp",
        "*.tcc": "cpp",
        "bitset": "cpp",
        "clocale": "cpp",
        "complex": "cpp",
        "condition_variable": "cpp",
        "list": "cpp",
        "unordered_map": "cpp",
        "exception": "cpp",
        "fstream": "cpp",
        "functional": "cpp",
        "iomanip": "cpp",
        "iostream": "cpp",
        "istream": "cpp",
        "limits": "cpp",
        "memory": "cpp",
        "new": "cpp",
        "ostream": "cpp",
        "numeric": "cpp",
        "sstream": "cpp",
        "stdexcept": "cpp",
        "streambuf": "cpp",
        "type_traits": "cpp",
        "tuple": "cpp",
        "typeinfo": "cpp",
        "utility": "cpp",
        "valarray": "cpp",
        "*.ipp": "cpp",
        "codecvt": "cpp",
        "future": "cpp",
        "hash_map": "cpp",
        "hash_set": "cpp",
        "core": "cpp",
        "dense": "cpp",
        "numericaldiff": "cpp",
        "unordered_set": "cpp",
        "algorithm": "cpp",
        "cfenv": "cpp",
        "random": "cpp",
        "optional": "cpp",
        "string_view": "cpp",
        "iterator": "cpp",
        "map": "cpp",
        "memory_resource": "cpp",
        "set": "cpp",
        "string": "cpp",
        "slist": "cpp",
        "shared_mutex": "cpp",
        "forward_list": "cpp",
        "qvboxlayout": "cpp",
        "qstringlist": "cpp",
        "qspinbox": "cpp",
        "qstatusbar": "cpp",
        "qpushbutton": "cpp",
        "qcombobox": "cpp",
        "qgraphicsopacityeffect": "cpp",
        "qmovie": "cpp",
        "qtimer": "cpp",
        "qpainter": "cpp",
        "qwidget": "cpp",
        "qtwidgets": "cpp",
        "regex": "cpp",
        "qhostaddress": "cpp",
        "qaction": "cpp",
        "qlayout": "cpp",
        "qframe": "cpp",
        "qlayoutitem": "cpp",
        "qsize": "cpp",
        "qset": "cpp"
    },
    "editor.formatOnSave": true,
    "python.pythonPath": "/usr/bin/python3",
    "git.ignoreLimitWarning": true,
    // Controls if quick suggestions should show up while typing
    "editor.quickSuggestions": {
        "other": true,
        "comments": false,
        "strings": false
    },
    // Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.
    "editor.acceptSuggestionOnCommitCharacter": true,
    // Controls if suggestions should be accepted on 'Enter' - in addition to 'Tab'. Helps to avoid ambiguity between inserting new lines or accepting suggestions. The value 'smart' means only accept a suggestion with Enter when it makes a textual change
    "editor.acceptSuggestionOnEnter": "on",
    // Controls the delay in ms after which quick suggestions will show up.
    "editor.quickSuggestionsDelay": 10,
    // Controls if suggestions should automatically show up when typing trigger characters
    "editor.suggestOnTriggerCharacters": true,
    // Controls if pressing tab inserts the best suggestion and if tab cycles through other suggestions
    "editor.tabCompletion": "on",
    // Controls whether sorting favours words that appear close to the cursor
    "editor.suggest.localityBonus": true,
    // Controls how suggestions are pre-selected when showing the suggest list
    "editor.suggestSelection": "recentlyUsed",
    // Enable word based suggestions
    "editor.wordBasedSuggestions": true,
    // Enable parameter hints
    "editor.parameterHints.enabled": true,
    "cmake.configureOnOpen": false,
}
我想不出为什么自动完成现在不能工作。请看看你是否发现了错误。如果需要更多信息,请在评论中告诉我


谢谢

原来有些问题与VSCode本身有关。我在
help->Check for updates
上检查了新的更新,在新的更新之后,一切恢复正常。有效的当前版本是