microsoft / microsoft/vscode-cmake-tools

vscode intellisense doesn't work with cmake

Open
#1,571 7 comments 1 reaction 0 assignees View on GitHub
Feature: cpptools integration investigation needed
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

Hi, I just want to use CMake with vscode and link with Opencv library. After configure the CMakeList.txt, everything works fine.
But when I am trying to add other head file and cpp file. The intellisense of vscode seems stop working.

![Screenshot from 2020-11-25 12-03-29](https://user-images.githubusercontent.com/18361777/100182081-ba850d80-2f16-11eb-9af8-4076caa96c85.png)
It said #inlcude errors detected based on information provieded by the configuration provider settings.

What I set in settings is following the vscode instruction,
![Screenshot from 2020-11-25 12-09-00](https://user-images.githubusercontent.com/18361777/100182209-0637b700-2f17-11eb-86ef-c5c25691d13a.png)

The project build and run successfully, so I think the problem is only for intellisense.

What I have tried else but didn't solve the error:
1.add include path to includePath and point compileCommands to compile_commands.json
![Screenshot from 2020-11-25 12-13-29](https://user-images.githubusercontent.com/18361777/100182469-a7bf0880-2f17-11eb-9eae-054d5072ce60.png)

Many thanks if can have some help.

- **Operating System**:
- **CMake Version**: <3.16.3>
- **VSCode Version**: <1.15.1>
- **CMake Tools Extension Version**: <1.5.3>
- **Compiler/Toolchain**:

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the report with the mentioned CMakeLists.txt, compile_commands.json, VS Code settings, Ubuntu, GCC 9.3.0, and the listed extension versions. Trace how CMake configuration supplies IntelliSense include information, then verify that adding header and cpp files no longer produces include errors while the project still builds and runs.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, opencv, vscode
Domain
build-system, developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.