vscode-cpptools
vscode-cpptools copied to clipboard
IntelliSense does not recognize nested functions (GCC extension)
I use nested functions in C (GNU C extension https://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Nested-Functions.html ) and found it very helpful in some situation. Unfortunately IntelliSense does not support them. Are there any plans to add correct handling of this GNU C extension?
We can add it to the backlog, but this is not likely something we would address anytime soon.
Please add it.
+1 I use these extensively. Very convenient sometimes to let the compiler figure out variable scope, etc instead of explicitly coding long extension lists. Also it's one of the few ways to grant a qsort comparator knowledge of the environment in which it is invoked.
Is there at least a way to disable (suppress) that warning?
@raggesilver What warning are you referring to? You can set errorSquiggles to "Disabled" to disable all messages, but we don't have a way to remove certain ones.
+1 I'd be really glad to see this feature added. I really like the error squiggles in general because they are genuinely helpful in finding bugs even before compilation. It's just really annoying how a single use of a nested function fills the entire rest of the file with those squiggles...
Please add a +1 (thumbs up) to the first post so we can track the priority of this feature request better.
Is there any mentoring instruction? I can think to try to work on it if you get me any hints on where should I look.
I like vcode but our project use nested function intensely so I cannot adopt it if this issue is not solved.
@la10736 Our parser code is not open source.
Ok, fine!
This repro's in VS. (We share common IntelliSense components with VS). I opened a bug against VS here: https://developercommunity.visualstudio.com/content/problem/794903/intellisense-in-gcc-mode-does-not-recognize-nested.html
This problem will soon celebrate its fifth anniversary. Will this ever be fixed? Other GCC extensions seem to be supported (at least, they aren't marked as an error).
@ArmoredPony It's a missing feature in our parser that we'd have to get the parser team to add. This is the 2nd or so most upvoted IntelliSense-related feature so that makes it more of a priority, but I don't have any ETA yet.
I would love for this to be fixed; I work with code that uses nested functions often, and the error squiggles are an annoyance.
Now it's 2023, we do need this feature 💔 .
its 2024 common guys xd