On 27 March 2011 12:31, Yura Siamashka yurand2@gmail.com wrote:
On Wed, 23 Mar 2011 23:49:41 +1100 Lex Trotman elextr@gmail.com wrote:
Thats a bit harder, probably Yura, the plugin writer will need to take a look at the problem I'd say.
I looked at the problem:
- geanyprj act only on "document-open", "document-save", "document-activate" callbacks
- geanyprj add a lot of TMWorkObject objects using tm_workspace_add_object() to Geany
And tm_workspace_add_object sets the parent to be the whole workspace!
- Geany call update_tags_from_buffer() very often.
I think this function somehow reparse a lot of objects because of "update_parent" param. I am not sure what this param actualy mean but if I change function this way performance is back to normal (I don't say we need to change it, it is just research):
--- a/src/document.c +++ b/src/document.c @@ -2263,7 +2263,7 @@ static gboolean update_tags_from_buffer(GeanyDocument *doc) /* we copy the whole text into memory instead using a direct char pointer from * Scintilla because tm_source_file_buffer_update() does modify the string slightly */ sci_get_text(doc->editor->sci, len, text);
- result = tm_source_file_buffer_update(doc->tm_file, (guchar*) text, len, TRUE);
Because of item 2) above I think this will reparse all open files.
The question is can problems be introduced by not reparsing things, eg if we are editing a .h file, can that affect the symbols of the .c files that include it ... probably possible AFAICT.
Is there some easy way of triggering re-parsing of dependencies when the sidebar is about to swap to a different file? That way real-time update only needs to do the one file being edited, but no artifacts are introduced due to inconsistencies between when tags were parsed.
Cheers Lex
- result = tm_source_file_buffer_update(doc->tm_file, (guchar*) text, len, FALSE);
g_free(text); #endif return result;
-- Yura Siamashka yurand2@gmail.com _______________________________________________ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel