microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.51k stars 1.55k forks source link

No autocompletion for C/C++ goto labels #9371

Open Unturned3 opened 2 years ago

Unturned3 commented 2 years ago

Bug type: Language Service

Describe the bug

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

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

sean-mcmanus commented 2 years ago

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

Unturned3 commented 1 year ago

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!

sean-mcmanus commented 1 year ago

@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.

Plashu commented 1 year ago

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

sean-mcmanus commented 1 year ago

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

okurka12 commented 1 day ago

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