Branch: refs/heads/master
Author: Javier Mora <cousteaulecommandant(a)gmail.com>
Committer: Javier Mora <cousteaulecommandant(a)gmail.com>
Date: Sun, 24 Nov 2024 23:18:23 UTC
Commit: a7ae4b583ebebe6aa056edbe1e640d71493b1753
https://github.com/geany/geany/commit/a7ae4b583ebebe6aa056edbe1e640d71493b1…
Log Message:
-----------
tagmanager: Verilog: don't tag module of instances
Currently, for a Verilog line like `a_module inst (clk, d, q);`,
ctags will emit both an "instance" tag and a "module" reference,
which Geany incorrectly interprets as a module definition.
Disable ctags roles for Verilog (and SystemVerilog) modules to prevent
this.
Modified Paths:
--------------
src/tagmanager/tm_parser.c
tests/ctags/sysverilog.sv
tests/ctags/sysverilog.sv.tags
Modified: src/tagmanager/tm_parser.c
3 lines changed, 3 insertions(+), 0 deletions(-)
===================================================================
@@ -1649,6 +1649,9 @@ gboolean tm_parser_enable_role(TMParserType lang, gchar kind)
* tags and we can't tell which is which just by kind. By disabling
* roles for this kind, we only get package definition tags. */
return kind != 'p';
+ case TM_PARSER_VERILOG:
+ case TM_PARSER_SYSVERILOG:
+ return kind != 'm';
}
return TRUE;
}
Modified: tests/ctags/sysverilog.sv
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -135,9 +135,9 @@ module testbench;
generate
for (genvar j = 0; j < NUM_UUT; j++) begin : uut_gen
logic [UUT_WIDTH-1:0] data_out;
- a_module #( // NB: this SHOULDN'T be detected as a module declaration (ctags bug)
+ a_module #(
.WIDTH (UUT_WIDTH)
- ) uut ( // but this should be detected as an instance (ctags works)
+ ) uut (
.valid (valid_uut[j]),
.*
);
Modified: tests/ctags/sysverilog.sv.tags
4 lines changed, 0 insertions(+), 4 deletions(-)
===================================================================
@@ -24,8 +24,6 @@ WIDTH
field: a_module :: WIDTH
a_module�1024�0
prototype: a_module
-a_module�1024�testbench.uut_gen�0
-prototype: testbench.uut_gen :: a_module
be_filtered�16384�a_module�0
variable: a_module :: be_filtered
be_filtered_gen�256�a_module�0
@@ -74,8 +72,6 @@ gen_signals
enumerator: generate_signals testbench :: gen_signals
generate_signals�1024�0
prototype: generate_signals
-generate_signals�1024�testbench�0
-prototype: testbench :: generate_signals
i�16384�a_module�0
variable: a_module :: i
i�16384�a_module.main_block�0
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Javier Mora <cousteaulecommandant(a)gmail.com>
Committer: Javier Mora <cousteaulecommandant(a)gmail.com>
Date: Sun, 24 Nov 2024 22:42:56 UTC
Commit: dd9f5151355f452a35d404465d34ac54e6d11b0e
https://github.com/geany/geany/commit/dd9f5151355f452a35d404465d34ac54e6d11…
Log Message:
-----------
Change icon of SystemVerilog struct/enum objects
Unlike in the C parser, "struct" in SystemVerilog refers to declarations
of struct/union *objects*, not definitions of struct/union "types".
The same goes for enum declarations.
Unlike in C, there is no way to define a "struct type" (or union/enum)
except by using a typedef. Therefore, all "structure definitions" use
typedef; otherwise they're simply declaring struct objects.
This puts the ctags "struct" and "enum" in the same category as "net" or
"register"; the tm_parser should reflect this.
- Put Enums on the same tm_parser group as Structs and Unions, separate
from Typedefs.
- Change the icon for the Structs/Unions/Enums to "three gray boxes"
(OTHER), so that it resembles an "aggregate of multiple signals" or
"a grayed-out (anonymous/signal-ified) type".
Modified Paths:
--------------
src/tagmanager/tm_parser.c
Modified: src/tagmanager/tm_parser.c
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -799,8 +799,8 @@ static TMParserMapGroup group_VERILOG[] = {
{N_("Interfaces"), TM_ICON_STRUCT, tm_tag_interface_t | tm_tag_union_t},
{N_("Package"), TM_ICON_NAMESPACE, tm_tag_package_t},
{N_("Members"), TM_ICON_MEMBER, tm_tag_member_t},
- {N_("Structs"), TM_ICON_STRUCT, tm_tag_struct_t},
- {N_("Typedefs / Enums"), TM_ICON_STRUCT, tm_tag_typedef_t | tm_tag_enum_t},
+ {N_("Structs / Unions / Enums"), TM_ICON_OTHER, tm_tag_struct_t | tm_tag_enum_t},
+ {N_("Typedefs"), TM_ICON_STRUCT, tm_tag_typedef_t},
};
static TMParserMapEntry map_SYSVERILOG[] = {
--------------
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: Tue, 12 Nov 2024 19:39:57 UTC
Commit: 87cdc362bfe480f830c97ac009d328978156c887
https://github.com/geany/geany/commit/87cdc362bfe480f830c97ac009d328978156c…
Log Message:
-----------
Make "Find" the default button in the wrap search dialog
When the "Wrap search and find again?" dialog appears, it makes more
sense to wrap instead of cancel the dialog by default (the dialog
can always be canceled by Escape).
The implementation of this patch more or less duplicates the code of
dialogs_show_question_full() and makes the Find button default. While it
would be possible to add one more parameter to dialogs_show_question_full()
controlling this behavior, there's currently no other use of this in
Geany (in all other cases, the action button performs a destructive
action so Cancel is default) so I believe having this local implementation
of the dialog is a better option not complicating other uses.
Fixes #1192.
Modified Paths:
--------------
src/document.c
Modified: src/document.c
39 lines changed, 37 insertions(+), 2 deletions(-)
===================================================================
@@ -2307,6 +2307,42 @@ gboolean document_search_bar_find(GeanyDocument *doc, const gchar *text, gboolea
}
+/* like dialogs_show_question_full() but makes the non-cancel button default */
+static gboolean show_wrap_search_dialog(GtkWidget *parent, const gchar *search_text)
+{
+ gboolean ret;
+ GtkWidget *dialog;
+ GtkWidget *btn;
+ gchar *question_text;
+
+ if (parent == NULL && main_status.main_window_realized)
+ parent = main_widgets.window;
+
+ question_text = g_strdup_printf(_("\"%s\" was not found."), search_text);
+
+ dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
+ GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION,
+ GTK_BUTTONS_NONE, "%s", question_text);
+ gtk_widget_set_name(dialog, "GeanyDialog");
+ gtk_window_set_title(GTK_WINDOW(dialog), _("Question"));
+ gtk_window_set_icon_name(GTK_WINDOW(dialog), "geany");
+
+ gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
+ "%s", _("Wrap search and find again?"));
+
+ gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_NO);
+ btn = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_FIND, GTK_RESPONSE_YES);
+ gtk_widget_grab_default(btn);
+
+ ret = gtk_dialog_run(GTK_DIALOG(dialog));
+
+ gtk_widget_destroy(dialog);
+ g_free(question_text);
+
+ return ret == GTK_RESPONSE_YES;
+}
+
+
/* General search function, used from the find dialog.
* Returns -1 on failure or the start position of the matching text.
* Will skip past any selection, ignoring it.
@@ -2370,8 +2406,7 @@ gint document_find_text(GeanyDocument *doc, const gchar *text, const gchar *orig
/* we searched only part of the document, so ask whether to wraparound. */
if (search_prefs.always_wrap ||
- dialogs_show_question_full(parent, GTK_STOCK_FIND, GTK_STOCK_CANCEL,
- _("Wrap search and find again?"), _("\"%s\" was not found."), original_text))
+ show_wrap_search_dialog(parent, original_text))
{
gint ret;
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).