Skip to content
This repository

Show class init and call tooltips in notebook #1096

Merged
merged 1 commit into from over 2 years ago

2 participants

Bradley M. Froehle Fernando Perez
Bradley M. Froehle
Collaborator

Just like in Qt console, this patch shows the docstring and definition of the first match among the call, constructor, and main methods.

Bradley M. Froehle
Collaborator

This should fix issue #1094.

Bradley M. Froehle bfroehle reopened this
Fernando Perez fperez merged commit 9a36fc8 into from
Fernando Perez fperez referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Dec 18, 2011
Bradley M. Froehle bfroehle Show class init and call tooltips in notebook.
Closes #1094.
c6bcbb5
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 10 additions and 3 deletions. Show diff stats Hide diff stats

  1. +10 3 IPython/frontend/html/notebook/static/js/codecell.js
13 IPython/frontend/html/notebook/static/js/codecell.js
@@ -162,9 +162,16 @@ var IPython = (function (IPython) {
162 162 }
163 163
164 164 CodeCell.prototype.finish_tooltip = function (reply) {
165   - defstring=reply.definition;
166   - docstring=reply.docstring;
167   - if(docstring == null){docstring="<empty docstring>"};
  165 + // Extract call tip data; the priority is call, init, main.
  166 + defstring = reply.call_def;
  167 + if (defstring == null) { defstring = reply.init_definition; }
  168 + if (defstring == null) { defstring = reply.definition; }
  169 +
  170 + docstring = reply.call_docstring;
  171 + if (docstring == null) { docstring = reply.init_docstring; }
  172 + if (docstring == null) { docstring = reply.docstring; }
  173 + if (docstring == null) { docstring = "<empty docstring>"; }
  174 +
168 175 name=reply.name;
169 176
170 177 var that = this;

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.