V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
heliopetuous
V2EX  ›  Visual Studio Code

vscode 解析 include 本地头文件和同名库文件的问题求解

  •  
  •   heliopetuous · 2020-07-31 10:08:48 +08:00 · 2479 次点击
    这是一个创建于 1358 天前的主题,其中的信息可能已经有所发展或是发生改变。
    问题是这样的:
    本地 project 里有一个 assert.h,但 F12 看这个 include “assert.h”显示的 /usr/include 下的 assert.h ;
    因为本地 assert.h 里有一些自己定义的东西,vscode 总是识别不了。
    请问有人了解这个问题应该怎样解决吗?
    3 条回复    2021-05-07 09:58:17 +08:00
    dalabenba
        1
    dalabenba  
       2020-07-31 10:09:40 +08:00 via Android
    好像有 exclude 的选项吧
    heliopetuous
        2
    heliopetuous  
    OP
       2020-07-31 10:48:31 +08:00
    @dalabenba 试过 files.exclude,没有效果,感觉它里面这些 exclude 都是对搜索时的结果做 filter
    Ysxcc
        3
    Ysxcc  
       2021-05-07 09:58:17 +08:00
    c_cpp_properties.json 中设置 include 的位置,不要使用**递归搜索。或者使用 forcedInclude 直接加入你的头文件,不过这样还是会跳转到库文件,但是这样也能解决这个问题
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1299 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:40 · PVG 01:40 · LAX 10:40 · JFK 13:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.