Branch: refs/heads/master
Author: Jiřà Techet <techet(a)gmail.com>
Committer: Jiřà Techet <techet(a)gmail.com>
Date: Sun, 10 Apr 2022 12:34:15 UTC
Commit: 0333c75a08cfc64b347c8780cc7cd3b9af8d94b1
https://github.com/geany/geany/commit/0333c75a08cfc64b347c8780cc7cd3b9af8d9…
Log Message:
-----------
Add code verifying that all tag types for a language are mapped to some group
First, lang_types is constructed to contain all tag types used in
map_LANGUAGE mapping, then, group_types is constructed to contain all
tag types from group_LANGUAGE. Since some groups are used for more
languages (e.g. group_C) and contain more tag types than tag types
used for the given language, the check doesn't simply do
group_types != lang_types
but rather
(group_types & lang_types) != lang_types
to eliminate types from the group not used for the given language.
Modified Paths:
--------------
src/tagmanager/tm_parser.c
Modified: src/tagmanager/tm_parser.c
10 lines changed, 10 insertions(+), 0 deletions(-)
===================================================================
@@ -1148,6 +1148,8 @@ void tm_parser_verify_type_mappings(void)
const gchar *kinds = tm_ctags_get_lang_kinds(lang);
TMParserMap *map = &parser_map[lang];
gchar presence_map[256];
+ TMTagType lang_types = 0;
+ TMTagType group_types = 0;
guint i;
if (! map->entries || map->size < 1)
@@ -1184,6 +1186,7 @@ void tm_parser_verify_type_mappings(void)
kinds[i], tm_ctags_get_lang_name(lang));
presence_map[(unsigned char) map->entries[i].kind]++;
+ lang_types |= map->entries[i].type;
}
for (i = 0; i < sizeof(presence_map); i++)
@@ -1192,6 +1195,13 @@ void tm_parser_verify_type_mappings(void)
g_error("Duplicate tag type '%c' found for %s",
(gchar)i, tm_ctags_get_lang_name(lang));
}
+
+ for (i = 0; i < map->group_num; i++)
+ group_types |= map->groups[i].types;
+
+ if ((group_types & lang_types) != lang_types)
+ g_warning("Not all tag types mapped to symbol tree groups for %s",
+ tm_ctags_get_lang_name(lang));
}
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Jiřà Techet <techet(a)gmail.com>
Committer: Jiřà Techet <techet(a)gmail.com>
Date: Sun, 10 Apr 2022 12:34:15 UTC
Commit: 201ac64545ea0d2857f55dcd7440b07a1672bbcb
https://github.com/geany/geany/commit/201ac64545ea0d2857f55dcd7440b07a1672b…
Log Message:
-----------
Translate symbol tree roots
Using _() macros from glib/gi18n-lib.h for translatable strings isn't
possible because we need to use them in global static initializers where
g_dgettext() (to which _() expands) cannot be called.
Still, we need to define _() and use it to mark translatable strings so
the command-line xgettext finds them. Then, we can call g_dgettext()
manually at the appropriate place to get the translated string.
Modified Paths:
--------------
po/POTFILES.in
src/tagmanager/tm_parser.c
Modified: po/POTFILES.in
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -40,6 +40,7 @@ src/ui_utils.c
src/utils.c
src/vte.c
src/win32.c
+src/tagmanager/tm_parser.c
plugins/classbuilder.c
plugins/htmlchars.c
plugins/export.c
Modified: src/tagmanager/tm_parser.c
8 lines changed, 8 insertions(+), 0 deletions(-)
===================================================================
@@ -23,7 +23,11 @@
#include <string.h>
+#include "config.h"
+
+/* Only for the command-line xgettext tool to find translatable strings.
+ * The gettext() function is invoked manually using glib g_dgettext() */
#define _(String) (String)
typedef struct
@@ -1073,7 +1077,11 @@ const gchar *tm_parser_get_sidebar_info(TMParserType lang, gint group, guint *ic
grp = &map->groups[group];
*icon = grp->icon;
+#ifdef GETTEXT_PACKAGE
+ return g_dgettext(GETTEXT_PACKAGE, grp->name);
+#else
return grp->name;
+#endif
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Jiřà Techet <techet(a)gmail.com>
Committer: Jiřà Techet <techet(a)gmail.com>
Date: Sun, 10 Apr 2022 12:34:15 UTC
Commit: 230337d54e2bc245d59b4c58ede4fa1352719aa1
https://github.com/geany/geany/commit/230337d54e2bc245d59b4c58ede4fa1352719…
Log Message:
-----------
Update HACKING with up-to-date information about ctags parser addition
Previously "tagmanager" was a synonym for ctags+tagmanager but these
are separate now and tagmanager is more or less par of core Geany now
and not a separate library so update/remove things related to tagmanager.
Anjuta and exuberant ctags parsers aren't compatible with current
universal-ctags parsers (or the current tag manager) so they can be
removed from the description too.
The rest is just updates related to the move of stuff from symbols.c
to tm_parsers.c.
Modified Paths:
--------------
HACKING
Modified: HACKING
41 lines changed, 19 insertions(+), 22 deletions(-)
===================================================================
@@ -500,13 +500,13 @@ other changes should be passed on to the maintainers at
http://scintilla.org. We normally update to a new Scintilla release
shortly after one is made. See also scintilla/README.
-Tagmanager was originally taken from Anjuta 1.2.2, and parts of it
-(notably c.c) have been merged from later versions of Anjuta and
-CTags. The independent Tagmanager library itself ceased development
-before Geany was started. It's source code parsing is mostly taken from
-Exuberant CTags (see http://ctags.sf.net). If appropriate it's good to
-pass language parser changes back to the CTags project.
-
+We use an unmodified subset of universal-ctags sources
+(https://github.com/universal-ctags/ctags) to parse open documents. We
+also use the great majority of unmodified universal-ctags parsers except
+a few outliers that are maintained by us (those whose file names start
+with geany_). We normally update to the latest version of
+universal-ctags shortly after making a Geany release and keep this
+version during the rest of the development cycle.
Notes
=====
@@ -650,18 +650,13 @@ indentation after ':' is done from on_new_line_added().
If the Scintilla lexer supports user type keyword highlighting (e.g.
SCLEX_CPP), update document_update_tags() in document.c.
-Adding a TagManager parser
-^^^^^^^^^^^^^^^^^^^^^^^^^^
+Adding a CTags parser
+^^^^^^^^^^^^^^^^^^^^^
This assumes the filetype for Geany already exists.
First write or find a CTags compatible parser, foo.c. Check this fork:
https://github.com/universal-ctags/ctags
-There may be some unmerged language patches for CTags at:
-http://sf.net/projects/ctags - see the tracker.
-
-(You can also try the Anjuta project's anjuta-tags codebase.)
-
Method
``````
* Add foo.c to SRCS in Makefile.am.
@@ -673,20 +668,22 @@ In src/tagmanager/tm_parser.c:
Add a map_FOO TMParserMapEntry mapping each kind's letter from foo.c's
FooKinds to the appropriate TMTagType, and add the corresponding
MAP_ENTRY(FOO) to parser_map.
-(You may want to make the symbols.c change before doing this).
In src/tagmanager/tm_parser.c:
-Update tm_parser_scope_separator() and tm_parser_has_full_scope() to
-handle the new parser if applicable, by adding a TM_PARSER_FOO case entry.
+Add a group_FOO TMParserMapGroup defining root nodes of the symbol tree,
+used icons and TMTagType values grouped under the specified root.
+Multiple TMTagType values can be combined under a single root using |
+(bitwise OR).
+
+In src/tagmanager/tm_parser.c:
+Update various functions at the end of tm_parser.c to adjust Geany
+behavior to the behavior of the added parser. In particular, update
+tm_parser_scope_separator() and tm_parser_has_full_scope() so
+scope-related functionality works correctly.
In filetypes.c, init_builtin_filetypes():
Set the 2nd argument of the FT_INIT() macro for this filetype to FOO.
-In symbols.c:
-Unless your parser uses C-like tag type kinds, update
-add_top_level_items() for foo, calling tag_list_add_groups(). See
-get_tag_type_iter() for which tv_iters fields to use.
-
Tests
`````
The tag parser tests checks if the proper tags are emitted
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: Enrico Tröger <enrico.troeger(a)uvena.de>
Date: Sun, 10 Apr 2022 10:40:37 UTC
Commit: 7863c2abcfe4a235d60a2fffba173b9166012c12
https://github.com/geany/geany/commit/7863c2abcfe4a235d60a2fffba173b9166012…
Log Message:
-----------
Manually realize the VTE widget on startup
This should fix crashes when pasting text into the widget before it has
been fully realized (e.g. when it was never shown before).
Fixes #2813.
Modified Paths:
--------------
src/vte.c
Modified: src/vte.c
4 lines changed, 4 insertions(+), 0 deletions(-)
===================================================================
@@ -240,6 +240,10 @@ static void on_startup_complete(G_GNUC_UNUSED GObject *dummy)
{
GeanyDocument *doc = document_get_current();
+ /* ensure the widget is mapped and fully initialized, so actions like pasting text work
+ * (see https://github.com/geany/geany/issues/2813 for details) */
+ gtk_widget_realize(vc->vte);
+
if (doc)
vte_cwd((doc->real_path != NULL) ? doc->real_path : doc->file_name, FALSE);
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).