From: Eran I. <no...@so...> - 2014-01-19 07:35:46
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "codelite". The branch, master has been updated via e8cd1e9b0c04d64e851fe86acb4ebb6af6bfffc0 (commit) from f66479e5bcc001edbb6ed2f916284595dcbe5a01 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceforge.net/p/codelite/codelitegit/ci/e8cd1e9b0c04d64e851fe86acb4ebb6af6bfffc0 commit e8cd1e9b0c04d64e851fe86acb4ebb6af6bfffc0 Author: Eran <era...@gm...> Date: Sun Jan 19 09:35:20 2014 +0200 Refactoring: make the synchronize function signature more reliable diff --git a/CodeLite/entry.cpp b/CodeLite/entry.cpp index 736e0f5..e76338b 100644 --- a/CodeLite/entry.cpp +++ b/CodeLite/entry.cpp @@ -22,6 +22,7 @@ // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// + #include "precompiled_header.h" #include "ctags_manager.h" #include "pptable.h" @@ -201,23 +202,23 @@ void TagEntry::Create(const wxString &fileName, } } } - - if (!path.IsEmpty()) { - SetScope(path); - } else { - SetScope(wxT("<global>")); - } - - // If there is no path, path is set to name - if ( GetPath().IsEmpty() ) - SetPath( GetName() ); - - // Get the parent name - StringTokenizer tok(GetPath(), wxT("::")); - wxString parent; - - (tok.Count() < 2) ? parent = wxT("<global>") : parent = tok[tok.Count()-2]; - SetParent(parent); + + if (!path.IsEmpty()) { + SetScope(path); + } else { + SetScope(wxT("<global>")); + } + + // If there is no path, path is set to name + if ( GetPath().IsEmpty() ) + SetPath( GetName() ); + + // Get the parent name + StringTokenizer tok(GetPath(), wxT("::")); + wxString parent; + + (tok.Count() < 2) ? parent = wxT("<global>") : parent = tok[tok.Count()-2]; + SetParent(parent); } void TagEntry::Create(const tagEntry& entry) @@ -571,32 +572,32 @@ void TagEntry::FromLine(const wxString& line) pattern = pattern.Trim(); if (kind == wxT("enumerator")) { - // enums are specials, they are a scope, when they declared as "enum class ..." (C++11), - // but not a scope when declared as "enum ...". So, for "enum class ..." declaration - //(and anonymous enums) we appear enumerators when typed: + // enums are specials, they are a scope, when they declared as "enum class ..." (C++11), + // but not a scope when declared as "enum ...". So, for "enum class ..." declaration + //(and anonymous enums) we appear enumerators when typed: // enumName:: - //Is global scope there aren't appears. For "enum ..." declaration we appear - //enumerators when typed: - // enumName:: - //and when it global (or same namespace) scope. + //Is global scope there aren't appears. For "enum ..." declaration we appear + //enumerators when typed: + // enumName:: + //and when it global (or same namespace) scope. std::map<wxString,wxString>::iterator enumField = extFields.find(wxT("enum")); if (enumField != extFields.end()) { wxString enumName = enumField->second; - bool isAnonymous = enumName.AfterLast(wxT(':')).StartsWith(wxT("__anon")); - - bool isInEnumNamespace = false; - std::map<wxString,wxString>::const_iterator isInEnumNamespaceField = extFields.find(wxT("isInEnumNamespace")); - if (isInEnumNamespaceField != extFields.end()) { - wxString isInEnumNamespaceValue = isInEnumNamespaceField->second; - isInEnumNamespace = isInEnumNamespaceValue.AfterLast(wxT(':')) == wxT("1") ? true : false; - } - - if (!isInEnumNamespace) { - enumField->second = enumField->second.BeforeLast(wxT(':')).BeforeLast(wxT(':')); - if (!isAnonymous) { - extFields[wxT("typeref")] = enumName; - } - } + bool isAnonymous = enumName.AfterLast(wxT(':')).StartsWith(wxT("__anon")); + + bool isInEnumNamespace = false; + std::map<wxString,wxString>::const_iterator isInEnumNamespaceField = extFields.find(wxT("isInEnumNamespace")); + if (isInEnumNamespaceField != extFields.end()) { + wxString isInEnumNamespaceValue = isInEnumNamespaceField->second; + isInEnumNamespace = isInEnumNamespaceValue.AfterLast(wxT(':')) == wxT("1") ? true : false; + } + + if (!isInEnumNamespace) { + enumField->second = enumField->second.BeforeLast(wxT(':')).BeforeLast(wxT(':')); + if (!isAnonymous) { + extFields[wxT("typeref")] = enumName; + } + } } } @@ -785,11 +786,11 @@ TagEntryPtr TagEntry::ReplaceSimpleMacro() return NULL; } -int TagEntry::CompareDisplayString(const TagEntryPtr& rhs) const +int TagEntry::CompareDisplayString(const TagEntryPtr& rhs) const { wxString d1, d2; - + d1 << GetReturnValue() << wxT(": ") << GetFullDisplayName() << wxT(":") << GetAccess(); d2 << rhs->GetReturnValue() << wxT(": ") << rhs->GetFullDisplayName() << wxT(":") << rhs->GetAccess(); return d1.Cmp(d2); -} +} diff --git a/CodeLite/refactorengine.cpp b/CodeLite/refactorengine.cpp index 9038a45..35f3e81 100644 --- a/CodeLite/refactorengine.cpp +++ b/CodeLite/refactorengine.cpp @@ -451,10 +451,10 @@ TagEntryPtr RefactoringEngine::SyncSignature(const wxFileName& fn, if (bIsImpl) { // The "source" is an implementaion, which means that we need to prepare declaration signature // this could be tricky since we might lose the "default" values - signature = TagsManagerST::Get()->NormalizeFunctionSig(func->GetSignature(), Normalize_Func_Default_value|Normalize_Func_Name); + signature = TagsManagerST::Get()->NormalizeFunctionSig(func->GetSignature(), Normalize_Func_Default_value|Normalize_Func_Name|Normalize_Func_Reverse_Macro); } else { // Prepare an "implementation" signature - signature = TagsManagerST::Get()->NormalizeFunctionSig(func->GetSignature(), Normalize_Func_Name); + signature = TagsManagerST::Get()->NormalizeFunctionSig(func->GetSignature(), Normalize_Func_Name|Normalize_Func_Reverse_Macro); } tag->SetSignature(signature); diff --git a/CodeLite/tags_storage_sqlite3.cpp b/CodeLite/tags_storage_sqlite3.cpp index e79fd3e..4d02d93 100644 --- a/CodeLite/tags_storage_sqlite3.cpp +++ b/CodeLite/tags_storage_sqlite3.cpp @@ -1536,12 +1536,8 @@ void TagsStorageSQLite::DoAddNamePartToQuery(wxString &sql, const wxString& name wxString from = name; wxString until = name; -#if wxVERSION_NUMBER < 2900 - until.Last() = until.Last() + 1; -#else wxChar ch = until.Last(); until.SetChar(until.length() - 1, ch + 1); -#endif // add the name condition if (partial) { diff --git a/LiteEditor.workspace b/LiteEditor.workspace index 08385ee..9a367b2 100644 --- a/LiteEditor.workspace +++ b/LiteEditor.workspace @@ -44,7 +44,7 @@ <Project Name="Tweaks" Path="Tweaks/Tweaks.project" Active="No"/> <Project Name="CMakePlugin" Path="CMakePlugin/CMakePlugin.project" Active="No"/> <BuildMatrix> - <WorkspaceConfiguration Name="Win Release Unicode" Selected="yes"> + <WorkspaceConfiguration Name="Win Release Unicode" Selected="no"> <Project Name="abbreviation" ConfigName="WinReleaseUnicode"/> <Project Name="CallGraph" ConfigName="WinReleaseUnicode"/> <Project Name="CMakePlugin" ConfigName="WinReleaseUnicode"/> @@ -79,7 +79,7 @@ <Project Name="wxsqlite3" ConfigName="WinReleaseUnicode"/> <Project Name="ZoomNavigator" ConfigName="WinReleaseUnicode"/> </WorkspaceConfiguration> - <WorkspaceConfiguration Name="Win Debug Unicode" Selected="no"> + <WorkspaceConfiguration Name="Win Debug Unicode" Selected="yes"> <Project Name="abbreviation" ConfigName="WinDebugUnicode"/> <Project Name="CallGraph" ConfigName="WinDebugUnicode"/> <Project Name="CMakePlugin" ConfigName="WinDebugUnicode"/> diff --git a/LiteEditor/LiteEditor.project b/LiteEditor/LiteEditor.project index 10a87e0..99b01c0 100644 --- a/LiteEditor/LiteEditor.project +++ b/LiteEditor/LiteEditor.project @@ -14,6 +14,15 @@ "buildType": "", "arguments": [], "parentProject": "" + }, { + "name": "WinDebugUnicode", + "enabled": false, + "buildDirectory": "build", + "sourceDirectory": "$(ProjectPath)", + "generator": "", + "buildType": "", + "arguments": [], + "parentProject": "" }]]]> </Plugin> </Plugins> @@ -1491,7 +1500,7 @@ resources.cpp: resources.xrc <Library Value="liblibclang.dll"/> </Linker> <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="yes"/> - <General OutputFile="$(IntermediateDirectory)/codelite-dbg.exe" IntermediateDirectory="./Debug" Command="./codelite-dbg.exe" CommandArguments="-b . " UseSeparateDebugArgs="no" DebugArguments="-b . --no-plugins" WorkingDirectory="../Runtime " PauseExecWhenProcTerminates="no" IsGUIProgram="no" IsEnabled="yes"/> + <General OutputFile="$(IntermediateDirectory)/codelite-dbg.exe" IntermediateDirectory="./Debug" Command="./codelite-dbg.exe" CommandArguments="-b . " UseSeparateDebugArgs="yes" DebugArguments="-b . --no-plugins" WorkingDirectory="../Runtime " PauseExecWhenProcTerminates="no" IsGUIProgram="no" IsEnabled="yes"/> <Environment EnvVarSetName="Default" DbgSetName=""> <![CDATA[PATH=../sdk/clang/lib;$(WXWIN)\lib\gcc_dll;$(PATH)]]> </Environment> @@ -1525,7 +1534,8 @@ resources.cpp: resources.xrc wxrc /c /v /o resources.cpp resources.xrc svninfo.cpp: - autorev .</CustomPreBuild> + autorev . +</CustomPreBuild> </AdditionalRules> <Completion EnableCpp11="yes"> <ClangCmpFlagsC/> diff --git a/LiteEditor/cc_box.cpp b/LiteEditor/cc_box.cpp index 98c2755..6a4350c 100644 --- a/LiteEditor/cc_box.cpp +++ b/LiteEditor/cc_box.cpp @@ -962,3 +962,9 @@ void CCBox::OnClose(wxCommandEvent& e) e.Skip(); Destroy(); } + +void CCBox::SortTags(std::vector<CCItemInfo>& tags, const wxString& userTyped) +{ + wxUnusedVar(tags); + wxUnusedVar(userTyped); +} diff --git a/LiteEditor/cc_box.h b/LiteEditor/cc_box.h index 649caca..0423608 100644 --- a/LiteEditor/cc_box.h +++ b/LiteEditor/cc_box.h @@ -84,7 +84,8 @@ protected: void OnDisplayTooltip(wxTimerEvent &event); void OnRefreshList(wxTimerEvent &event); void Display(LEditor *editor); - + void SortTags(std::vector<CCItemInfo> &tags, const wxString &userTyped); + protected: // helper methods int GetImageId(TagEntryPtr entry); diff --git a/LiteEditor/ccvirtuallistctrl.h b/LiteEditor/ccvirtuallistctrl.h index 7a52b3a..741b4bd 100644 --- a/LiteEditor/ccvirtuallistctrl.h +++ b/LiteEditor/ccvirtuallistctrl.h @@ -22,48 +22,54 @@ // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// - #ifndef __ccvirtuallistctrl__ +#ifndef __ccvirtuallistctrl__ #define __ccvirtuallistctrl__ #include <wx/listctrl.h> #include <vector> #include "entry.h" -class CCItemInfo { +class CCItemInfo +{ public: - int imgId; - wxString displayName; - TagEntry tag; - std::vector<TagEntry> listOfTags; - int currentIndex; + int imgId; + wxString displayName; + TagEntry tag; + std::vector<TagEntry> listOfTags; + int currentIndex; - CCItemInfo() : imgId(wxNOT_FOUND), displayName(wxT("")), currentIndex(0) {} - bool IsOk() const { return displayName.IsEmpty() == false; } - void Reset() { - imgId = wxNOT_FOUND; - displayName = wxEmptyString; - tag = TagEntry(); - listOfTags.clear(); - } + CCItemInfo() : imgId(wxNOT_FOUND), displayName(wxT("")), currentIndex(0) {} + bool IsOk() const { + return displayName.IsEmpty() == false; + } + void Reset() { + imgId = wxNOT_FOUND; + displayName = wxEmptyString; + tag = TagEntry(); + listOfTags.clear(); + } }; -class CCVirtualListCtrl : public wxListView { - std::vector<CCItemInfo> m_tags; +class CCVirtualListCtrl : public wxListView +{ + std::vector<CCItemInfo> m_tags; wxFont m_styleFont; - + public: - CCVirtualListCtrl( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 486,300 ), long style = wxTAB_TRAVERSAL ); - ~CCVirtualListCtrl(); + CCVirtualListCtrl( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 486,300 ), long style = wxTAB_TRAVERSAL ); + ~CCVirtualListCtrl(); public: - void SetItems(const std::vector<CCItemInfo> &tags) { m_tags = tags; } - bool GetItemTagEntry(int index, CCItemInfo &tag); - virtual wxListItemAttr* OnGetItemAttr(long item) const; - virtual int OnGetItemColumnImage(long item, long column) const; - virtual int OnGetItemImage(long item) const; - virtual wxString OnGetItemText(long item, long column) const; - int FindMatch(const wxString &word, bool &fullMatch); + void SetItems(const std::vector<CCItemInfo> &tags) { + m_tags = tags; + } + bool GetItemTagEntry(int index, CCItemInfo &tag); + virtual wxListItemAttr* OnGetItemAttr(long item) const; + virtual int OnGetItemColumnImage(long item, long column) const; + virtual int OnGetItemImage(long item) const; + virtual wxString OnGetItemText(long item, long column) const; + int FindMatch(const wxString &word, bool &fullMatch); }; #endif // __ccvirtuallistctrl__ diff --git a/LiteEditor/context_cpp.cpp b/LiteEditor/context_cpp.cpp index aec27f6..de22bea 100644 --- a/LiteEditor/context_cpp.cpp +++ b/LiteEditor/context_cpp.cpp @@ -3168,12 +3168,12 @@ bool ContextCpp::DoGetSingatureRange(int line, int& start, int& end, LEditor *ct int nDepth = 1; while ((nCur < nLen) && nDepth > 0) { - if(IsCommentOrString(nCur)) { + wxChar ch = ctrl->SafeGetChar(nCur); + if(ctrl->GetContext()->IsCommentOrString(nCur)) { nCur++; continue; } - wxChar ch = ctrl->SafeGetChar(nCur); switch(ch) { case wxT('('): nDepth++; ----------------------------------------------------------------------- Summary of changes: CodeLite/entry.cpp | 85 +++++++++++++++++++------------------ CodeLite/refactorengine.cpp | 4 +- CodeLite/tags_storage_sqlite3.cpp | 4 -- LiteEditor.workspace | 4 +- LiteEditor/LiteEditor.project | 14 +++++- LiteEditor/cc_box.cpp | 6 +++ LiteEditor/cc_box.h | 3 +- LiteEditor/ccvirtuallistctrl.h | 60 ++++++++++++++------------ LiteEditor/context_cpp.cpp | 4 +- 9 files changed, 102 insertions(+), 82 deletions(-) hooks/post-receive -- codelite |