microsoft / microsoft/vscode-cpptools

Intellisense suggestions does not work inside a template lambda and a macro.

Open
#11,751 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Environment
  • OS and Version: Windows 10
  • VS Code Version: 1.84.2
  • C/C++ Extension Version: v1.18.5
Bug Summary and Steps to Reproduce

Bug Summary:
Intellisense suggestions does not work when inside a template lambda and a macro at the same time.

#define MACRO(x) x
struct Test{
    void func() {  }
};

void main(){
    Test test;
    auto lambda = [&](auto a){
        test. // OK
        MACRO(test.) // NOT WORK
    };
    auto lambda2 = [&](int a){
        MACRO(test.) // OK
    };
}

Steps to reproduce:

  1. Create an empty folder, create a file.cpp with the contents of the example. Open the folder.
  2. Move cursor after test., press Ctrl+Space.
  3. See error: no suggestion of func
Configuration and Logs
Configuration: without `c_cpp_properties.json` (all properties are default)
Other Extensions

No response

Additional context

No response

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

Reproduce the issue in the reported file.cpp using VS Code with the C/C++ extension, then compare Ctrl+Space suggestions inside the direct template lambda expression and inside MACRO(test.). Trace the IntelliSense handling for the combined template-lambda and macro context; done means func is suggested in the macro case as it is in the other examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.