-
Notifications
You must be signed in to change notification settings - Fork 468
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
[cleanup] Remove TagsManager::AreTheSame
/Language::FunctionFromPattern
#3581
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,6 @@ | |
|
||
struct tagCallTipInfo { | ||
wxString sig; | ||
wxString retValue; | ||
std::vector<std::pair<int, int>> paramLen; | ||
}; | ||
|
||
|
@@ -215,9 +214,6 @@ void clCallTip::FormatTagsToTips(const TagEntryPtrVector_t& tags, std::vector<cl | |
|
||
wxString raw_sig(t->GetSignature().Trim().Trim(false)); | ||
|
||
// evaluate the return value of the tag | ||
cti.retValue = TagsManagerST::Get()->GetFunctionReturnValueFromPattern(t); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. returned always |
||
|
||
bool hasDefaultValues = (raw_sig.Find(wxT("=")) != wxNOT_FOUND); | ||
|
||
// the key for unique entries is the function prototype without the variables names and | ||
|
@@ -274,9 +270,6 @@ void clCallTip::FormatTagsToTips(const TagEntryPtrVector_t& tags, std::vector<cl | |
// Rust & Php have "self" or other variant of it in the argument | ||
// list, so lets filter it | ||
tip.Trim().Trim(false); | ||
if (iter->second.retValue.empty() == false) { | ||
tip << " -> " << iter->second.retValue.Trim(false).Trim(); | ||
} | ||
|
||
clTipInfo ti; | ||
ti.paramLen = iter->second.paramLen; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -395,95 +395,6 @@ TagEntryPtr TagsManager::FunctionFromFileLine(const wxFileName& fileName, int li | |
return foo; | ||
} | ||
|
||
wxString TagsManager::FormatFunction(TagEntryPtr tag, size_t flags, const wxString& scope) | ||
{ | ||
clFunction foo; | ||
if(!GetLanguage()->FunctionFromPattern(tag, foo)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Always false, so return always |
||
return wxEmptyString; | ||
} | ||
|
||
wxString body; | ||
// add virtual keyword to declarations only && if the flags is set | ||
if(foo.m_isVirtual && (flags & FunctionFormat_WithVirtual) && !(flags & FunctionFormat_Impl)) { | ||
body << wxT("virtual\n"); | ||
} | ||
|
||
if(tag->IsTemplateFunction()) { | ||
// a template function, add the template definition | ||
body << "template <"; | ||
CxxTemplateFunction helper(tag); | ||
helper.ParseDefinitionList(); | ||
for(size_t i = 0; i < helper.GetList().GetCount(); ++i) { | ||
body << " typename " << helper.GetList().Item(i) << ", \n"; | ||
} | ||
if(body.EndsWith(", \n")) { | ||
body.RemoveLast(3); | ||
} | ||
body << ">\n"; | ||
} | ||
|
||
wxString retValue = tag->GetTypename(); | ||
if(retValue.IsEmpty() == false) { | ||
body << retValue << wxT(" "); | ||
} | ||
|
||
if(flags & FunctionFormat_Impl) { | ||
if(scope.IsEmpty()) { | ||
if(tag->GetScope() != wxT("<global>")) { | ||
body << tag->GetScope() << wxT("::"); | ||
} | ||
} else { | ||
body << scope << wxT("::"); | ||
} | ||
} | ||
|
||
// Build the flags required by the NormalizeFunctionSig() method | ||
size_t tmpFlags(0); | ||
if(flags & FunctionFormat_Impl) { | ||
tmpFlags |= Normalize_Func_Name; | ||
} else { | ||
tmpFlags |= Normalize_Func_Name | Normalize_Func_Default_value; | ||
} | ||
|
||
if(flags & FunctionFormat_Arg_Per_Line) | ||
tmpFlags |= Normalize_Func_Arg_Per_Line; | ||
|
||
if(flags & FunctionFormat_Arg_Per_Line) | ||
body << wxT("\n"); | ||
|
||
body << tag->GetName(); | ||
if(tag->GetFlags() & TagEntry::Tag_No_Signature_Format) { | ||
body << tag->GetSignature(); | ||
|
||
} else { | ||
body << NormalizeFunctionSig(tag->GetSignature(), tmpFlags); | ||
} | ||
|
||
if(foo.m_isConst) { | ||
body << wxT(" const"); | ||
} | ||
|
||
if(!foo.m_throws.empty()) { | ||
body << wxT(" throw (") << wxString(foo.m_throws.c_str(), wxConvUTF8) << wxT(")"); | ||
} | ||
|
||
if(flags & FunctionFormat_Impl) { | ||
body << wxT("\n{\n}\n"); | ||
} else { | ||
if(foo.m_isVirtual && (flags & FunctionFormat_WithOverride)) { | ||
body << wxT(" override"); | ||
} | ||
body << wxT(";\n"); | ||
} | ||
|
||
// convert \t to spaces | ||
body.Replace(wxT("\t"), wxT(" ")); | ||
|
||
// remove any extra spaces from the tip | ||
while(body.Replace(wxT(" "), wxT(" "))) {} | ||
return body; | ||
} | ||
|
||
void TagsManager::SetLanguage(Language* lang) { m_lang = lang; } | ||
|
||
Language* TagsManager::GetLanguage() | ||
|
@@ -656,36 +567,6 @@ void TagsManager::FilterNonNeededFilesForRetaging(wxArrayString& strFiles, ITags | |
} | ||
} | ||
|
||
wxString TagsManager::GetFunctionReturnValueFromPattern(TagEntryPtr tag) | ||
{ | ||
// evaluate the return value of the tag | ||
clFunction foo; | ||
wxString return_value; | ||
if(GetLanguage()->FunctionFromPattern(tag, foo)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Always false, so return always |
||
if(foo.m_retrunValusConst.empty() == false) { | ||
return_value << _U(foo.m_retrunValusConst.c_str()) << wxT(" "); | ||
} | ||
|
||
if(foo.m_returnValue.m_typeScope.empty() == false) { | ||
return_value << _U(foo.m_returnValue.m_typeScope.c_str()) << wxT("::"); | ||
} | ||
|
||
if(foo.m_returnValue.m_type.empty() == false) { | ||
return_value << _U(foo.m_returnValue.m_type.c_str()); | ||
if(foo.m_returnValue.m_templateDecl.empty() == false) { | ||
return_value << wxT("<") << _U(foo.m_returnValue.m_templateDecl.c_str()) << wxT(">"); | ||
} | ||
return_value << _U(foo.m_returnValue.m_starAmp.c_str()); | ||
return_value << wxT(" "); | ||
} | ||
|
||
if(!foo.m_returnValue.m_rightSideConst.empty()) { | ||
return_value << foo.m_returnValue.m_rightSideConst << " "; | ||
} | ||
} | ||
return return_value; | ||
} | ||
|
||
void TagsManager::GetDereferenceOperator(const wxString& scope, std::vector<TagEntryPtr>& tags) | ||
{ | ||
std::vector<std::pair<wxString, int>> derivationList; | ||
|
@@ -799,8 +680,6 @@ wxString TagsManager::DoReplaceMacrosFromDatabase(const wxString& name) | |
return newName; | ||
} | ||
|
||
bool TagsManager::AreTheSame(const TagEntryPtrVector_t& v1, const TagEntryPtrVector_t& v2) const { return false; } | ||
|
||
bool TagsManager::InsertFunctionDecl(const wxString& clsname, const wxString& functionDecl, wxString& sourceContent, | ||
int visibility) | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,10 +177,6 @@ void SymbolTree::BuildTree(const wxFileName& fileName, const TagEntryPtrVector_t | |
// Load the new tags from the database | ||
db->SelectTagsByFile(fileName.GetFullPath(), newTags); | ||
|
||
// Compare the new tags with the old ones | ||
if(!forceBuild && TagsManagerST::Get()->AreTheSame(newTags, m_currentTags)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Always false, so dead code. |
||
return; | ||
|
||
m_currentTags.clear(); | ||
m_currentTags.insert(m_currentTags.end(), newTags.begin(), newTags.end()); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always false, so dead code.