forked from qt-creator/qt-creator
		
	ClangCodeModel: Show value in tool tips, if possible
When hovering over a constant expression, it's probably helpful to show that value to the user. Requires clang 11 to fully work. For now, it only shows the value for variable initializations. Fixes: QTCREATORBUG-23967 Change-Id: I6b844231bac50993c2fa2fa82c552ad9cef590df Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
		@@ -385,6 +385,15 @@ TEST_F(ToolTipInfo, SizeForUnion)
 | 
			
		||||
    ASSERT_THAT(actual.sizeInBytes, Utf8StringLiteral("1"));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
TEST_F(ToolTipInfo, constexprValue)
 | 
			
		||||
{
 | 
			
		||||
    // CLANG-UPGRADE-CHECK: Adapt the values below
 | 
			
		||||
    ASSERT_THAT(tooltip(204, 12).value.toInt(), 4);
 | 
			
		||||
    ASSERT_THAT(tooltip(204, 27).value.toInt(), 4); // 3 in clang 11
 | 
			
		||||
    ASSERT_THAT(tooltip(204, 30).value.toInt(), 4);
 | 
			
		||||
    ASSERT_THAT(tooltip(204, 32).value.toInt(), 4); // 1 in clang 11
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
TEST_F(ToolTipInfo, Namespace)
 | 
			
		||||
{
 | 
			
		||||
    ::ToolTipInfo expected(Utf8StringLiteral("X"));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user