Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[Feature Request] Enhance type deduce on Hover. #58
Agree with these (though not sure the "expected" behavior is ideal, I think we just need to show both in some cases).
Current implementation is a couple of special cases:
Showing actual vs spelled types is a tricky tradeoff. Expanding
I think the plan of record is to show both the (expanded) type, and the spelled initializer.
@kadircet similar to adding values of constants, we may have to modify the current approach of "resolve everything to a Decl and then extract", in favor of extracting some info from the
e.g. in the second example here, the typeloc
There's probably two stages of heuristic needed: the first one to determine "what's the interesting thing under the cursor (declaration, expression, typeloc, stmt)", and then the second to extract information (e.g. by traversing Expr->DeclRefExpr->Decl. SelectionTree can help with the former I think.
Well, I added the GetType request to ycmd specifically for this use case. Our decision was to always show both the expanded (canonical) type and the referenced type, if they differ. This has been used in ycmd for ~4 years without complaint. Not expanding auto to the deduced type is pretty bad, as one of the key things that "modern c++" zealots will tell you is that "your tools can tell you the type if you need to know it".
Here are some test cases: https://github.com/ycm-core/ycmd/blob/master/ycmd/tests/clang/subcommands_test.py#L479-L530
there have been some changes to hover, the current state is: