Skip to content

Using dot '.' as member access operator fails to trigger auto completion/intellisense when used inside macro. #14604

Description

@mehlian

Environment

  • OS and Version: Windows 10
  • VS Code Version: 1.108.2
  • C/C++ Extension Version: 1.32.2
  • If using SSH remote, specify OS of remote machine: none

Bug Summary and Steps to Reproduce

Bug Summary:
There is a feature that allows to type '.' as access member operator on any type to show completion window with all members and then it resolves to '.' or '->' automatically.
This feature fails when used inside macro call.

Steps to reproduce:

  1. Paste code (file.hpp):
#define myMacro(value) 

struct MyStruct
{
    int value;
};

struct Container
{
    int value2;
    MyStruct *myStruct;
};

void func(Container *container)
{
    myMacro(container.                         // <- problem here
}
  1. Go to 'func' function and type in 'myMacro(container'
  2. Now when we type access member operator '.' normally popup with suggestions should appear - but it doesn't.
  3. Instead of '.' type '->' - suggestions appear.

Expected behavior:
After typing '.' in macro call we should see suggestions with struct members just like after typing '->'.
'Trigger Suggest' command (CTRL+SPACE) doesn't work on '.' but works after '->' when used in macro call.

Configuration and Logs

ask for more details

Other Extensions

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status
    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions