diff --git a/uppsrc/CtrlLib/RichText.h b/uppsrc/CtrlLib/RichText.h index fbe6811f0..a4de33aa3 100644 --- a/uppsrc/CtrlLib/RichText.h +++ b/uppsrc/CtrlLib/RichText.h @@ -78,7 +78,7 @@ public: bool GotoLabel(Gate match, bool dohighlight = false); bool GotoLabel(const String& lbl, bool highlight = false); void ClearHighlight() { highlight = Null; Refresh(); } - + int GetLength() const { return text.GetLength(); } bool IsSelection() const { return anchor != cursor; } diff --git a/uppsrc/ide/Annotations.cpp b/uppsrc/ide/Annotations.cpp index 51eca145d..5ea6ace7c 100644 --- a/uppsrc/ide/Annotations.cpp +++ b/uppsrc/ide/Annotations.cpp @@ -79,9 +79,8 @@ void AssistEditor::SyncAnnotationPopup() if(path != last_path) topic_text = ParseQTF(ReadTopic(LoadFile(path)).text); RichText result; - #ifdef _DEBUG - result = ParseQTF("[A1 [@b* " + DeQtf(coderef) + "]&"); - #endif + if(AssistDiagnostics) + result = ParseQTF("[A1 [@b* " + DeQtf(coderef) + "]&"); for(String cr : AnnotationCandidates(coderef)) { for(int i = 0; i < topic_text.GetPartCount(); i++) if(topic_text.IsTable(i)) { diff --git a/uppsrc/ide/Browser/Browser.h b/uppsrc/ide/Browser/Browser.h index f49a97d2d..01fe66540 100644 --- a/uppsrc/ide/Browser/Browser.h +++ b/uppsrc/ide/Browser/Browser.h @@ -213,6 +213,7 @@ public: void Open(const String& grouppath); void OpenFile(const String& path); void GoTo(const String& _topic, const String& link, const AnnotationItem *create, bool before); + void GoToPart(int ii); void PersistentFindReplace(bool b) { editor.PersistentFindReplace(b); } static int GetSerial(); diff --git a/uppsrc/ide/Browser/CodeRef.cpp b/uppsrc/ide/Browser/CodeRef.cpp index 6fd18973b..d0da80db4 100644 --- a/uppsrc/ide/Browser/CodeRef.cpp +++ b/uppsrc/ide/Browser/CodeRef.cpp @@ -323,6 +323,8 @@ void TopicEditor::GoTo(const String& _topic, const String& link, const String& c } */ + + void TopicEditor::GoTo(const String& _topic, const String& link, const AnnotationItem *create, bool before) { if(topics_list.FindSetCursor(_topic) && !IsNull(link)) { @@ -347,6 +349,12 @@ void TopicEditor::GoTo(const String& _topic, const String& link, const Annotatio } } +void TopicEditor::GoToPart(int ii) +{ + if(ii >= 0 && ii < editor.Get().GetPartCount()) + editor.Move(editor.Get().GetPartPos(ii)); +} + void TopicEditor::FixTopic() { // TODO diff --git a/uppsrc/ide/Browser/Util.cpp b/uppsrc/ide/Browser/Util.cpp index c7b1b2ad4..3441b2def 100644 --- a/uppsrc/ide/Browser/Util.cpp +++ b/uppsrc/ide/Browser/Util.cpp @@ -1,5 +1,7 @@ #include "Browser.h" +// TODO - probably move somewhere else + #define IMAGECLASS BrowserImg #define IMAGEFILE #include diff --git a/uppsrc/ide/clang/libclang.cpp b/uppsrc/ide/clang/libclang.cpp index bf731af31..37dd8d9b2 100644 --- a/uppsrc/ide/clang/libclang.cpp +++ b/uppsrc/ide/clang/libclang.cpp @@ -239,4 +239,19 @@ void clang_CXIndex_setGlobalOptions(CXIndex index, unsigned int options) LibClang().clang_CXIndex_setGlobalOptions(index, options); } +CXDiagnosticSet clang_getChildDiagnostics(CXDiagnostic d) +{ + return LibClang().clang_getChildDiagnostics(d); +} + +unsigned clang_getNumDiagnosticsInSet(CXDiagnosticSet diags) +{ + return LibClang().clang_getNumDiagnosticsInSet(diags); +} + +CXDiagnostic clang_getDiagnosticInSet(CXDiagnosticSet diags, unsigned index) +{ + return LibClang().clang_getDiagnosticInSet(diags, index); +} + #endif diff --git a/uppsrc/ide/idetool.cpp b/uppsrc/ide/idetool.cpp index 31c1764b2..976294e67 100644 --- a/uppsrc/ide/idetool.cpp +++ b/uppsrc/ide/idetool.cpp @@ -100,7 +100,7 @@ void Ide::OpenTopic(const String& topic) void Ide::OpenATopic() { - String t = doc.GetCurrent(); + String t = doc.GetCurrentLink(); if(!t.StartsWith("topic:")) return; OpenTopic(t);