Anonymous avatar Anonymous committed 532c8f4

Removed maxfixes argument from codeassist.get_doc

Comments (0)

Files changed (2)

rope/contrib/codeassist.py

 import sys
 
 import rope.base.codeanalyze
-from rope.base import (pyobjects, pynames, taskhandle, builtins,
-                       codeanalyze, exceptions)
+from rope.base import pyobjects, pynames, taskhandle, builtins, exceptions
 from rope.base.codeanalyze import (ArrayLinesAdapter, BadIdentifierError,
                                    LogicalLineFinder, ScopeNameFinder,
                                    SourceLinesAdapter, WordRangeFinder)
     return starting_offset
 
 
-def get_doc(project, source_code, offset, resource=None, maxfixes=1):
+def get_doc(project, source_code, offset, resource=None):
     """Get the pydoc
 
     `maxfixes` is the maximum number of errors to fix if the code has
 
     """
     pymodule = _get_pymodule(project.pycore, source_code, resource,
-                             maxfixes=maxfixes, error_limit=offset)
+                             error_limit=offset)
     scope_finder = ScopeNameFinder(pymodule)
     element = scope_finder.get_pyname_at(offset)
     if element is None:

ropetest/contrib/codeassisttest.py

         doc = get_doc(self.project, src, src.rindex('replace') + 1)
         self.assertTrue(doc is not None)
 
-    def test_get_pydoc_and_passing_maxfixes(self):
-        src = 's = "hey"\ns.replace()\nsldjf sljdf'
-        doc = get_doc(self.project, src,
-                      src.rindex('replace') + 1, maxfixes=1)
-        self.assertTrue(doc is not None)
-
-    @testutils.assert_raises(exceptions.ModuleSyntaxError)
-    def test_get_pydoc_and_passing_zero_maxfixes(self):
-        src = 's = "hey"\ns.replace\nsdlj sldjf'
-        doc = get_doc(self.project, src,
-                      src.rindex('replace') + 1, maxfixes=0)
-
     @testutils.assert_raises(exceptions.ModuleSyntaxError)
     def test_not_commenting_errors_before_offset(self):
         src = 'lsjd lsjdf\ns = "hey"\ns.replace()\n'
-        doc = get_doc(self.project, src,
-                      src.rindex('replace') + 1, maxfixes=1)
+        doc = get_doc(self.project, src, src.rindex('replace') + 1)
 
     def test_proposing_variables_defined_till_the_end_of_scope(self):
         code = 'if True:\n    a_v\na_var = 10\n'
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.