Anonymous avatar Anonymous committed 4d1dc2f

Completion proposals only contain information about the structure of the code; ie. global, local, attribute

Comments (0)

Files changed (9)

 Overview
 ========
 
-  'rope' is a Python IDE. Its main goal is to provide features like
+'rope' is a Python IDE. Its main goal is to provide features like
 auto-completion, refactorings, content assists and outlines. It is 
 written in python and uses the Tkinter library.
 
 Keybinding
 ==========
 
-  The keybinding will be customizable in future. 
+The keybinding will be customizable in future. 
 Some of these bindings are choosen from emacs and some from eclipse.
 
 C-x C-p        open/new project
 Description
 ===========
 
-  This program, rope, is a python IDE. It tries to give users lots of things
+This program, rope, is a python IDE. It tries to give users lots of things
 that are not available in python IDEs yet.
 
 Refactoring
 -----------
-  In recent years refactoring has become a basic task of everyday programing,
+In recent years refactoring has become a basic task of everyday programing,
 specially in java community. In the agile programing methodologies, like
 Extreme Programing, Refactoring is one of the core practices.
 
-  Some IDEs support some basic refactorings like 'PyDev' (which uses bicycle
+Some IDEs support some basic refactorings like 'PyDev' (which uses bicycle
 repair man). These IDEs have a limited set of refactorings and fail
 when doing refactorings that need to know the type of objects in the
 source code (specially for relatively large projects). rope tries to provide a
 
 Auto Completion
 ---------------
-  One of the basic features of modern IDEs is the availability of auto-completion.
+One of the basic features of modern IDEs is the availability of auto-completion.
 Some Python IDEs have auto-completion support but in a limited form. Since
 the type of many variables cannot be deduced from simple analysis of the source code.
 Auto-completing modules names, class names, static methods, class methods,
 
 Type Inferencing
 ----------------
-  One disadvantage of dynamic languages like python is that you cannot
+One disadvantage of dynamic languages like python is that you cannot
 know the type of variables by a simple analysis of program source code
 most of the time. Knowing the type of variables is very essential for
 providing many of the refactorings and auto-completions. rope will use
 type inferencing to overcome this problem.
 
-  Static type inferencing uses program source code to guess the type
+Static type inferencing uses program source code to guess the type
 of objects. But type inferencing python programs is very hard.
 There have been some attempts though not very successful (examples:
 psycho: only str and int types, StarKiller: wasn't released and
 python programs by transforming its code to other typed languages 
 rather than building IDEs. Such algorithms might be helpful.
 
-  There is another approach toward type inferencing. That is the analysis
+There is another approach toward type inferencing. That is the analysis
 of running programs. This dynamic approach records the types variables are
 assigned to during the program execution. Although this approach is
 a lot easier to implement than the alternative, it is limited. Only the
 Project Road Map
 ================
 
-  The main motive for starting this project was the lack of good
+The main motive for starting this project was the lack of good
 refactoring tools for python language. Refactoring programs like "bicycle repair man"
 aren't reliable due to type inferencing problems discussed earlier and they
 support a limited number of refactorings.
 
 * Why an IDE and not a standalone library or program?
 
-  As Don Roberts one of the writers of the "Refactoring Browser" for
+As Don Roberts one of the writers of the "Refactoring Browser" for
 smalltalk writes in his doctoral thesis:
+
   "An early implementation of the Refactoring Browser for Smalltalk was a
-separate tool from the standard Smalltalk development tools. What we found
-was that no one used it. We did not even use it ourselves. Once we integrated
-the refactorings directly into the Smalltalk Browser, we used them extensively."
+  separate tool from the standard Smalltalk development tools. What we found
+  was that no one used it. We did not even use it ourselves. Once we integrated
+  the refactorings directly into the Smalltalk Browser, we used them extensively."
 
-  The main goal of rope is to concentrate on type inferencing, auto-completion
+The main goal of rope is to concentrate on type inferencing, auto-completion
 and refactoring of python programs and not a state of art IDE (At least not in
 the first phase).
 
-  The type inferencing and refactoring parts of the rope will not be
+The type inferencing and refactoring parts of the rope will not be
 dependent on rope and if successful, will be released as standalone programs
 and libraries so that other projects may use them.
 
 Get Involved!
 =============
 
-  Rope has just started. Right now rope's design changes rapidly and it's not
+Rope has just started. Right now rope's design changes rapidly and it's not
 yet ready for code contributions. I hope in soon future, somewhere about version
 0.5 or 0.6, rope would be mature enough for being extended easily.
 
-  Anyway right now contributions are really needed in many places. For example
+Anyway right now contributions are really needed in many places. For example
 patches and extensions in the UI part are extremely welcome. Have a look at the
 UI enhancement stories(docs/stories.txt). Send your patches in sourceforge.net
 project page, http://sf.net/projects/rope. Patches should use python coding
 Bug Reports
 ===========
 
-  Send your bug reports and feature requests in rope's sourceforge.net
+Send your bug reports and feature requests in rope's sourceforge.net
 project page at http://sf.net/projects/rope.
 
 
 License
 =======
 
-  This program is under the terms of GPL(GNU General Public License). Have a
+This program is under the terms of GPL(GNU General Public License). Have a
 look at copying file for more information.
 
 =========
 
 
-- Auto-completing "self."s : June 14, 2006
+- Auto-completing "self."s : June 13, 2006
 
 
-- Proposing base class attributes : June 13, 2006
+- Proposing base class attributes : June 12, 2006
 
 
 - Auto completion after "."s : June 8, 2006

docs/platform.txt

-*** Platform ***
-  * Project
-  * File local history
-  * Commanding buffer
-  * Plugin support and extensibility
-  * Team
-  * Global and project specific preferences
-  * Saving states between sessions
-  * Acceleration keys
-  * Profiling
-  * Debugging
+Platform
+========
+
+* Project
+* File local history
+* Commanding buffer
+* Plugin support and extensibility
+* Team
+* Global and project specific preferences
+* Saving states between sessions
+* Acceleration keys
+* Profiling
+* Debugging
+

docs/platformui.txt

-*** PlatformUI ***
-  * Basic editing
-  * Syntax highlighting
-  * Multiple buffers
-  * Advanced search
-  * Different views
-  * Configuration editor
-  * Having multiple clipboards
-  * Adding status bar
+PlatformUI
+==========
+
+* Basic editing
+* Syntax highlighting
+* Multiple buffers
+* Advanced search
+* Different views
+* Configuration editor
+* Having multiple clipboards
+* Adding status bar
+

docs/pythonsource.txt

-*** PythonSource ***
-  * Formatting code
-  * Basic refactorings
-  * Advanced refactorings
-  * Type inferencing
-    * static
-    * dynamic
-    * ask user
-  * Code assists
-  * Auto completion
+============
+PythonSource
+============
 
->>> Advanced Refactorings; Need type inferencing
+* Formatting code
+* Basic refactorings
+* Advanced refactorings
+* Type inferencing
+  * static
+  * dynamic
+  * ask user
+* Code assists
+* Auto completion
+
+Advanced Refactorings; Need type inferencing
 * Rename method
 * Remove method
 * Move method
 * Inline method
 * Change method signature
 
->>> Advanced Algorithms
+Advanced Algorithms
 * Finding similar pieces of code while extracting methods
 * Finding similar statements while extracting local variables
 
->>> Help coding
+Help coding
 * Override/implement methods
 * Make getters and setters
 * Organize imports
 * Add import
 * Format source
 
->>> Code Assists
+Code Assists
 * Make module/class/function/method
 * Surround with try statement
 * Remove try statement
 * Go to definition
 * Show pydoc
 
->>> Auto Completion
+Auto Completion
 * Complete variable name
 * Complete method name by using type inferencing
 * Complete function keyword argument
 * Complete module and class name
 
->>> Basic Refactorings
+Basic Refactorings
 * Rename module
 * Move class to another module
 * Move class to a new module
 
 
 * User specified source folders @ 2
-    You should save this project specific information somewhere. How should
+  You should save this project specific information somewhere. How should
   guessed source folders be used.
 
 
 * Auto-completing function parameter names when calling @ 2
 
 
+* Auto completion contexts; strings, comments, functions and ... @ 2
+
+
 * Show quick outline; C-o @ 2
 
 
 * AssList and AssTuple assignments @ 1
 
 
-* Auto completion contexts; strings, comments, functions and ... @ 2
+* Go to definition; F3 @ 1
+  Not overwriting PyNames in pycore; Updating them.
 
 
 > Public release 0.2pre3 : June 18, 2006
 
 
-* Go to definition; F3 @ 1
-  Not overwriting PyNames in pycore; Updating them.
-
-
 Remaining Stories
 =================
 ? Change program goals and description; principles.html

docs/workingon.txt

-* Auto-completing "self."s @ 2
-==============================
+Refactor CodeAssist @ 2
+=======================
 
-- Function decorators
+- Only report scope in which the var is reported global, local, attribute
+
+* Code-assist proposal name should not be so long
+? Compeletion type reflects the structural or dynamic types
 
 ? PyFunction.decorators and bases should be pyobjects
 ? Resource.remove_change_observer
 * PyNames with None object
 ? PyObject might have additional information based on their types; visitor; checking types in many places
 ? Refactor pycore; So many kinds for Modules; eliminate checking module.is_package
-* Better Completion proposals kind to ease transformation; Names inside classes
 ? Not accessing pyname.object in codeassist
 ? PyObject equality check; Value objects
 * Removing duplications in tests in codeassist and pycore scopes

rope/codeassist.py

         result = {}
         for builtin in self.builtins:
             if builtin.startswith(starting):
-                obj = getattr(__builtin__, builtin)
-                kind = 'unknown'
-                if inspect.isclass(obj):
-                    kind = 'class'
-                if inspect.isbuiltin(obj):
-                    kind = 'builtin_function'
-                if inspect.ismodule(obj):
-                    kind = 'module'
-                if inspect.ismethod(obj):
-                    kind = 'method'
-                if inspect.isfunction(obj):
-                    kind = 'function'
-                result[builtin] = CompletionProposal(builtin, kind)
+                result[builtin] = CompletionProposal(builtin, 'builtin')
         return result
 
     def _get_matching_keywords(self, starting):
         inner_scope = current_scope
         def add_pyname_proposal(scope, pyname, name):
             from rope.pycore import PyObject
-            kind = 'local_variable'
+            kind = 'local'
             if scope.get_kind() == 'Module':
-                kind = 'global_variable'
-            if pyname.get_type() == PyObject.get_base_type('Type'):
-                kind = 'class'
-            if pyname.get_type() == PyObject.get_base_type('Function'):
-                kind = 'function'
-            if pyname.get_type() == PyObject.get_base_type('Module'):
-                kind = 'module'
+                kind = 'global'
             result[name] = CompletionProposal(name, kind)
         while current_scope is not None and \
               (current_scope.get_kind() == 'Module' or
                     for name, pyname in element.get_attributes().iteritems():
                         if name.startswith(tokens[-1]) or tokens[-1] == '':
                             complete_name = '.'.join(tokens[:-1]) + '.' + name
-                            add_pyname_proposal(inner_scope, pyname, complete_name)
+                            result[complete_name] = CompletionProposal(complete_name, 'attribute')
         return result
 
     def add_template(self, name, definition):

ropetest/codeassisttest.py

     def test_completing_global_variables(self):
         code = 'my_global = 10\nt = my'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_global', 'global_variable', result)
+        self.assert_completion_in_result('my_global', 'global', result)
 
     def test_not_proposing_unmatched_vars(self):
         code = 'my_global = 10\nt = you'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_not_in_result('my_global', 'global_variable', result)
+        self.assert_completion_not_in_result('my_global', 'global', result)
 
     def test_not_proposing_unmatched_vars_with_underlined_starting(self):
-        code = 'my_global = 10\nt = you_'
+        code = 'my_global = 10\nt = your_'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_not_in_result('my_global', 'global_variable', result)
+        self.assert_completion_not_in_result('my_global', 'global', result)
 
     def test_not_proposing_local_assigns_as_global_completions(self):
         code = 'def f():    my_global = 10\nt = my_'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_not_in_result('my_global', 'global_variable', result)
+        self.assert_completion_not_in_result('my_global', 'global', result)
 
     def test_proposing_functions(self):
         code = 'def my_func():    return 2\nt = my_'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_func', 'function', result)
+        self.assert_completion_in_result('my_func', 'global', result)
 
     def test_proposing_classes(self):
         code = 'class Sample(object):    pass\nt = Sam'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('Sample', 'class', result)
+        self.assert_completion_in_result('Sample', 'global', result)
 
     def test_proposing_each_name_at_most_once(self):
         code = 'variable = 10\nvariable = 20\nt = vari'
         result = self.assist.assist(code, len(code))
         count = len([x for x in result.completions
-                     if x.name == 'variable' and x.kind == 'global_variable'])
+                     if x.name == 'variable' and x.kind == 'global'])
         self.assertEquals(1, count)
 
     def test_throwing_exception_in_case_of_syntax_errors(self):
     def test_ignoring_errors_in_current_line(self):
         code = 'def my_func():    return 2\nt = '
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_func', 'function', result)
+        self.assert_completion_in_result('my_func', 'global', result)
 
     def test_not_reporting_variables_in_current_line(self):
         code = 'def my_func():    return 2\nt = my_'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_not_in_result('my_', 'global_variable', result)
+        self.assert_completion_not_in_result('my_', 'global', result)
 
     def test_completion_result(self):
         code = 'my_global = 10\nt = my'
     def test_completing_imported_names(self):
         code = 'import sys\na = sy'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('sys', 'module', result)
+        self.assert_completion_in_result('sys', 'global', result)
 
     def test_completing_imported_names_with_as(self):
         code = 'import sys as mysys\na = mys'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('mysys', 'module', result)
+        self.assert_completion_in_result('mysys', 'global', result)
 
     def test_not_completing_imported_names_with_as(self):
         code = 'import sys as mysys\na = sy'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_not_in_result('sys', 'module', result)
+        self.assert_completion_not_in_result('sys', 'global', result)
 
     def test_including_matching_builtins_types(self):
         code = 'my_var = Excep'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('Exception', 'class', result)
+        self.assert_completion_in_result('Exception', 'builtin', result)
+        self.assert_completion_not_in_result('zip', 'builtin', result)
         
     def test_including_matching_builtins_functions(self):
         code = 'my_var = zi'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('zip', 'builtin_function', result)
+        self.assert_completion_in_result('zip', 'builtin', result)
         
     def test_including_keywords(self):
         code = 'fo'
     def test_not_reporting_proposals_after_dot(self):
         code = 'a_dict = {}\nkey = 3\na_dict.ke'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_not_in_result('key', 'global_variable', result)
+        self.assert_completion_not_in_result('key', 'global', result)
 
     def test_proposing_local_variables_in_functions(self):
         code = 'def f(self):\n    my_var = 10\n    my_'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_var', 'local_variable', result)
+        self.assert_completion_in_result('my_var', 'local', result)
 
     def test_local_variables_override_global_ones(self):
         code = 'my_var = 20\ndef f(self):\n    my_var = 10\n    my_'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_var', 'local_variable', result)
+        self.assert_completion_in_result('my_var', 'local', result)
 
     def test_not_including_class_body_variables(self):
         code = 'class C(object):\n    my_var = 20\n    def f(self):\n        a = 20\n        my_'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_not_in_result('my_var', 'local_variable', result)
+        self.assert_completion_not_in_result('my_var', 'local', result)
 
     def test_nested_functions(self):
         code = "def my_func():\n    func_var = 20\n    def inner_func():\n        a = 20\n        func"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('func_var', 'local_variable', result)
+        self.assert_completion_in_result('func_var', 'local', result)
 
     def test_scope_endpoint_selection(self):
         code = "def my_func():\n    func_var = 20\n"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_not_in_result('func_var', 'local_variable', result)
+        self.assert_completion_not_in_result('func_var', 'local', result)
 
     def test_scope_better_endpoint_selection(self):
         code = "if True:\n    def f():\n        my_var = 10\n    my_"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_not_in_result('my_var', 'local_variable', result)
+        self.assert_completion_not_in_result('my_var', 'local', result)
 
     def test_imports_inside_function(self):
         code = "def f():\n    import sys\n    sy"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('sys', 'module', result)
+        self.assert_completion_in_result('sys', 'local', result)
 
     def test_imports_inside_function_dont_mix_with_globals(self):
         code = "def f():\n    import sys\nsy"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_not_in_result('sys', 'module', result)
+        self.assert_completion_not_in_result('sys', 'local', result)
 
     def test_nested_classes_local_names(self):
         code = "global_var = 10\ndef my_func():\n    func_var = 20\n    class C(object):\n" + \
                "        def another_func(self):\n            local_var = 10\n            func"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('func_var', 'local_variable', result)
+        self.assert_completion_in_result('func_var', 'local', result)
 
     def test_nested_classes_global(self):
         code = "global_var = 10\ndef my_func():\n    func_var = 20\n    class C(object):\n" + \
                "        def another_func(self):\n            local_var = 10\n            globa"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('global_var', 'global_variable', result)
+        self.assert_completion_in_result('global_var', 'global', result)
 
     def test_nested_classes_global_function(self):
         code = "global_var = 10\ndef my_func():\n    func_var = 20\n    class C(object):\n" + \
                "        def another_func(self):\n            local_var = 10\n            my_f"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_func', 'function', result)
+        self.assert_completion_in_result('my_func', 'global', result)
 
     def test_proposing_function_parameters_in_functions(self):
         code = "def my_func(my_param):\n    my_var = 20\n    my_"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_param', 'local_variable', result)
+        self.assert_completion_in_result('my_param', 'local', result)
 
     def test_proposing_function_keyword_parameters_in_functions(self):
         code = "def my_func(my_param, *my_list, **my_kws):\n    my_var = 20\n    my_"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_param', 'local_variable', result)
-        self.assert_completion_in_result('my_list', 'local_variable', result)
-        self.assert_completion_in_result('my_kws', 'local_variable', result)
+        self.assert_completion_in_result('my_param', 'local', result)
+        self.assert_completion_in_result('my_list', 'local', result)
+        self.assert_completion_in_result('my_kws', 'local', result)
 
     def test_not_proposing_unmatching_function_parameters_in_functions(self):
         code = "def my_func(my_param):\n    my_var = 20\n    you_"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_not_in_result('my_param', 'local_variable', result)
+        self.assert_completion_not_in_result('my_param', 'local', result)
 
     def test_ignoring_current_statement(self):
         code = "my_var = 10\nmy_tuple = (10, \n           my_"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_var', 'global_variable', result)
+        self.assert_completion_in_result('my_var', 'global', result)
 
     def test_ignoring_current_statement_brackets_continuation(self):
         code = "my_var = 10\n'hello'[10:\n        my_"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_var', 'global_variable', result)
+        self.assert_completion_in_result('my_var', 'global', result)
 
     def test_ignoring_current_statement_explicit_continuation(self):
         code = "my_var = 10\nmy_var2 = 2 + \\\n          my_"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_var', 'global_variable', result)
+        self.assert_completion_in_result('my_var', 'global', result)
 
     def test_ignoring_current_statement_while_the_first_statement_of_the_block(self):
         code = "my_var = 10\ndef f():\n    my_"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_var', 'global_variable', result)
+        self.assert_completion_in_result('my_var', 'global', result)
 
     def test_ignoring_current_statement_while_current_line_ends_with_a_colon(self):
         code = "my_var = 10\nif my_:\n    pass"
         result = self.assist.assist(code, 18)
-        self.assert_completion_in_result('my_var', 'global_variable', result)
+        self.assert_completion_in_result('my_var', 'global', result)
 
     def test_ignoring_string_contents(self):
         code = "my_var = '('\nmy_"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_var', 'global_variable', result)
+        self.assert_completion_in_result('my_var', 'global', result)
 
     def test_ignoring_comment_contents(self):
         code = "my_var = 10 #(\nmy_"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_var', 'global_variable', result)
+        self.assert_completion_in_result('my_var', 'global', result)
 
     def test_ignoring_string_contents_backslash_plus_quotes(self):
         code = "my_var = '\\''\nmy_"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_var', 'global_variable', result)
+        self.assert_completion_in_result('my_var', 'global', result)
 
     def test_ignoring_string_contents_backslash_plus_backslash(self):
         code = "my_var = '\\\\'\nmy_"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_var', 'global_variable', result)
+        self.assert_completion_in_result('my_var', 'global', result)
 
     def test_not_proposing_later_defined_variables_in_current_block(self):
         code = "my_\nmy_var = 10\n"
         result = self.assist.assist(code, 3)
-        self.assert_completion_not_in_result('my_var', 'global_variable', result)
+        self.assert_completion_not_in_result('my_var', 'global', result)
 
     def test_not_proposing_later_defined_variables_in_current_function(self):
         code = "def f():\n    my_\n    my_var = 10\n"
         result = self.assist.assist(code, 16)
-        self.assert_completion_not_in_result('my_var', 'local_variable', result)
+        self.assert_completion_not_in_result('my_var', 'local', result)
 
     def test_ignoring_string_contents_with_triple_quotes(self):
         code = "my_var = '''(\n'('''\nmy_"
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_var', 'global_variable', result)
+        self.assert_completion_in_result('my_var', 'global', result)
 
     def test_ignoring_string_contents_with_triple_quotes_and_backslash(self):
         code = 'my_var = """\\"""("""\nmy_'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_var', 'global_variable', result)
+        self.assert_completion_in_result('my_var', 'global', result)
 
     def test_ignoring_string_contents_with_triple_quotes_and_double_backslash(self):
         code = 'my_var = """\\\\"""\nmy_'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('my_var', 'global_variable', result)
+        self.assert_completion_in_result('my_var', 'global', result)
 
     def test_reporting_params_when_in_the_first_line_of_a_function(self):
         code = 'def f(param):\n    para'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('param', 'local_variable', result)
+        self.assert_completion_in_result('param', 'local', result)
 
     def assert_template_in_result(self, name, result):
         for template in result.templates:
     def test_code_assist_when_having_a_two_line_function_header(self):
         code = 'def f(param1,\n      param2):\n    para'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('param1', 'local_variable', result)
+        self.assert_completion_in_result('param1', 'local', result)
 
     def test_code_assist_with_function_with_two_line_return(self):
         code = 'def f(param1, param2):\n    return(param1,\n           para'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('param2', 'local_variable', result)
+        self.assert_completion_in_result('param2', 'local', result)
 
 
 class CodeAssistInProjectsTest(unittest.TestCase):
     def test_simple_import(self):
         code = 'import samplemod\nsample'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('samplemod', 'module', result)
+        self.assert_completion_in_result('samplemod', 'global', result)
 
     def test_from_import_class(self):
         code = 'from samplemod import SampleClass\nSample'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('SampleClass', 'class', result)
+        self.assert_completion_in_result('SampleClass', 'global', result)
 
     def test_from_import_function(self):
         code = 'from samplemod import sample_func\nsample'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('sample_func', 'function', result)
+        self.assert_completion_in_result('sample_func', 'global', result)
 
     def test_from_import_variable(self):
         code = 'from samplemod import sample_var\nsample'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('sample_var', 'global_variable', result)
+        self.assert_completion_in_result('sample_var', 'global', result)
 
     def test_from_imports_inside_functions(self):
         code = 'def f():\n    from samplemod import SampleClass\n    Sample'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('SampleClass', 'class', result)
+        self.assert_completion_in_result('SampleClass', 'local', result)
 
     def test_from_import_only_imports_imported(self):
         code = 'from samplemod import sample_func\nSample'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_not_in_result('SampleClass', 'class', result)
+        self.assert_completion_not_in_result('SampleClass', 'global', result)
 
     def test_from_import_star(self):
         code = 'from samplemod import *\nSample'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('SampleClass', 'class', result)
+        self.assert_completion_in_result('SampleClass', 'global', result)
 
     def test_from_import_star2(self):
         code = 'from samplemod import *\nsample'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('sample_func', 'function', result)
-        self.assert_completion_in_result('sample_var', 'global_variable', result)
+        self.assert_completion_in_result('sample_func', 'global', result)
+        self.assert_completion_in_result('sample_var', 'global', result)
 
     def test_from_import_star_not_imporing_underlined(self):
         code = 'from samplemod import *\n_under'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_not_in_result('_underlined_func', 'function', result)
+        self.assert_completion_not_in_result('_underlined_func', 'global', result)
 
     def test_from_package_import_mod(self):
         code = 'from package import nestedmod\nnest'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('nestedmod', 'module', result)
+        self.assert_completion_in_result('nestedmod', 'global', result)
 
     def test_from_package_import_star(self):
         code = 'from package import *\nnest'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_not_in_result('nestedmod', 'module', result)
+        self.assert_completion_not_in_result('nestedmod', 'global', result)
 
     def test_completing_after_dot(self):
         code = 'class SampleClass(object):\n    def sample_method(self):\n        pass\nSampleClass.sam'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('SampleClass.sample_method', 'function', result)
+        self.assert_completion_in_result('SampleClass.sample_method', 'attribute', result)
 
     def test_completing_after_multiple_dots(self):
         code = 'class Class1(object):\n    class Class2(object):\n        def sample_method(self):\n' + \
                '            pass\nClass1.Class2.sam'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('Class1.Class2.sample_method', 'function', result)
+        self.assert_completion_in_result('Class1.Class2.sample_method', 'attribute', result)
 
     def test_completing_after_self_dot(self):
         code = 'class Sample(object):\n    def method1(self):\n        pass\n    def method2(self):\n' + \
                '        self.m'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('self.method1', 'function', result)
+        self.assert_completion_in_result('self.method1', 'attribute', result)
 
     # TODO: Unknowns and variables are distinct
     def xxx_test_unknown_when_module_cannot_be_found(self):
         code = 'from doesnotexist import nestedmod\nnest'
         result = self.assist.assist(code, len(code))
-        self.assert_completion_in_result('nestedmod', 'unknown', result)
+        self.assert_completion_in_result('nestedmod', 'global', result)
 
 
 class TemplateTest(unittest.TestCase):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.