[Geany-devel] Real-time tag parsing (again) (was Geany FTW - better autocompletion)

Colomban Wendling lists.ban at xxxxx
Sun Dec 19 15:05:24 UTC 2010


Hi!

I create this new thread because the original one was not really about
this, so please read that thread for some details, particularly my
previous mail:
http://lists.uvena.de/pipermail/geany-devel/2010-November/003567.html

Although I know it's probably not the best time for such huge changes
(Christmas and release coming soon, ...), but now's the news, now's the
mail :)

So, now the interesting stuff.


As you (might) already know, I've got the tagmanager to work in memory,
opening a little more the way to real-time symbols updating. For
convenience, I join the patch here (can be found in the previous thread)
as 0001-First-tagmanager-move-to-MIO-I-O.patch.

>From here, the next step is to use the in-memory capabilities and
reparse in (almost-)real-time. Here comes two more patches:

1) 0002-Enable-in-memory-tag-parsing.patch which is really tiny and
enables in-memory tag parsing

2) 0003-Update-tag-list-on-IDLE-time-right-after-any-documen.patch which
updates the tag list on IDLE time after any change in the document. This
patch is not really good (allowing a timeout and a user setting would be
probably a good idea), but it is here mostly for being able to test.


So with these on, you can test the in-memory tag parsing, and notice
that... it updates in real-time, yes, but the symbol list flickers a
lot, and it's very annoying. So here comes 5 (!) more patches:

1) 0004-Improve-implementation-of-hide_empty_rows-to-do-all-.patch: this
one is not needed, simply improves the implementation of
hide_empty_rows() -- note that it may be applied alone too;

2) 0005-Make-TMTag-reference-counted.patch and...
3) ...0006-Provide-a-GType-for-TMTag-and-use-it.patch: these two makes
TMTags reference-counted and add a GType for them, allowing the tree tag
store to keep a reference to them, so they never become invalid. I
needed it for the implementation of the last patch, read ahead;

4) 0007-Don-t-remove-and-add-the-symbols-tree-view-if-we-re-.patch: this
ones avoids removing and re-addind the tag view upon update if the final
state is the same as the original one, avoiding a part of the
flickering. Note that it applies alone as well;

5) and finally,
0008-Update-the-symbol-list-rather-than-clearing-and-re-b.patch: this is
the huge part of the thing: it re-implements tag store updating to avoid
clearing and re-filling the list, rather updating the rows when
possible. Apart avoiding flickering, this also keeps user's selection
and folding :)
As you might read at the top of the patch, this implementation is
probably not the better possible, but avoids lot of refactoring in a
code I'm not sure to understand perfectly well (add_tree_tag()) -- note
that I suggest another implementation in the patch's comment, and I have
a working sample (but not with the symbol list...) if somebody's interested.
About this patch, there is a question (as a FIXME in the patch): why did
you detached the tag store from the tag view before updating it? Was it
for performance reasons or what? I dropped this since it (obviously) led
to flickering, and it seems to work well, but I'm wondering.


Well! If you apply all these patches, you should have a working,
real-time, in-memory tag parsing that should look good :)

So, what's left? Testing of course, lot of it.
Also, for now it doesn't update tag list before the first save (for new
documents). I've not investigating the issue yet though.


So I'll stop here, thank you for your time reading and let you test
this, right? :)

Regards,
Colomban


PS: for the inpatients of you, I included a patch
(0000-In-memory-tag-parsing-all-together.patch) that combines all the 8
patches together.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-First-tagmanager-move-to-MIO-I-O.patch
Type: text/x-patch
Size: 41962 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20101219/47b078a5/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Enable-in-memory-tag-parsing.patch
Type: text/x-patch
Size: 712 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20101219/47b078a5/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Update-tag-list-on-IDLE-time-right-after-any-documen.patch
Type: text/x-patch
Size: 1562 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20101219/47b078a5/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Improve-implementation-of-hide_empty_rows-to-do-all-.patch
Type: text/x-patch
Size: 1768 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20101219/47b078a5/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Make-TMTag-reference-counted.patch
Type: text/x-patch
Size: 5448 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20101219/47b078a5/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-Provide-a-GType-for-TMTag-and-use-it.patch
Type: text/x-patch
Size: 2542 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20101219/47b078a5/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-Don-t-remove-and-add-the-symbols-tree-view-if-we-re-.patch
Type: text/x-patch
Size: 2003 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20101219/47b078a5/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-Update-the-symbol-list-rather-than-clearing-and-re-b.patch
Type: text/x-patch
Size: 9808 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20101219/47b078a5/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0000-In-memory-tag-parsing-all-together.patch
Type: text/x-patch
Size: 59654 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20101219/47b078a5/attachment-0008.bin>


More information about the Devel mailing list