microsoft / microsoft/vscode-cpptools
Using dot '.' as member access operator fails to trigger auto completion/intellisense when used inside macro.
Nobody has claimed this yet.
- 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.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:
- 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
}
- Go to 'func' function and type in 'myMacro(container'
- Now when we type access member operator '.' normally popup with suggestions should appear - but it doesn't.
- 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
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.
Research direction
Reproduce the issue in file.hpp using VS Code 1.108.2 and the C/C++ extension 1.32.2, starting with the macro call in func and comparing '.' with '->'. Trace the completion behavior for member access inside macro arguments; done means '.' opens the same member suggestions as '->', including when Trigger Suggest is invoked.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100