diff --git a/ninja_ide/tools/completion/analyzer.py b/ninja_ide/tools/completion/analyzer.py index bb7ebe52..9ca70177 100644 --- a/ninja_ide/tools/completion/analyzer.py +++ b/ninja_ide/tools/completion/analyzer.py @@ -58,9 +58,9 @@ class Analyzer(object): _ast.Tuple: 'tuple', _ast.List: 'list', _ast.ListComp: 'list', - _ast.Str: 'str', +# _ast.Str: 'str', _ast.Dict: 'dict', - _ast.Num: 'int', + _ast.Constant: 'int', '_ast.Float': 'float', '_ast.Bool': 'bool', _ast.Call: model.late_resolution, @@ -136,7 +136,7 @@ class Analyzer(object): return type_name value = line[1].strip() # TODO: We have to analyze when the assign is: x,y = 1, 2 - if type_name is _ast.Num and '.' in value: + if type_name is _ast.Constant and '.' in value: type_name = '_ast.Float' elif value in ('True', 'False'): type_name = '_ast.Bool' @@ -178,7 +178,7 @@ class Analyzer(object): for var in symbol.targets: type_value = symbol.value.__class__ line_content = self.content[symbol.lineno - 1] - if type_value in (_ast.Num, _ast.Name): + if type_value in (_ast.Constant, _ast.Name): type_value = self._assign_disambiguation( type_value, line_content) if type_value is None: diff --git a/ninja_ide/tools/introspection.py b/ninja_ide/tools/introspection.py index 915598ff..e3ba3b8b 100644 --- a/ninja_ide/tools/introspection.py +++ b/ninja_ide/tools/introspection.py @@ -29,9 +29,9 @@ logger_symbols = NinjaLogger( _map_type = { _ast.Tuple: 'tuple', _ast.List: 'list', - _ast.Str: 'str', +# _ast.Str: 'str', _ast.Dict: 'dict', - _ast.Num: 'int', + _ast.Constant: 'int', _ast.Call: 'function()', }