microsoft / microsoft/vscode-cpptools

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

オープン
#8,296 コメント 2 件 リアクション 0 件 担当者 1 名 GitHub で見る

@sean-mcmanus がすでに取り組んでいます。

2024年12月18日 から。

bug Feature: Configuration investigate: repro Language Service
主要言語
TypeScript
スター
6.2k
フォーク
1.7k
平均マージ
14時間 46分
マージ済み PR(30日)
61

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。