Anonymous avatar Anonymous committed a032e2c

interface: added rope-get-docstring command

Comments (0)

Files changed (1)

ropemode/interface.py

                        self.resource, maxfixes)
         self.env.show_doc(docs, prefix)
         if docs is None:
-            self.env.message('No docs avilable!')
+            self.env.message('No docs available!')
 
     def _get_text(self):
         resource = self.resource
             ask_func = self.env.ask_directory
         return ask_func(**ask_args)
 
+    @decorators.local_command()
+    def get_docstring(self):
+        self._check_project()
+        # almost like _base_show_doc()
+        maxfixes = self.env.get('codeassist_maxfixes')
+        text = self._get_text()
+        offset = self.env.get_offset()
+        return codeassist.get_doc(self.project, text, offset,
+                                  self.resource, maxfixes)
+
 
 class Location(object):
     def __init__(self, location):
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.