Create Declaration / Definition with wrong name space (and possibly scope) in C
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Riproduci il problema con una funzione statica e un parametro struct in main.c, quindi invoca il comando “C/C++: Create Declaration/Definition” ed esamina il main.h generato. Segui il punto di ingresso della generazione delle dichiarazioni del comando e aggiungi una copertura per mantenere le dichiarazioni statiche in main.c e preservare lo specificatore struct; il lavoro è completato quando entrambe le dichiarazioni generate rimangono C valido.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Environment
- OS and Version: Windows 11 Pro 22H2
- VS Code Version: 1.79.2
- C/C++ Extension Version: 1.16.3
Bug Summary and Steps to Reproduce
Bug Summary:
Steps to reproduce:
- Create a new C source file, as "main.c"
- Add the definition of some
staticfunctions; create some with astructtype parameter - Position the cursor on a function name
- Recall with ctrl+shift+P the function "C/C++: Create Declaration/Definition"
- A file named "main.h" is opened and the prototype added
- Note that
- even if the function is declared as
statica prototype is created in another file/header ("main.h") - only if you have the precedent function already declared in "main.c" then the prototype goes to "main.c" as well (expected behavior)
- if your function has
structparameters thestructtype specifier is removed, e.g.static int foo(struct MyStruct *p) {}becomesstatic int foo(MyStruct *p);which is unlikely workable, as tag space differs from identifiers space in C
Expected behavior:
- The declaration of
staticfunctions shall/should always be directed to the same file the functions are in - The
structtype specifier shall always be retained in C, as it directs identifiers in the tag namespace
Configuration and Logs
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.22621.0",
"compilerPath": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-msvc-x86",
"configurationProvider": "ms-vscode.makefile-tools",
}
],
"version": 4
}
Other Extensions
No response
Additional context
No response
- Lingua principale
- TypeScript
- Stelle
- 6.2k
- Fork
- 1.7k
- Merge medio
- 14h 46m
- PR unite (30g)
- 61
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.
Altre issue di microsoft/vscode-cpptools
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
microsoft/vscode-cpptools#14787 ·
-
[Bug] cpptools fails to start on Ubuntu ARM64 due to missing execute permissions on shared libraries Apertabug fixed Language Service regression
microsoft/vscode-cpptools#14779 · 1 assegnatario ·
-
Language Service more info needed
microsoft/vscode-cpptools#14778 · 1 commento · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 64/100
microsoft/vscode-cpptools#14769 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
microsoft/vscode-cpptools#14768 · 1 commento ·
Tutte le issue di microsoft/vscode-cpptools
Issue simili
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
-
code-quality refactoring
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
langchain-ai/deepagents#6450 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
vercel/react-tweet#225 ·