[gnome-builder] gjs-symbols: Don't count setters/getters as methods



commit adeb02e18fe3192e7febc790bff7e5c5cfa7d051
Author: Patrick Griffis <tingping tingping se>
Date:   Tue Sep 12 14:45:41 2017 -0400

    gjs-symbols: Don't count setters/getters as methods

 plugins/gjs-symbols/gjs_symbols.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/plugins/gjs-symbols/gjs_symbols.py b/plugins/gjs-symbols/gjs_symbols.py
index c6b6495..1d37b19 100644
--- a/plugins/gjs-symbols/gjs_symbols.py
+++ b/plugins/gjs-symbols/gjs_symbols.py
@@ -88,6 +88,8 @@ class JsSymbolTree(GObject.Object, Ide.SymbolTree):
             name = dict_['key']['name']
             if name == '_init':
                 return None
+            if dict_.get('kind', None) in ('get', 'set'):
+                return None
             return JsSymbolNode([], line=line, col=col,
                                 kind=Ide.SymbolKind.METHOD,
                                 name=name,
@@ -140,6 +142,8 @@ class JsSymbolTree(GObject.Object, Ide.SymbolTree):
             name = dict_['name']['name']
             if name in ('constructed', '_init'):
                 return None
+            if dict_.get('kind', None) in ('get', 'set'):
+                return None
             return JsSymbolNode([], line=line, col=col,
                                 kind=Ide.SymbolKind.METHOD,
                                 name=name,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]