microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.45k stars 1.53k forks source link

CppToolsAPI always recursively parsing includes #2016

Closed ThadHouse closed 6 years ago

ThadHouse commented 6 years ago

I'm trying to test out the new extension API to be able to provide my own configurations, and am running into issues.

Below is the SourceFileConfigurationItem I am providing for my file. The directories provided are not supposed to be parsed resursively, however they seem to be. My file includes #include "DriverStation.h, Which is located in the root of one of my include directories and in a subdirectory of another. Non recursively should resolve the root one, however the extension is resolving the subdirectory one.

Here is the debug log

sending compilation args for C:\USERS\THADH\DOCUMENTS\GRADLEJAVA\SRC\CPP\MYTHING.CPP
  include: C:\Users\thadh\Documents\GradleJava\build\tmp\expandedArchives\hal-2018.3.2-headers.zip_c2e0b10dbe01f5bb317559e19f923b7b
  include: C:\Users\thadh\Documents\GradleJava\build\tmp\expandedArchives\hal-2018.3.2-headers.zip_c2e0b10dbe01f5bb317559e19f923b7b\HAL
  include: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.13.26128\include
  include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\ucrt
  include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\shared
  define: _DEBUG
  define: UNICODE
  define: _UNICODE
  stdver: --ms_c++latest

Here is the SourceFileConfigurationItem

[
    {
        "uri": "c:\\Users\\thadh\\Documents\\GradleJava\\src\\cpp\\MyThing.cpp",
        "configuration": {
            "standard": "c++14",
            "intelliSenseMode": "clang-x64",
            "includePath": [
                "C:\\Users\\thadh\\Documents\\GradleJava\\build\\tmp\\expandedArchives\\hal-2018.3.2-headers.zip_c2e0b10dbe01f5bb317559e19f923b7b",
                "C:\\Users\\thadh\\Documents\\GradleJava\\build\\tmp\\expandedArchives\\cscore-cpp-1.2.0-headers.zip_d74028ab3c80a2c64e1d3f5057fd0f19",
                "C:\\Users\\thadh\\Documents\\GradleJava\\build\\tmp\\expandedArchives\\opencv-cpp-3.2.0-headers.zip_1b8591564854592a4aff6bd224b2b0a3",
                "C:\\Users\\thadh\\Documents\\GradleJava\\build\\tmp\\expandedArchives\\wpilibc-2018.3.2-headers.zip_4790c768d89540161556bab2475dfed0",
                "C:\\Users\\thadh\\Documents\\GradleJava\\build\\tmp\\expandedArchives\\ntcore-cpp-4.0.0-headers.zip_517391151665b6a51f10f788c06ee62d",
                "C:\\Users\\thadh\\Documents\\GradleJava\\build\\tmp\\expandedArchives\\ni-libraries-2018.3.2-headers.zip_55705e66b0e6e7d3459ef1e0f179830e",
                "C:\\Users\\thadh\\Documents\\GradleJava\\build\\tmp\\expandedArchives\\wpiutil-cpp-3.1.0-headers.zip_8913f4f6489a6d0e0336260f474dc3a0",
                "C:\\Users\\thadh\\Documents\\GradleJava\\build\\tmp\\expandedArchives\\CTRE-phoenix-cpp-5.2.1.1-headers.zip_ed51ae3396f2e2d306a9f6a233af2bce",
                "C:\\Users\\thadh\\Documents\\GradleJava\\build\\tmp\\expandedArchives\\navx-cpp-3.0.346-headers.zip_bdc8378de58d7490d517245a513e81b3",
                "C:\\Users\\thadh\\Documents\\GradleJava\\src\\include",
                "C:\\Users\\thadh\\Documents\\GradleJava\\src\\cpp"
            ],
            "defines": [],
            "compilerPath": "C:\\frc\\bin\\arm-frc-linux-gnueabi-g++.exe"
        }
    }
]
bobbrow commented 6 years ago

Hi @ThadHouse, I haven't finished the back end implementation for this, so you won't be able to confirm the results yet (the back end just ignores the messages right now). Sorry about that. I hope to have it ready next week.

bobbrow commented 6 years ago

duplicate of #2015

ThadHouse commented 6 years ago

Cool. Definitely will be playing around with that. Building a vscode extension to hook into Gradle's C++ builds, and the API makes that actually possible.