Visual Studio Code Intellisense 不显示 C++ 的函数文档

问题描述 投票:0回答:1

我按照 Microsoft 的这篇 C/C++ for Visual Studio Code 文章使用 Visual Studio Code 编写 C++。与显示智能感知提供成员函数文档的文章不同,它没有向我显示任何内容。同样的事情也发生在 Visual Studio 2019 中。 Here is a screenshot of how my intellisense looks.

到目前为止我尝试解决的问题:

    重新安装 VSCode(同时删除应用程序数据)
编辑*

配置文件

c_cpp_properties.json

{ "configurations": [ { "name": "Win32", "includePath": [ "${workspaceFolder}/**" ], "defines": [ "_DEBUG", "UNICODE", "_UNICODE" ], "windowsSdkVersion": "10.0.19041.0", "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe", "cStandard": "c17", "intelliSenseMode": "windows-msvc-x64", "cppStandard": "c++14" } ], "version": 4 }
设置.json

{ "files.associations": { "xstring": "cpp" } }
任务.json

{ "tasks": [ { "type": "cppbuild", "label": "C/C++: cl.exe build active file", "command": "cl.exe", "args": [ "/Zi", "/EHsc", "/nologo", "/Fe${fileDirname}\\${fileBasenameNoExtension}.exe", "${file}" ], "options": { "cwd": "${fileDirname}" }, "problemMatcher": [ "$msCompile" ], "group": { "kind": "build", "isDefault": true }, "detail": "Task generated by Debugger." } ], "version": "2.0.0" }
    
c++ visual-studio-code intellisense
1个回答
1
投票
鼠标悬停工具提示中显示的文档是从配置为使用的标准库源文件生成的。 VS Code 文档的屏幕截图来自使用 gcc 的 C++ 标准库实现

libstdc++ 的设置,其中包含包含该文档的 C++ 注释。由于您使用的是 Visual Studio,因此您正在使用 Microsoft 的 C++ 标准库实现。浏览他们的标题,似乎 Microsoft STL 不包含此类文档注释。

您可以在他们的讨论板上提出问题,询问是否有好的解决方法/替代方案,或者(礼貌地)询问他们为什么不维护此类文档注释,或者他们将来是否有计划。

我没用过这个,但你可能有兴趣尝试一下这个 VS Code 扩展:

Guyutongxue.cpp-reference (我与这个扩展没有任何关系),哪个

是一个从 vscode 中浏览 cppreference.com 的工具,而不是通过浏览器来执行此操作。您可以使用此扩展来搜索 C++ 标准的库和方法文档。

© www.soinside.com 2019 - 2024. All rights reserved.