Repository navigation
Macro comment displays instead of function instead of #14744
Copy link
Copy link
Open
Labels
Feature: Doc commentsAn issue related to code comments shown in hover, completion, and signature help.An issue related to code comments shown in hover, completion, and signature help.Language ServiceVisual StudioInherited from Visual StudioInherited from Visual Studiobug
Milestone
Description
Environment
- OS and Version: Windows 11
- VS Code Version: 1.136.1
- C/C++ Extension Version: 1.5.1
Bug Summary and Steps to Reproduce
Bug Summary:
When hovering over function definition, the comments of the macro creating the function name is shown instead of the function's ones.
Steps to reproduce:
Write this code:
// hello
#define deffunc(name) name
int deffunc(funcA)();
int main(){
funcA();
return 0;
}
and hover over funcA. hello is displayed instead of nothing.
I saw this behaviour first in AudioKinetic's SDK, due to there being a ton of macro for function export so I suspect this is a bug.
Configuration and Logs
# c_cpp_properties.json
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.22621.0",
"compilerPath": "cl.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-msvc-x64"
}
],
"version": 4
}
# Diag Log
-------- Diagnostics - 9/5/2026, 10:28:24 PM
Version: 1.33.8
Current Configuration:
{
"name": "Win32",
"includePath": [
"d:/Projects/Temp/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.22621.0",
"compilerPath": "cl.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-msvc-x64",
"compilerPathIsExplicit": true,
"cStandardIsExplicit": true,
"cppStandardIsExplicit": true,
"intelliSenseModeIsExplicit": true,
"recursiveIncludesPriorityIsExplicit": false,
"recursiveIncludesOrderIsExplicit": false,
"compilerPathInCppPropertiesJson": "cl.exe",
"mergeConfigurations": false,
"recursiveIncludes": {},
"browse": {
"limitSymbolsToIncludedHeaders": true
}
}
Additional Tracked Settings:
{
"editorTabSize": 4,
"editorInsertSpaces": true,
"editorAutoClosingBrackets": "languageDefined",
"filesEncoding": "utf8",
"filesAssociations": {},
"filesExclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/.DS_Store": true,
"**/Thumbs.db": true
},
"filesAutoSaveAfterDelay": false,
"editorInlayHintsEnabled": true,
"editorParameterHintsEnabled": true,
"searchExclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/*.code-search": true
},
"workbenchSettingsEditor": "ui"
}
cpptools version (native): 1.33.7.0
Current database path: C:\Users\Khanh\AppData\Local\Microsoft\vscode-cpptools\834ddd22c2e1fcafd4ae772b1bf9f43b\.BROWSE.VC.DB
No active translation units.Other Extensions
None
Additional context
No response
Metadata
Metadata
Assignees
Labels
Feature: Doc commentsAn issue related to code comments shown in hover, completion, and signature help.An issue related to code comments shown in hover, completion, and signature help.Language ServiceVisual StudioInherited from Visual StudioInherited from Visual Studiobug
Type
Projects
- StatusShow more project fieldsTodo
Activity
kavyansh18 commentedon Sep 5, 2026
I looked into this a bit to see whether the issue could be fixed in the extension layer. From tracing the hover request path, it looks like the hover content (including the unexpected hello comment) is coming from the native IntelliSense/language-server side, with the extension mainly passing the response through.
My current suspicion is that the macro expansion is causing the QuickInfo/comment lookup to associate the macro's comment with the generated function declaration. I couldn't confirm the exact native-side behavior since that source doesn't appear to be included in this repository.
If that's indeed where the issue originates, it seems like the fix would need to be made in the native IntelliSense backend rather than by filtering the hover result in the extension.
Just sharing what I found in case it helps narrow down the issue.
sean-mcmanus commentedon Sep 8, 2026
KAVYANSH KUMAR (@kavyansh18) The bug is inherited from (shared with, also repros with) the VS implementation.
kavyansh18 commentedon Sep 8, 2026
Thanks Sean McManus (@sean-mcmanus) for confirming! Glad I could help narrow down the root cause.