[gnome-builder] devhelp: ignore trailing symbol characters
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] devhelp: ignore trailing symbol characters
- Date: Tue, 17 Jul 2018 23:21:28 +0000 (UTC)
commit b082ce240f95b8643d53cd148945789acf687ba2
Author: Christian Hergert <chergert redhat com>
Date: Tue Jul 17 16:20:10 2018 -0700
devhelp: ignore trailing symbol characters
We might get a symbol name like "foo(Bar *self)" and we can only reliably
search for "foo". So strip everything starting from (.
In the future, we should add symbol get_type_name() so that we can search
for that instead of the display name in IdeSymbol.
src/plugins/devhelp/gbp-devhelp-hover-provider.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/devhelp/gbp-devhelp-hover-provider.c
b/src/plugins/devhelp/gbp-devhelp-hover-provider.c
index c4b923428..3a2e03940 100644
--- a/src/plugins/devhelp/gbp-devhelp-hover-provider.c
+++ b/src/plugins/devhelp/gbp-devhelp-hover-provider.c
@@ -82,12 +82,23 @@ find_and_apply_content (Hover *h)
for (guint i = 0; i < G_N_ELEMENTS (names); i++)
{
+ const gchar *word = names[i];
+ g_autofree gchar *freeme = NULL;
DhLink *item;
- if (dzl_str_empty0 (names[i]))
+ if (dzl_str_empty0 (word))
continue;
- if ((item = dh_keyword_model_filter (model, names[i], NULL, NULL)))
+ for (guint j = 0; word[j]; j++)
+ {
+ if (!g_ascii_isalnum (word[j]) && word[j] != '_')
+ {
+ word = freeme = g_strndup (word, j);
+ break;
+ }
+ }
+
+ if ((item = dh_keyword_model_filter (model, word, NULL, NULL)))
{
g_autoptr(IdeMarkedContent) content = NULL;
GtkWidget *view;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]