[Github-comments] [geany/geany] TM cleanups (#957)

Jiří Techet notifications at xxxxx
Wed May 4 12:14:05 UTC 2016


> + */
> +
> +#ifndef TM_CTAGS_WRAPPERS
> +#define TM_CTAGS_WRAPPERS
> +
> +#include <glib.h>
> +
> +#include "tm_parser.h"
> +
> +#include "entry.h" /* for sTagEntryInfo */
> +
> +
> +G_BEGIN_DECLS
> +
> +typedef gboolean (*tm_ctags_callback) (const tagEntryInfo *const tag,
> +	gboolean invalidate, void *user_data);

> This is an odd type name for TM/Geany, we generally use CamelCase for those -- TMCtagsCallback or something?

OK.

> It also seems to have a strange signature only targeted at our very specific usage, although it suggest it's meant to be a generic API. By that I mean the invalidate parameter, that seem more like a step indicator that might be better served as an enum, or at least rather name it something like "initialize" or something more generic...

This isn't meant to be some final API and it's indeed targeted to Geany's specific uses. The thing about "invalidate" and multi-pass parsing is that I think it would be best to get rid of it completely and use just a single pass. From the API perspective it's really stupid because this means the API cannot be used as a stream - you cannot receive a tag, process it somehow and pass it somewhere (e.g. send over network) - you have to wait until the parsing is finished and only then you can be sure the tags are valid.

By the way, I tried the c.c parser on Geany+glib+glibc, then linux kernel and also the boost library sources and the second pass was never executed (plus all the Geany unit tests pass without it). I'm sure it can be useful in some very specific cases but I'm also sure one could introduce passes 2, 3, 4, 5... for other specific cases and this really isn't the way to go. So if there is some real ctags API in the future, IMO the way to go is to remove the "invalidate" parameter and multi-pass parsing.


---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/957/files/103d2c535862ae2682022dcfd714c2ffd983c42f..1c4aaa0eb72aa9e3c60cd604d4c20ca5f7dc5c8f#r62028283
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160504/10c8f2d7/attachment.html>


More information about the Github-comments mailing list