Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntelliSense does not work for files not in folder with a CMake configured project #1425

Closed
robotdad opened this issue Sep 3, 2020 · 14 comments
Assignees
Labels
bug a bug in the product embedded Feature: cpptools integration more info needed More info is needed from the community for us to properly triage and investigate.
Projects
Milestone

Comments

@robotdad
Copy link
Member

robotdad commented Sep 3, 2020

Type: LanguageService

Describe the bug

  • OS and Version: Windows 10
  • VS Code Version: 1.48.2
  • C/C++ Extension Version: .29
  • Other extensions you installed (and if the issue persists after disabling them): Lots
  • Does this issue involve using SSH remote to run the extension on a remote machine?: No
  • A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).

Steps to reproduce

  1. Clone https://github.com/azure-rtos/getting-started with --recursive
  2. Open the subfolder MXChip/AZ3166/
  3. Configure settings for CMake
    {
    "cmake.configureArgs": [
    "-DCMAKE_TOOLCHAIN_FILE=../../cmake/arm-gcc-cortex-m4.cmake"
    ],
    "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
    "cortex-debug.openocdPath": "C:/tools/OpenOCD/bin/openocd.exe"
    }
  4. Open main.c

Expected behavior

Correct IntelliSense, especially as project can build. The files that are flagged as not found are not in the project folder but are configured for the CMake build.

