microsoft / microsoft/vscode-cpptools

Intellisense doesn't work correctly

Aperta
#12,753 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug investigate: repro Language Service
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

Environment
  • OS and Version: MacBook Pro Sonoma 14.5
  • VS Code Version: 1.93.1 (Universal)
  • C/C++ Extension Version: v1.21.6
Bug Summary and Steps to Reproduce

Bug Summary: The intellisense sometimes show errors that aren't present in the code and sometimes doesn't show error that are present in the code.

I also tried to change the compiler used by the intellisense with this command: C/C++: Select IntelliSense Configuration...
and the problem persist

Steps to reproduce:
write this on a file:
#include
#include

using namespace std;

int main(){
int a,b;
vector arr;
int index = lower_bound(arr.begin(),arr.end(),a) - arr.begin();
}

this generates a problem with the intellisense on line 10: "no suitable conversion function from "std::__1::__wrap_iter<std::__1::vector<int, std::__1::allocator>::pointer>" (aka "std::__1::__wrap_iter<int *>") to "int" exists"

Expected behavior:
there is no error and the code compiles fine

Configuration and Logs
c_cpp_properties.json:
{
    "configurations": [
        {
            "name": "Mac",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "macFrameworkPath": [
                "/Library/Developer/CommandLineTools/SDKs/MacOSX14.5.sdk/System/Library/Frameworks"
            ],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c17",
            "intelliSenseMode": "macos-clang-arm64"
        }
    ],
    "version": 4
}
Logs from the language server logging:
I cannot send them because they are too long and the request would exceed the 65536 limit of characters (added them in the logs)
Other Extensions

the issue is present even when c/c++ is the only installed/enabled extension

Additional context

No response

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Iniziate riproducendo la diagnostica segnalata con lo snippet C++ fornito, c_cpp_properties.json e la configurazione macOS clang indicata. Esaminate i log del language server citati nell’issue e confrontate le diagnostiche di IntelliSense con il risultato del compilatore. Il lavoro è completato quando l’espressione lower_bound valida non produce più un errore falso, mentre gli errori autentici continuano a essere segnalati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp
Ambito
devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.