-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function hover ignores static keyword #8173
Comments
@anthroid |
Assume you're working with a C API (a driver, library, or something that may have some exposed functions and some static functions), and your project is broken up into several translation units. You might have functions within the API that will autocomplete and be visible with Intellisense, making them appear to be functions that are usable, but then they don't compile if you try to call them. You check the function prototype in the hover tooltip and everything looks fine. Then you navigate to the source file itself (within the driver, library, etc) and see that the function is actually declared There are probably two angles to look at this:
|
Sorry to ask for more info, could you provide some sample code where this is occurring:
|
Please see an example here: |
Thank you for the sample code, we now understand the scenario where this feature will be valuable. This feature is not implemented yet and so this issue is set as "Feature Request". |
However, this wouldn't fix the fact that the static function still appears in auto-complete since IntelliSense isn't aware of linking issues such as functions that are never defined in a TU -- ideally, the static functions wouldn't be declared in the public headers. For example, there could be other static functions that are defined, and the only way to tell would be some naming convention that allows you to know the function is from some external library. |
The fix is available in https://github.com/microsoft/vscode-cpptools/releases/tag/1.8.0-insiders . |
Bug description
When hovering over a function call or a function definition, the
static
keyword is ignored and not displayed in the tooltip.Steps to reproduce
static
function inside a C translation unit.static
keyword is dropped.static
keyword is dropped.Expected behavior
The
static
keyword is important and should not be dropped in the hover tooltip. This can be misleading until you actually navigate to the function definition itself, where you see that the function is declaredstatic
.Screenshots
The text was updated successfully, but these errors were encountered: