Fixed various things...

This commit is contained in:
Mirek Fidler 2022-09-05 12:28:22 +02:00
parent de72dfc3bf
commit d4b57066b8
6 changed files with 42 additions and 23 deletions

View file

@ -497,8 +497,6 @@ void AssistEditor::PopUpAssist(bool auto_insert)
popup.NoZoom();
}
type.SetCursor(0);
if(!assist.GetCount())
return;
LTIMING("PopUpAssist2");
int cy = VertLayoutZoom(304);
cy += HeaderCtrl::GetStdHeight();

View file

@ -118,6 +118,6 @@ void AssistEditor::AssistDisplay::Paint(Draw& w, const Rect& r, const Value& q,
w.DrawRect(r, paper);
PaintCpp(w, r, m.kind, m.name, m.signature, ink, (style & (FOCUS|CURSOR)) == (FOCUS|CURSOR) || (style & SELECT));
PaintCpp(w, r, m.kind, m.name, m.signature, ink, (style & (FOCUS|CURSOR)) == (FOCUS|CURSOR) || (style & SELECT), true);
}
}

View file

@ -195,11 +195,19 @@ void Ide::OnlineSearchMenu(Bar& menu)
{
static Time search_engines_tm = Null;
static Value search_engines;
Time h = FileGetTime(SearchEnginesFile());
if(h != search_engines_tm) {
search_engines = LoadSearchEngines();
search_engines_tm = h;
static Vector<Image> search_icon;
static Vector<bool> search_icon_loaded;
static Time next_check = Time::Low();
Time ct = GetSysTime();
if(ct > next_check) {
next_check = ct + 4;
Time h = FileGetTime(SearchEnginesFile());
if(h != search_engines_tm) {
search_engines = LoadSearchEngines();
search_engines_tm = h;
search_icon_loaded.Clear();
}
}
bool b = editor.IsSelection() || IsAlNum(editor.GetChar()) || editor.GetChar() == '_';
@ -211,7 +219,13 @@ void Ide::OnlineSearchMenu(Bar& menu)
};
auto Icon = [&](int i) {
return StreamRaster::LoadStringAny(Decode64(search_engines[i]["Icon"]));
bool& b = search_icon_loaded.At(i, false);
Image& m = search_icon.At(i);
if(!b) {
b = true;
m = StreamRaster::LoadStringAny(Decode64(search_engines[i]["Icon"]));
}
return m;
};
String name, uri;

View file

@ -283,21 +283,22 @@ bool ClangVisitor::ProcessNode(CXCursor cursor)
CXCursor ref = clang_getCursorReferenced(cursor);
String id = ci.Id();
int kind = ci.Kind();
if(id.GetCount() && (!locals || dolocals)) {
LoadSourceLocation();
CppFileInfo& f = info.GetAdd(sl.path);
AnnotationItem& r = locals ? f.locals.Add() : f.items.Add();
r.kind = ci.Kind();
r.kind = kind;
r.name = ci.Name();
r.type = ci.Type();
r.pos = loc.pos;
r.id = id;
r.pretty = ci.Kind() == CXCursor_MacroDefinition ? r.name
r.pretty = kind == CXCursor_MacroDefinition ? r.name
: CleanupPretty(FetchString(clang_getCursorPrettyPrinted(cursor, pp_pretty)));
r.definition = clang_isCursorDefinition(cursor);
r.nspace = ci.Nspace();
r.bases = ci.Bases();
r.isvirtual = ci.Kind() == CXCursor_CXXMethod && clang_CXXMethod_isVirtual(cursor);
r.isvirtual = kind == CXCursor_CXXMethod && clang_CXXMethod_isVirtual(cursor);
if(findarg(r.kind, CXCursor_Constructor, CXCursor_Destructor) >= 0) {
int q = r.id.Find('(');
if(q >= 0) {
@ -312,7 +313,7 @@ bool ClangVisitor::ProcessNode(CXCursor cursor)
r.nest = r.id.Mid(0, q);
r.nest.TrimEnd("::");
}
if(IsStruct(ci.Kind()))
if(IsStruct(kind))
MergeWith(r.nest, "::", r.name);
}
r.uname = ToUpper(r.name);
@ -340,22 +341,24 @@ bool ClangVisitor::ProcessNode(CXCursor cursor)
}
}
if(findarg(ci.Kind(), CXCursor_FunctionTemplate, CXCursor_FunctionDecl, CXCursor_Constructor,
if(findarg(kind, CXCursor_FunctionTemplate, CXCursor_FunctionDecl, CXCursor_Constructor,
CXCursor_Destructor, CXCursor_CXXMethod, CXCursor_ConversionFunction) >= 0)
locals = true;
return true;
return findarg(kind, CXCursor_FieldDecl, CXCursor_VarDecl) < 0;
}
CXChildVisitResult clang_visitor(CXCursor cursor, CXCursor p, CXClientData clientData) {
#ifdef DUMPTREE
LOGBEGIN();
#endif
LOGBEGIN();
ClangVisitor *v = (ClangVisitor *)clientData;
bool bak_locals = v->locals;
if(v->ProcessNode(cursor))
clang_visitChildren(cursor, clang_visitor, clientData);
v->locals = bak_locals;
LOGEND();
#ifdef DUMPTREE
LOGEND();
#endif

View file

@ -1,5 +1,11 @@
DONE:
- Heap leaks in Linux
- Alt-I on AssistDisplay::Paint
- Autocomplete Size sz; sz.ct - when the name is not found, list is missing (should not be)
- for .txt file, navigator keeps showing previous local file
- ImagePainter iw; iw.Arc - CtrlSpace shows nothing

View file

@ -86,28 +86,22 @@ ISUES:
- Navigator cycling struct AssistEditor : CodeEditor, Navigator { goes to contructor as well
- Handle templates
- Alt-J if everything fails (template, e.g. OpenWindUtil/Utils.h:348), go by the name
- Alt-J relaxed rules if not found (in templates, different parameters)
- Wind/MetMastLayer.cpp:6354 no jump on sqrt (?)
- Macros with PPInfo
- Heap leaks in Linux
- Option "first config only"
- Option "reindex manual" (autosetup based on CPU cores)
- Icons Alt-J/I/U
- Autocomplete Size sz; sz.ct - when the name is not found, list is missing (should not be)
- Occasional freeze probably due to reindexing
- void ClearTurbineVarsCache() - after switching main config, reparse file
- Raster/RasterLayer.cpp:841 J on NewRc
NONCLANG:
@ -165,6 +159,10 @@ NTH:
- Alt+I should try previous method
- Handle templates
- Alt-J if everything fails (template, e.g. OpenWindUtil/Utils.h:348), go by the name
- Alt-J relaxed rules if not found (in templates, different parameters)
LATER:
- optimise hdepend (then maybe remove .h limitation for syncheaders)