Logs
-------- Diagnostics - 9/3/2020, 3:31:15 PM
Version: 0.29.0
Current Configuration:
{
    "name": "Win32",
    "includePath": [
        "${workspaceFolder}/**"
    ],
    "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE"
    ],
    "windowsSdkVersion": "10.0.18362.0",
    "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.28.29231/bin/Hostx64/x64/cl.exe",
    "cStandard": "c11",
    "cppStandard": "c++17",
    "intelliSenseMode": "msvc-x64",
    "compilerArgs": [],
    "configurationProvider": "ms-vscode.cmake-tools",
    "browse": {
        "path": [
            "${workspaceFolder}/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Custom browse configuration: 
{
    "browsePath": []
}
Translation Unit Mappings:
[ C:\source\scratch\getting-started\MXChip\AZ3166\app\main.c ]:
    C:\SOURCE\SCRATCH\GETTING-STARTED\MXCHIP\AZ3166\APP\MAIN.C
Translation Unit Configurations:
[ C:\source\scratch\getting-started\MXChip\AZ3166\app\main.c ]:
    Process ID: 14476
    Memory Usage: 12 MB
    Compiler Path: C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.28.29231/bin/Hostx64/x64/cl.exe
    Includes:
        C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PREVIEW\VC\TOOLS\MSVC\14.28.29231\INCLUDE
        C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PREVIEW\VC\TOOLS\MSVC\14.28.29231\ATLMFC\INCLUDE
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UM
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\SHARED
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\WINRT
        C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\CPPWINRT
        C:\SOURCE\SCRATCH\GETTING-STARTED\MXCHIP\AZ3166\LIB\STM32CUBEF4\DRIVERS\STM32F4XX_HAL_DRIVER\INC
        C:\SOURCE\SCRATCH\GETTING-STARTED\MXCHIP\AZ3166\LIB\STM32CUBEF4\CONFIG
        C:\SOURCE\SCRATCH\GETTING-STARTED\MXCHIP\AZ3166\LIB\STM32CUBEF4\DRIVERS\STM32F4XX_HAL_DRIVER\INC\LEGACY
        C:\SOURCE\SCRATCH\GETTING-STARTED\MXCHIP\AZ3166\LIB\STM32CUBEF4\DRIVERS\CMSIS\DEVICE\ST\STM32F4XX\INCLUDE
        C:\SOURCE\SCRATCH\GETTING-STARTED\MXCHIP\AZ3166\LIB\STM32CUBEF4\DRIVERS\CMSIS\INCLUDE
    Defines:
        _DEBUG
        UNICODE
        _UNICODE
    Standard Version: c11
    IntelliSense Mode: msvc-x64
Total Memory Usage: 12 MB


Screenshots

image

Additional context

@sean-mcmanus
Copy link
Contributor

Your logs indicate the CMake Tools extension is sending us no configuration data -- blank custom browse configuration and Custom configurations section. Is the CMake Tools extension properly configured?

@sean-mcmanus sean-mcmanus transferred this issue from microsoft/vscode-cpptools Sep 3, 2020
@robotdad
Copy link
Member Author

robotdad commented Sep 3, 2020

The project builds with the CMake extension. Is there some diagnostic info I can collect from it that would help?

@sean-mcmanus
Copy link
Contributor

Configuration works for me when I use the arm-none-eabi 6.3.1 kit. What kit are you using and how do I install it?

@robotdad
Copy link
Member Author

robotdad commented Sep 3, 2020

Are you using the toolchain file as shown above? I don't have a kit specified, it didn't recognize my arm-gcc installation.

@sean-mcmanus
Copy link
Contributor

Yeah, I have "cmake.configureArgs": [ "-DCMAKE_TOOLCHAIN_FILE=../../cmake/arm-gcc-cortex-m4.cmake" ] set. Looks like I'm getting a cmake build error though. I might not have the required build tools installed.

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Sep 4, 2020

vswhere.exe isn't able to locate my gcc_arm for some reason (16.8 Preview 3)

@sean-mcmanus
Copy link
Contributor

I added -prerelease to the call to vswhere to fix the build issue and I reproed the bug.

CMake Tools isn't sending the configuration info.

@andreeis andreeis added this to the Backlog milestone Oct 19, 2020
@aleun aleun added the embedded label Dec 10, 2020
@davepiar
Copy link

We're facing the same issue in our company, as we work with cmake projects in a multi-root workspace environment. Do you have any plans to fix it?

@sean-mcmanus
Copy link
Contributor

@thepineda It isn't currently on our schedule to fix, but the CMake Tools extension is open source so you could contribute a fix.

@bobbrow
Copy link
Member

bobbrow commented Apr 13, 2021

@robotdad, @aleun, is this something your team would like to take ownership of? We should discuss in our next sync.

@allo-
Copy link

allo- commented Jul 2, 2021

Is this a regression?
Currently I have the same problem, header files outside of the project root are not found automatically even when the cmake build works correctly and I did not touch the code for a few months (and it worked before).
It did not work with the code folder as it was untouched and reconfiguring in different ways does not resolve the problem either.

@gcampbell-msft gcampbell-msft added this to Triage in 1.15 via automation Jul 6, 2023
@gcampbell-msft gcampbell-msft modified the milestones: Backlog, 1.15 Jul 6, 2023
@gcampbell-msft gcampbell-msft moved this from Triage to To do in 1.15 Jul 6, 2023
@gcampbell-msft gcampbell-msft self-assigned this Jul 6, 2023
@gcampbell-msft
Copy link
Collaborator

@robotdad Have you hit this issue recently? I just attempted the repro steps and everything seems to work as expected.

I should mention that to reproduce this I cloned a brand new project and started completely from scratch (including vcpkg).

@sean-mcmanus Were you ever able to repro the issue or did it behave as expected for you as well?

@gcampbell-msft gcampbell-msft added the more info needed More info is needed from the community for us to properly triage and investigate. label Jul 14, 2023
@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Jul 14, 2023

@gcampbell-msft According to my comment 3 years ago at #1425 (comment) I was reproing the issue.

@gcampbell-msft
Copy link
Collaborator

Based on the age of this issue, and the fact that I've tried the repro steps and the issue seems to be resolved, I'm closing the issue.

FYI @sean-mcmanus @robotdad. @robotdad Please open another issue if this continues to be an issue for you. Thanks!

1.15 automation moved this from To do to Done Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug in the product embedded Feature: cpptools integration more info needed More info is needed from the community for us to properly triage and investigate.
Projects
No open projects
1.15
Done
Development

No branches or pull requests

8 participants