microsoft / microsoft/vscode-cpptools
Auto detection of clang-format and clang-tidy in the PATH isn't working?
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 6.2k
- Fork
- 1.7k
- Merge medio
- 14h 46m
- PR unite (30g)
- 61
Descrizione
> @taoran-git Doing a Reload Window should fix it -- the path is cached. See https://github.com/microsoft/vscode-cpptools/blob/main/Extension/src/LanguageServer/settings.ts#L111 . If that doesn't fix it, can you file a new issue on the bug?
Thank you for your reply. My issue persists and is pretty much the same as https://github.com/microsoft/vscode-cpptools/issues/8520. I now suspect that auto-detection of clang-format was broken even before updating llvm to 15. Things worked fine only because the extension-bundled clang-format WAS up-to-date with the .clang-format file. After adding some clang-format-15-exclusive options to my .clang-format file, the extension-bundled formatter stop working. This is indeed expected though.
What really goes wrong is that the extension never invokes the clang-format in my $PATH.
To reassure,
echo $PATH
gives me /usr/local/opt/llvm/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin:/usr/local/opt/llvm/bin:/opt/local/bin:/opt/local/sbin
Manually setting C_Cpp.clang_format_path fixes the problem. But a cross platform solution would be really appreciated.
Originally posted by @taoran-git in https://github.com/microsoft/vscode-cpptools/issues/9816#issuecomment-1290088933
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia da Extension/src/LanguageServer/settings.ts intorno alla riga 111 e verifica il comportamento di caching di PATH e di rilevamento automatico descritto in issue 8520. Riproduci il problema con clang-format e clang-tidy disponibili in PATH, confrontalo con l’impostazione manuale di C_Cpp.clang_format_path e conferma che il rilevamento funzioni su tutte le piattaforme senza richiedere l’impostazione esplicita.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp, typescript
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100