src: use wstring in tooltip and snippet

This commit is contained in:
mlangkabel
2018-02-06 15:54:09 +01:00
parent 3a6a22df2e
commit 6ae9c2eca5
15 changed files with 39 additions and 41 deletions
+9 -9
View File
@@ -25,25 +25,25 @@ int accessKindToInt(AccessKind t)
return t;
}
std::string accessKindToString(AccessKind t)
std::wstring accessKindToString(AccessKind t)
{
switch (t)
{
case ACCESS_NONE:
return "";
return L"";
case ACCESS_PUBLIC:
return "public";
return L"public";
case ACCESS_PROTECTED:
return "protected";
return L"protected";
case ACCESS_PRIVATE:
return "private";
return L"private";
case ACCESS_DEFAULT:
return "default";
return L"default";
case ACCESS_TEMPLATE_PARAMETER:
return "template parameter";
return L"template parameter";
case ACCESS_TYPE_PARAMETER:
return "type parameter";
return L"type parameter";
}
return "";
return L"";
}
+1 -1
View File
@@ -16,6 +16,6 @@ enum AccessKind
AccessKind intToAccessKind(int v);
int accessKindToInt(AccessKind t);
std::string accessKindToString(AccessKind t);
std::wstring accessKindToString(AccessKind t);
#endif // ACCESS_KIND_H
+5 -5
View File
@@ -1703,7 +1703,7 @@ TooltipInfo PersistentStorage::getTooltipInfoForTokenIds(const std::vector<Id>&
}
const NodeType type = utility::intToType(node.type);
info.title = type.getReadableTypeString();
info.title = type.getReadableTypeWString();
DefinitionKind defKind = DEFINITION_NONE;
const StorageSymbol symbol = m_sqliteIndexStorage.getFirstById<StorageSymbol>(node.id);
@@ -1717,7 +1717,7 @@ TooltipInfo PersistentStorage::getTooltipInfoForTokenIds(const std::vector<Id>&
const StorageComponentAccess access = m_sqliteIndexStorage.getComponentAccessByNodeId(node.id);
if (access.nodeId != 0)
{
info.title = accessKindToString(intToAccessKind(access.type)) + " " + info.title;
info.title = accessKindToString(intToAccessKind(access.type)) + L" " + info.title;
}
}
@@ -1725,16 +1725,16 @@ TooltipInfo PersistentStorage::getTooltipInfoForTokenIds(const std::vector<Id>&
{
if (!getFileNodeComplete(node.id))
{
info.title = "incomplete " + info.title;
info.title = L"incomplete " + info.title;
}
}
else if (defKind == DEFINITION_NONE)
{
info.title = "non-indexed " + info.title;
info.title = L"non-indexed " + info.title;
}
else if (defKind == DEFINITION_IMPLICIT)
{
info.title = "implicit " + info.title;
info.title = L"implicit " + info.title;
}
info.count = 0;
+1 -1
View File
@@ -21,7 +21,7 @@ struct TooltipInfo
return title.size() || snippets.size();
}
std::string title;
std::wstring title;
int count = -1;
std::string countText;