microsoft / microsoft/vscode-cpptools

IntelliSense errors with importing a module on Windows with cl.exe

Open
#9,965 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Feature: Configuration investigate: repro Language Service modules Works in VS
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

    Ok, some progress:

I've created a new simpler project with one module but this time, I've created from Visual Studio 2022 Community CMake project wizard.

This time Visual Studio has no problem in finding the module (you must compile it twice for it to work properly - because the first time it generates the ifc files):

image

VSCode still can't see it:

image

The CMake project uses presets when created with VS wizards.

In both I can compile, run, and debug normally.

And if I force the /ifcSearchDir into CMakeLists.txt VSCode gives me the edgm error (VS does see the modules and finds the ifc files without setting this manually in the CMakeLists.txt). I noticed that .command files were generated in the build destination, and they have all the compilers parameters that are necessary to compile each file. My guess is that VS is using it to correctly generate the Intellisense and find everything.

Originally posted by @Bigous in https://github.com/microsoft/vscode-cpptools/issues/6302#issuecomment-1269190650

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the module-import IntelliSense failure in the linked Visual Studio 2022 CMake project, using its presets and cl.exe. Compare the generated .command files and CMakeLists.txt, including /ifcSearchDir, to determine how compiler parameters are discovered. Done means VS Code finds the generated .ifc module files without manual configuration and no longer reports the edgm error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, 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.