ide: Fixed annotation / topic issues

This commit is contained in:
Mirek Fidler 2022-10-02 15:18:01 +02:00
parent c912cbcc0f
commit d4e0c45f59
7 changed files with 30 additions and 5 deletions

View file

@ -78,7 +78,7 @@ public:
bool GotoLabel(Gate<const WString&> 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; }

View file

@ -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)) {

View file

@ -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();

View file

@ -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

View file

@ -1,5 +1,7 @@
#include "Browser.h"
// TODO - probably move somewhere else
#define IMAGECLASS BrowserImg
#define IMAGEFILE <ide/Browser/Browser.iml>
#include <Draw/iml_source.h>

View file

@ -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

View file

@ -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);