-
Hello! I am not sure if I'm in the right place for this, but by everything I can find,
And this is what the debug log of the extension has to say: If you want full context of the code, below is the link to the folder in question. It's just me relearning red-black trees and trying to get myself up to speed with parts of C++20 at the same time. :) https://github.com/dvoraen/cpp-research/tree/main/tree So I have the following questions:
The snippets below are my C/C++ extension settings and workspace settings. (I have not included User settings for the sake of brevity, and they don't seem to apply here, as they aren't modifying IntelliSense.)
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.22000.0",
"compilerPath": "cl.exe",
"cStandard": "c17",
"cppStandard": "c++20",
"intelliSenseMode": "windows-msvc-x64"
}
],
"version": 4
}
{
"C_Cpp.default.cppStandard": "c++20",
"C_Cpp.autoAddFileAssociations": false,
"C_Cpp.inlayHints.autoDeclarationTypes.enabled": true,
"C_Cpp.inlayHints.autoDeclarationTypes.showOnLeft": true,
"C_Cpp.inlayHints.parameterNames.enabled": true,
"C_Cpp.inlayHints.referenceOperator.enabled": true,
"C_Cpp.codeAnalysis.clangTidy.enabled": true,
"C_Cpp.loggingLevel": "Debug",
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @dvoraen . IntelliSense seems to be working correctly in your repro. In your scenario:
Note that the template type ( We do have a feature request open to allow the specifying of an arbitrary template parameter types/value for the purpose of IntelliSense, like a similar feature in Visual Studio. This is here: #1946 . However, in your case, since a specialization of the class could change the underlying class used by a member function template, I'm not sure if that would address your scenario. |
Beta Was this translation helpful? Give feedback.
-
To clarify, as you observed, IntelliSense doesn't appear to be displaying 'auto' variable types unless it's able to (fully) resolve that type. A simplified example:
In your case, you're using a concept in place of typename. That filters acceptable types, but the type is still not yet known when evaluating It would seem possible for it to instead display I'd suggest opening a Feature Request by clicking on 'Suggest a Feature' here (against Visual Studio), as this functionality is in common code, which the C/C++ Extension inherits from Visual Studio. |
Beta Was this translation helpful? Give feedback.
To clarify, as you observed, IntelliSense doesn't appear to be displaying 'auto' variable types unless it's able to (fully) resolve that type.
A simplified example:
In your case, you're using a concept in place of typename. That filters acceptable types, but the type is still not yet known when evaluating
shared_ptr<node<T>>
, so falls back to displaying auto.It would seem possible for it to instead display
template<class T> std::shared_ptr<node<T>>
(which is displays when hovering overpParent
/pRight
in your exam…