diff --git a/uppsrc/ide/Browser/Base.cpp b/uppsrc/ide/Browser/Base.cpp index 6a26e829c..9f74da017 100644 --- a/uppsrc/ide/Browser/Base.cpp +++ b/uppsrc/ide/Browser/Base.cpp @@ -8,10 +8,12 @@ #define LDUMP(x) // DDUMP(x) -#ifdef _DEBUG -#define CLOG(x) // LOG(x) +// #define HAS_CLOG + +#ifdef HAS_CLOG +#define CLOG(x) RLOG(x) #else -#define CLOG(x) // RLOG(x) +#define CLOG(x) #endif #define CPP_CODEBASE_VERSION 314159 @@ -247,7 +249,9 @@ bool CheckFile(SourceFileInfo& f, const String& path) pp.Preprocess(npath, in, GetMasterFile(npath), true); String md5 = pp.GetDependeciesMd5(GetPPFile(path).keywords); bool r = f.dependencies_md5sum == md5 && tmok; +#ifdef HAS_CLOG if(!r) CLOG(path << " " << f.dependencies_md5sum << " " << md5); +#endif f.depends.Clear(); f.dependencies_md5sum = md5; for(int i = 0; i < pp.visited.GetCount(); i++) @@ -281,9 +285,11 @@ void UpdateCodeBase2(Progress& pi) Index parse_file; CLOG("Gathered files: " << GetAllSourceMasters()); const Index& src = GetAllSources(); +#ifdef HAS_CLOG for(int i = 0; i < source_file.GetCount(); i++) if(!source_file.IsUnlinked(i)) CLOG(i << " " << source_file.GetKey(i) << " " << source_file[i].dependencies_md5sum << " " << source_file[i].time); +#endif pi.SetTotal(src.GetCount()); for(int i = 0; i < src.GetCount(); i++) { pi.Step(); diff --git a/uppsrc/ide/Goto.cpp b/uppsrc/ide/Swaps.cpp similarity index 89% rename from uppsrc/ide/Goto.cpp rename to uppsrc/ide/Swaps.cpp index 11a8db8d6..31df4c64d 100644 --- a/uppsrc/ide/Goto.cpp +++ b/uppsrc/ide/Swaps.cpp @@ -1,70 +1,70 @@ -#include "ide.h" - -#define LLOG(x) // DLOG(x) - -void AssistEditor::SwapSContext(Parser& p) -{ - int i = GetCursor(); - if(Ch(i - 1) == ';') - i--; - else - for(;;) { - int c = Ch(i); - if(c == '{') { - i++; - break; - } - if(c == 0 || c == ';' || c == '}') - break; - i++; - } - Context(p, i); -} - -bool Ide::SwapSIf(const char *cref) -{ - if(designer || !editor.assist_active) - return false; - Parser p; - editor.SwapSContext(p); - int q = CodeBase().Find(p.current_scope); - LLOG("SwapS scope: " << p.current_scope << ", name " << p.current_name << ", key " << p.current_key); - if(q < 0) - return false; - const Array& nn = CodeBase()[q]; - if(cref && MakeCodeRef(p.current_scope, p.current_key) != cref || IsNull(p.current_name)) - return false; - Vector n; - bool destructor = p.current_key.Find('~') >= 0; - for(int i = 0; i < nn.GetCount(); i++) { - const CppItem& m = nn[i]; - if(m.name == p.current_name && destructor == (m.kind == DESTRUCTOR) && !m.IsType()) - n.Add(&m); - } - if(!cref && n.GetCount() < 2) - for(int i = 0; i < n.GetCount(); i++) - if(n[i]->IsType()) { - GotoCpp(*n[i]); - return false; - } - if(n.GetCount() == 0 || IsNull(editfile)) - return false; - int file = GetSourceFileIndex(editfile); - int line = p.current.line; - LLOG("SwapS line: " << line); - int i; - for(i = 0; i < n.GetCount(); i++) { - LLOG("file: " << GetSourceFilePath(n[i]->file) << ", line: " << n[i]->line); - if(n[i]->file == file && n[i]->line == line) { - i++; - break; - } - } - GotoCpp(*n[i % n.GetCount()]); - return true; -} - -void Ide::SwapS() -{ - SwapSIf(NULL); -} +#include "ide.h" + +#define LLOG(x) DLOG(x) + +void AssistEditor::SwapSContext(Parser& p) +{ + int i = GetCursor(); + if(Ch(i - 1) == ';') + i--; + else + for(;;) { + int c = Ch(i); + if(c == '{') { + i++; + break; + } + if(c == 0 || c == ';' || c == '}') + break; + i++; + } + Context(p, i); +} + +bool Ide::SwapSIf(const char *cref) +{ + if(designer || !editor.assist_active) + return false; + Parser p; + editor.SwapSContext(p); + int q = CodeBase().Find(p.current_scope); + LLOG("SwapS scope: " << p.current_scope << ", name " << p.current_name << ", key " << p.current_key); + if(q < 0) + return false; + const Array& nn = CodeBase()[q]; + if(cref && MakeCodeRef(p.current_scope, p.current_key) != cref || IsNull(p.current_name)) + return false; + Vector n; + bool destructor = p.current_key.Find('~') >= 0; + for(int i = 0; i < nn.GetCount(); i++) { + const CppItem& m = nn[i]; + if(m.name == p.current_name && destructor == (m.kind == DESTRUCTOR) && !m.IsType()) + n.Add(&m); + } + if(!cref && n.GetCount() < 2) + for(int i = 0; i < nn.GetCount(); i++) + if(nn[i].IsType()) { + GotoCpp(nn[i]); + return false; + } + if(n.GetCount() == 0 || IsNull(editfile)) + return false; + int file = GetSourceFileIndex(editfile); + int line = p.current.line; + LLOG("SwapS line: " << line); + int i; + for(i = 0; i < n.GetCount(); i++) { + LLOG("file: " << GetSourceFilePath(n[i]->file) << ", line: " << n[i]->line); + if(n[i]->file == file && n[i]->line == line) { + i++; + break; + } + } + GotoCpp(*n[i % n.GetCount()]); + return true; +} + +void Ide::SwapS() +{ + SwapSIf(NULL); +} diff --git a/uppsrc/ide/ide.upp b/uppsrc/ide/ide.upp index 221ecc565..110694a65 100644 --- a/uppsrc/ide/ide.upp +++ b/uppsrc/ide/ide.upp @@ -49,12 +49,12 @@ file Assist.cpp, DCopy.cpp, ContextGoto.cpp, + Swaps.cpp, ParamInfo.cpp, Navigator.cpp, Annotations.cpp, Virtuals.cpp, Thisbacks.cpp, - Goto.cpp, Jump.cpp, Setup.cpp, Custom.cpp,