References on the destructor collapse to the whole type, or no results
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start with the extracted P1-dtor-Vec2.zip fixture, especially src/mathvec.h:15 and the destructor definition at src/mathvec.cpp:11. Run Find All References at both cursor positions and trace the textDocument/references handling; done means both positions return exactly the declaration and out-of-line definition, rather than 39 type references or no results.
Written by the indexing model from the issue text.
Description
Environment
cpptools — References on the destructor mv::Vec2::~Vec2() collapse to the whole type
| Field | Value |
|---|---|
| Symbol (spec id) | dtor-Vec2 |
| Declaration | ~Vec2(); (destructor) |
| Query position 1 | src/mathvec.h:15:6 (cursor on Vec2, immediately after the ~) |
| Query position 2 | src/mathvec.h:15:5 (cursor on the ~, immediately before Vec2) |
| Affected LSP request | textDocument/references |
| Repro archive | P1-dtor-Vec2.zip (this folder) |
Summary
For query position 1
Find All References on the destructor of mv::Vec2 returns every mention of the Vec2 type instead of the two destructor sites — even though the cursor is on the destructor name after the tilde. Observed in VS Code with the C/C++ extension (cpptools).
For query position 2
Find All References on the destructor of mv::Vec2 returns no results. Observed in VS Code with the C/C++ extension (cpptools).
Environment
- Editor: Visual Studio Code 1.33.5
- Extension: C/C++ (
ms-vscode.cpptools), default IntelliSense engine - Language standard: C++20 (freestanding fixture; no STL/toolchain required)
Steps to reproduce
- Extract
P1-dtor-Vec2.zipand open thecpp-projectfolder in VS Code (C/C++ extension enabled). - Optionally configure with CMake Tools (preset
cdb); the fixture also parses under default C++20 IntelliSense. - Open
src/mathvec.hand place the cursor either immediately after the~in~Vec2();, onVec2(line 15, col 6); or immediately before the~, on the tilde itself (line 15, col 5). - Invoke Find All References (
Shift+Alt+F12).
Expected vs actual
| Source | Result count |
|---|---|
| Expected (both positions) | 2 |
| cpptools — query position 1 | 39 |
| cpptools — query position 2 | 0 |
Expected (2): the declaration (mathvec.h:15) and the out-of-line definition (mathvec.cpp:11, Vec2::~Vec2()).
Actual — query position 1 (39): every occurrence of the Vec2 type (the same 39-item set as the constructor queries). Placing the cursor after the ~ does not restrict the query to the destructor — it collapses to "all mentions of the type."
Actual — query position 2 (0): no results at all.
Why it matters
Destructor references are used to reason about lifetime and teardown. Returning the whole type population makes that impossible and is especially surprising given the cursor is unambiguously on the destructor.
Bug Summary and Steps to Reproduce
Small repro soruce code:
P1-dtor-Vec2.zip
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode-cpptools
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/vscode-cpptools#14787 ·
-
[Bug] cpptools fails to start on Ubuntu ARM64 due to missing execute permissions on shared libraries Openbug fixed Language Service regression
microsoft/vscode-cpptools#14779 · 1 assignee ·
-
Language Service more info needed
microsoft/vscode-cpptools#14778 · 1 comment · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 64/100
microsoft/vscode-cpptools#14769 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
microsoft/vscode-cpptools#14768 · 1 comment ·
All issues in microsoft/vscode-cpptools
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·