vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

No autocompletion for C/C++ goto labels

Open Unturned3 opened this issue 3 years ago • 6 comments

Bug type: Language Service

Describe the bug

The autocompletion engine doesn't seem to provide suggestions for goto statement labels in C/C++.

  • OS and Version: MacOS Monterey, 12.1
  • VS Code Version: 1.67.2
  • C/C++ Extension Version: v1.9.8
  • Other extensions you installed (and if the issue persists after disabling them): C/C++ Extension Pack

Steps to reproduce

  1. Open any C/C++ source file
  2. Write a dummy goto label anywhere in main, e.g. test_label:
  3. Write goto test, and wait for autocompletion

Either nothing shows up, or unrelated variables / functions containing the string "test" are suggested.

Expected behavior

Autocomplete should suggest test_label to complete the goto statement

Screenshot image

Unturned3 avatar May 27 '22 16:05 Unturned3

I've filed a feature request on VS at https://developercommunity.visualstudio.com/t/CC-IntelliSense-completion-for-goto-l/10058527 (shared component).

sean-mcmanus avatar May 31 '22 22:05 sean-mcmanus

Hello @sean-mcmanus , are there any updates on this issue? If this is an intended behavior, may I ask what's the rationale behind it?

Thank you for your help!

Unturned3 avatar Jul 22 '23 04:07 Unturned3

@Unturned3 No update. It is the intended behavior because the completion for goto labels was never implemented. So it's debatable whether it should classify as a bug or enhancement/feature request.

sean-mcmanus avatar Jul 24 '23 18:07 sean-mcmanus

I have also found this feature to be inexplicable missing. Maybe it's an ideological aversion to goto.

Plashu avatar Sep 01 '23 05:09 Plashu

@Plashu It's not an ideological aversion to goto, although for C++ there are usually better choices.

sean-mcmanus avatar Sep 20 '23 16:09 sean-mcmanus

Still no updates? I too would like autocompletion for goto labels 🤷‍♀️

okurka12 avatar Oct 17 '24 10:10 okurka12

+1

cD1rtX3 avatar Aug 18 '25 03:08 cD1rtX3