microsoft / vscode-cpptools

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

[Regression] The 'Learn how to install a library for this header with vcpkg' option has disappeared #12413

Closed v-ericawu closed 1 week ago

v-ericawu commented 4 weeks ago

Environment

Bug Summary and Steps to Reproduce

Bug Summary: The 'Learn how to install a library for this header with vcpkg' option has disappeared

Steps to reproduce:

  1. Create a Test folder with .cpp file.
  2. Open Test folder with VS Code.
  3. Type error code in .cpp file, such as: #include"xxxxx.h"
  4. Hover over error squiggle and Click on 'Quick Fix'

Expected behavior: 'Learn how to install a library for this header with vcpkg' option appear image

Actual behavior: 'Learn how to install a library for this header with vcpkg' option has disappeared from C/C++ extension 1.17.2

Latest C/C++ extension version: 1.20.5 image

C/C++ extension 1.17.2: image

Configuration and Logs

/

Other Extensions

/

Additional context

No response

browntarik commented 3 weeks ago

Thank you for reporting this issue. This behavior is actually by design as we only want to suggest this code action for headers that are supported by vcpkg.

This does however bring to light a bug where this code action is not appearing even for such headers like #include <zlib.h>.

It looks like we were incorrectly parsing our vcpkg header database. Please keep tracking this issue to be notified when a fix is checked in.

sean-mcmanus commented 1 week ago

Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.21.1

v-ericawu commented 1 week ago

@sean-mcmanus Verified on C/C++ 1.21.1(pre-release) still repro this issue, so could you help to re-confirm it? image

Colengms commented 1 week ago

Hi @v-ericawu . To clarify, you wouldn't get that option for "xxxxx.h". The feature applies only if the header is from a library supported by vcpkg. Try geos.h:

image

v-ericawu commented 1 week ago

@Colengms @sean-mcmanus Thanks for your confirmation! using ''geos.h'' will bring up the 'Learn how to install a library for this header with vcpkg' option: image