[gnome-builder] gjs-symbols: Fix returning class methods during indexing
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] gjs-symbols: Fix returning class methods during indexing
- Date: Tue, 12 Sep 2017 23:11:44 +0000 (UTC)
commit df5f585384a8fddea17d31a7703ea070098a4ee9
Author: Patrick Griffis <tingping tingping se>
Date: Tue Sep 12 19:11:10 2017 -0400
gjs-symbols: Fix returning class methods during indexing
plugins/gjs-symbols/gjs_symbols.py | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/plugins/gjs-symbols/gjs_symbols.py b/plugins/gjs-symbols/gjs_symbols.py
index 1d37b19..59e1a61 100644
--- a/plugins/gjs-symbols/gjs_symbols.py
+++ b/plugins/gjs-symbols/gjs_symbols.py
@@ -320,6 +320,13 @@ class GjsCodeIndexer(Ide.Object, Ide.CodeIndexer):
}.get(node.props.kind, 'x')
return prefix + '\x1F' + node.props.name
+ @staticmethod
+ def _flatten_node_list(root_node):
+ nodes = [root_node]
+ for node in root_node:
+ nodes += GjsCodeIndexer._flatten_node_list(node)
+ return nodes
+
def do_index_file(self, file_, build_flags, cancellable):
if 'node_modules' in file_.get_path().split(os.sep):
return None # Avoid indexing these
@@ -341,7 +348,7 @@ class GjsCodeIndexer(Ide.Object, Ide.CodeIndexer):
entries = []
# TODO: Avoid recreating the same data
- for node in root_node:
+ for node in self._flatten_node_list(root_node):
entry = Ide.CodeIndexEntry(
key=node.props.file.get_path() + '|' + node.props.name, # Some unique value..
name=self._get_node_name(node),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]