Outline view flattens symbols inside `operator""` (user-defined literal) function

Open
#14,150 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
tooling

Research direction

Start with the minimal C++ user-defined literal example in the issue and inspect the outline symbol parsing path used by the VS Code extension. Done means the outline shows operator""_T as the function and nests var_1, foo, and var_2 instead of treating them as top-level symbols.

Written by the indexing model from the issue text.

Description

bug Language Service parser Visual Studio
Discussed in https://github.com/microsoft/vscode-cpptools/discussions/14019

Originally posted by coshz October 26, 2025
I've noticed that VS Code outline view treats symbols inside user-defined literal function, instead of operator"" itself, as top-level symbols. Example code:

void operator""_T(const char* str, size_t n)
{
    auto foo = [](auto s) { return s; };
    std::string var_1 = std::string(str,n);
    foo(var_1);
    std::string var_2 = foo(var_1);
}

The outline view behavior (sort by position):

  • observed: var_1, foo, var_2;
  • expected: operator""_T(const char*, size_t).

Is this a known limitation of the symbol parser for user-defined literals?

Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

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.

More from microsoft/vscode-cpptools

All issues in microsoft/vscode-cpptools

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.