Anonymous avatar Anonymous committed ef152ea

ropemacs: added rope-show-doc

Comments (0)

Files changed (1)

rope/contrib/ropemacs.py

         func.interaction = self.mode
         return func
 
+
 class RopeInterface(object):
 
     def __init__(self):
             ('C-x p u', lisp.rope_undo_refactoring),
             ('C-x p r', lisp.rope_redo_refactoring),
             ('C-c g', lisp.rope_goto_definition),
+            ('C-c C-d', lisp.rope_show_doc),
+
             ('C-c r r', lisp.rope_rename),
             ('C-c r l', lisp.rope_extract_variable),
             ('C-c r m', lisp.rope_extract_method),
         if definition[1]:
             lisp.goto_line(definition[1])
 
+    @interactive()
+    def show_doc(self):
+        self._check_project()
+        resource, offset = self._get_location()
+        docs = codeassist.get_doc(
+            self.project, lisp.buffer_string(), offset, resource)
+        if docs:
+            pydoc_buffer = lisp.get_buffer_create('*rope-pydoc*')
+            lisp.set_buffer(pydoc_buffer)
+            lisp.erase_buffer()
+            lisp.insert(docs)
+            lisp.display_buffer(pydoc_buffer)
+
     def _get_location(self):
         resource = self._get_resource()
         offset = self._get_offset()
 exiting_actions = interface.exiting_actions
 
 goto_definition = interface.goto_definition
+show_doc = interface.show_doc
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.