microsoft / microsoft/vscode-cpptools

IntelliSense fails to find headers using cl.exe #include "" Microsoft-specific search rules (i.e. -Wmicrosoft-include)

Abierto
#8,296 2 comentarios 0 reacciones 1 asignado Ver en GitHub

@sean-mcmanus ya está trabajando en esto.

Desde el 18/12/2024.

bug Feature: Configuration investigate: repro Language Service
Lenguaje dominante
TypeScript
Estrellas
6.2k
Forks
1.7k
Merge medio
14 h 46 min
PR fusionados (30 d)
61

Descripción

Disable recursive includes and use msvc or clang mode.

  • root
    • sub1 (folder)
      • sub1_2.h
      • sub1.h
    • sub2 (folder)
      • sub2.h
    • main.cpp

main.cpp
#include "sub1/sub1.h"

sub1.h
#include "sub2/sub2.h"

sub2.h
#include "sub1_2.h"

Bug: This compiles with cl.exe (and clang, although it gives the warning from -Wmicrosoft-include), but IntelliSense fails to find the headers. See documentation at https://docs.microsoft.com/en-us/cpp/preprocessor/hash-include-directive-c-cpp?view=msvc-160 . The code isn't compilable with gcc, so it's non-portable, i.e. not recommended for new code, but legacy code might rely on the behavior.

I haven't checked if this repros with VS, and I'm not sure if it's a bug with our shared parser or if we're expected to emulate the search order ourselves.

I found this issue while investigating how to correctly deal with the clang-tidy include processing.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.