microsoft / microsoft/vscode-cpptools

No autocompletion for C/C++ goto labels

Open
#9,371 9 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Feature: Auto-complete Language Service Visual Studio
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in a C/C++ source file: define a label inside main, type a partial goto target, and inspect the completion results. Trace the language-service completion path for goto statements; done means the matching label is suggested without unrelated variables or functions.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp, typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.