microsoft / microsoft/vscode-cpptools

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.

bug Language Service parser Visual Studio
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

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?

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

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.