microsoft / microsoft/vscode-cpptools
vcFormat incorrectly formatting templates with lambda parameters
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 6.2k
- Fork
- 1.7k
- Merge medio
- 14h 46m
- PR unite (30g)
- 61
Descrizione
Environment
- OS and Version: Windows_NT x64 10.0.19045
- VS Code Version: 1.79.2
- C/C++ Extension Version: v1.16.1
Bug Summary and Steps to Reproduce
Settings:
"C_Cpp.default.cppStandard": "c++23",
"C_Cpp.default.cStandard": "c17",
"C_Cpp.default.intelliSenseMode": "windows-gcc-x64",
"C_Cpp.default.compilerPath": "C:\msys64\ucrt64\bin\g++.exe",
"C_Cpp.autoAddFileAssociations": false,
"C_Cpp.suggestSnippets": false,
"C_Cpp.formatting": "vcFormat",
"C_Cpp.vcFormat.wrap.preserveBlocks": "allOneLineScopes",
"C_Cpp.vcFormat.indent.gotoLabels": "oneLeft",
"C_Cpp.vcFormat.indent.caseLabels": true,
"C_Cpp.vcFormat.newLine.closeBraceSameLine.emptyFunction": true,
"C_Cpp.vcFormat.newLine.closeBraceSameLine.emptyType": true,
"C_Cpp.vcFormat.indent.multiLineRelativeTo": "statementBegin",
"C_Cpp.vcFormat.newLine.beforeElse": false,
"C_Cpp.vcFormat.newLine.beforeCatch": false,
"C_Cpp.vcFormat.space.withinInitializerListBraces": false,
"C_Cpp.vcFormat.indent.preserveWithinParentheses": true,
"C_Cpp.vcFormat.space.pointerReferenceAlignment": "right",
"C_Cpp.vcpkg.enabled": false,
"C_Cpp.default.defines": [],
"C_Cpp.loggingLevel": "Information",
"C_Cpp.simplifyStructuredComments": false,
"C_Cpp.errorSquiggles": "disabled",
"C_Cpp.codeAnalysis.runAutomatically": false,
"C_Cpp.dimInactiveRegions": false,
"C_Cpp.intelliSenseEngine": "Tag Parser",
"C_Cpp.vcFormat.indent.lambdaBracesWhenParameter": false
Expected behavior:
using lambda1 = std::type_identity_t<[] {}>;
template<class T>
using lambda2 = []<size_t> -> T { return {}; };
After formatting:
using lambda1 = std::type_identity_t < [] {} > ;
template<class T>
using lambda2 = []<size_t>->T { return {}; };
Configuration and Logs
-------- Diagnostics - 6/21/2023, 2:06:19 AM
Version: 1.16.1
Current Configuration:
{
"name": "Win32",
"includePath": [
"c:\\Users\\Aleksandras\\Desktop\\programming\\Solutions\\QAP_BA/**"
],
"windowsSdkVersion": "10.0.19041.0",
"defines": [],
"cStandard": "c17",
"cppStandard": "c++23",
"intelliSenseMode": "windows-gcc-x64",
"intelliSenseModeIsExplicit": true,
"cStandardIsExplicit": true,
"cppStandardIsExplicit": true,
"mergeConfigurations": false,
"compilerPath": "C:\\msys64\\ucrt64\\bin\\g++.exe",
"compilerPathIsExplicit": true,
"browse": {
"path": [
"${workspaceFolder}/**"
],
"limitSymbolsToIncludedHeaders": true
}
}
cpptools version (native): 1.16.1.0
No active translation units.
------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 35090
Number of files parsed: 6811
Other Extensions
No response
Additional context
No response
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
L’issue nomina il formatter vcFormat, ma non indica alcun file sorgente né un percorso di test; inizia riproducendo gli snippet C++23 forniti con le impostazioni di formattazione elencate. Traccia la gestione da parte di vcFormat dei parametri lambda e della sintassi dei template, quindi verifica che l’output formattato preservi la spaziatura e la sintassi previste.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp, vscode
- 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