Closed amirhosseindavoody closed 1 year ago
We have this on hover? I assume you've already seen that and would prefer a separate window?
Yes, I have seen it. A couple of points:
On a personal note, I find the intelisence not very useful since very often the help hover window takes a lot of time to show up.
+1
I am looking for same feature. is it implemented ? if yes how to enable it
Thank you !
This is sort of implemented. We don't have a separate window for it, but the base support of typing a '?' before something in the interactive window works.
Example:
okay thanks for your response
@rchiodo not the same, Jupiter’s automatic contextual help is just amazing.
Being able to see the state of variables and documentation just by clicking on a cell is just great. Huge productivity boost.
@javierbq so the clicking is the key? ?var
returns the same information as the contextual help panel.
Doesn't seem too hard to implement this on clicking on a value.
For future reference, contextual help is on the help menu in Jupyter Lab. It opens a tab at the bottom that responds to click events in code with sending an 'inspect_request' to the kernel for whatever is under the mouse. The results of the inspect request are then displayed in the help panel.
@javierbq so the clicking is the key?
?var
returns the same information as the contextual help panel.Doesn't seem too hard to implement this on clicking on a value.
Yes, in my experience it makes a big difference to have the extra tab open side by side the editor and whereever the cursor is, it shows the output of ?var for that variable.
/cc @claudiaregio @jmew
I would like to strongly support this!
I have been switching between Python IDEs on a search for the best, and have now arrived at VS Code which in my experience is superior in many ways.
But one feature I really miss from Jupyter Lab is the automatically updated contextual help panel.
As I wrote in issue microsoft/vscode-python#11655 linked to above, the current pop-up crushes everything together, is too small to read long texts, and disappears too easily on mouse movement. It is also often hard to trigger.
Yes, it is possible to use the IPython-style ?
, but that means to open a new cell, type in the command, then scroll through a small viewport. For many packages, documentation can be many pages long, I think that deserves a dedicated panel.
Just adding another voice to support this - this feature alone is why I am not in Vscode full time. It might sound trivial but this feature easily saves me hours in development time or when coming up to speed on a package.
Same as Jaunson! Getting quick contextual information (docs are a great start but any additional information is welcome) of whatever is under the cursor is a huge productivity boost. Hope to see this implemented soon.
Indeed, this is what keeps me productive in Jupyter. I don't have to memorize all the stuff.
When it gets implemented, please also enable a keyboard shortcut for it. In Jupyter there are 3 shortcuts that display progressively more information:
Shift + Tab
parameter hints
this is what VS Code currently displays when the caret is within (...)
.
In both editors, it is often too small to understand anything
Shift + Tab + Tab [ + Tab] (2 or 3 times)
Shift + 4 * Tab
An extension that kind of does this is Kite Copilot : https://www.kite.com/copilot/ … but it is an external app and I don't want to install the whole of Kite for this.
Another external app which provides similar functionality is Dash -- there is an extension which interfaces with VS Code, but you need to have Dash window next to VS Code window (to recreate the experience). I haven't tested if it woks in notebooks.
I would say that this functionality will benefit the non-notebook workflow too
+1 on this. I haven't been able to get shift+tab when I'm working with vscode jupyter to work the same way as it does in browser, and have tried a few things at this point. This feature is pretty much the only reason I still use the browser version.
+1
+1
++1
Hey @rchiodo , I think this feature is a major productivity booster and time saver.
RStudio, similarly has a separate window for that, "Help" pane. Just select a function and press F1
and it will open the documentation.
Advantages:
(1) You can define the size of "Help" pane. (Kite window size is too small and makes really hard to inspect some documents)
(2) Unlike Kite hover feature, it stays open while you work on your code, so that you can reference to it in real time
(3) Unlike help(function)
command, it already shows the documentation from the beginning, so there is no need to scroll up to the beginning of the output cell every time to see the documentation, which is really painful.
(4) It keeps the history of help searches to go back at it
Thank you
I use VSCode for editing existing Python/SQL scripts but never the Jupyter notebook feature when starting new projects because of this feature. The boost to productivity and learning an API is huge especially with the context panel and the shift tab shortcut. Same issues as other reported with hover and how quickly it disappears, and having to switch between keyboard and mouse is not ideal.
This would be an amazing feature to add as another panel like the data viewer panel but one that you can position permanently on a part of the screen. Thanks for considering this!
+1 - pls add this functionality to VSCode. It would be a significant breakthrough. You also may want to look at Spyder. I love its always-on help.
I just discovered this new extension which addresses the issue very well: [https://marketplace.visualstudio.com/items?itemName=bierner.docs-view]
@Cyberjoe, that's a great find!
Unfortunately, it doesn't work within notebooks, but neither does the standard popup (at least not properly).
I just discovered this new extension which addresses the issue very well: [https://marketplace.visualstudio.com/items?itemName=bierner.docs-view]
Fantastic extension, it would be great to see it incorporated in VScode as the default. Thanks a lot for the suggestion
I discovered this trick too using "Open Definition to the Side" command: https://www.youtube.com/watch?v=3p4pXhpPVf4
+1
When this feature comes up, I really hope it works for .py
files in Interactive Window too.
For that, do we have to open the same issue in vscode-python
?
@GitHunter0
For that, do we have to open the same issue in vscode-python?
No this window would be created in the jupyter extension for the interactive window. The interactive window is talking to a notebook kernel in the background, and that's what would drive the contextual help. At least one way to do it. @mjbvz's doc-view extension works without a kernel though. It just uses the hover provider.
+1. This missing feature, because it saves so much time, is basically the only reason I still prefer Jupyter Notebook's standard browser editor over VS Code's Jupyter extension, even though I really like a lot of VS Code's other features. I'd switch to VS Code in a heartbeat if it had as good contextual help as Jupyter Notebook. The following is my reasoning (please correct me if wrong or I'm missing something).
To make the differences clear, I've attached images showing how Jupyter Notebook's "Shift-Tab" contextual help feature is better than VS Code's in all practical cases (in my every day use). I show 3 cases (numpy, pandas, and glob function applications), and compare Jupyter Notebook's "shift-tab" contextual help against VS Code's "hover" documentation. The last cell of each image shows the output of <function>?
, for reference.
Jupyter Notebook:
,
,
VS Code:
,
,
In all cases, the VS Code either shows nothing useful (randint case) or some minimal documentation (not as extensive as Jupyter or ?
command), whereas Jupyter Notebook shows either the ?
command output or something even more useful (glob case).
My understanding is that the Docs View extension mentioned as a possible solution above (https://marketplace.visualstudio.com/items?itemName=bierner.docs-view) would just show "hover" documentation, which the examples show is still not good in some cases.
I've only started using VS Code recently, so please let me know if I'm missing or misunderstanding something important!
Hoping this feature will come soon!
In all cases, the VS Code either shows nothing useful (randint case) or some minimal documentation (not as extensive as Jupyter or
?
command), whereas Jupyter Notebook shows either the?
command output or something even more useful (glob case).My understanding is that the Docs View extension mentioned as a possible solution above (https://marketplace.visualstudio.com/items?itemName=bierner.docs-view) would just show "hover" documentation, which the examples show is still not good in some cases.
Yes, I have the same experience, neither VScode/Kite nor Docs View extension display the full documentation of methods in many cases. I think it is a major issue, sometimes I even use RStudio to work on Python files because of these help limitations.
VScode is amazing in some many aspects but this one is definitively a shortcoming.
cc/ @savannahostrowski
This is half of my jupyter workflow; and to be clear, this means wiring up vscode to the interpreter state, instead of getting it from static analysis. I can't switch to vscode-jupyter without this.
+1 This is definitely a huge VSCode shortcoming.
I'd like to add yet another +1 on this, I've had the exact same experience as @dennischenfeng. It's literally the only thing that causes me to still use Jupyter Lab over VSCode. I'd immediately switch to VSCode exclusively if this feature existed.
Unfortunately it's not just a matter of how information is displayed, but also how detailed is the doc shown to the user
@rchiodo @greazer I honestly think this is the most important issue in VSCode right now.
I'm seeing requests for this from colleagues otherwise interested in moving to VS Code! +1 from me!
Is this still not implemented yet? It would provide such a huge boost to productivity.
The newly introduced side panel provides an opportunity to display contextual help.
There's still significant potential for improvement. VSCode Developers - please have a look at Spyder in terms of process/layout/formatting.
@Cyberjoe , the problem is that Docs View extension, like VScode, in many cases also does not find and display the complete documentation like JupyterLab does. Nonetheless, that was a very good tip.
I think some parts of this issue have been solved (which I'm happy about!), while others remain unsolved.
Examples that are resolved:
Some np, pd, and path lib functions, that I linked to in my original post on this thread (2021/10/14). VS Code now properly shows comparable contextual help to JupyterLab
Examples not yet resolved:
I only tested some torch functions (not many other packages), and seems like for some reason their contextual help still hasn't been improved, whereas JupyterLab's contextual help is still better.
Idk why some packages show discrepancy between VS Code vs JupyterLab, whereas others don't. Nonetheless, I'm still glad that it's actually being worked on and there has been some improvement so far.
@dennischenfeng , very glad to know it is improving. As others have claimed and I agree, this is the most important issue of VScode right now.
+1
+1
I have some good news. We were able to create a power toys extension that partially implements this feature. I say partial because it's not the exact same behavior as jupyter where you hit F1 and it gives you more and more detail.
You can try it out here with either the insiders version of VS code or wait for the next version of VS code stable to ship.
Contextual help window looks like so:
It should be noted it's a little rough. It's from a hackathon project I did last year to try and address this that we never put in the real product. So it might not work, and the UI looks a bit stale. But hopefully it gives the information asked for.
There's a setting to control the detail level of the output:
@rchiodo indeed a great news! Will this work in the Interactive Window too? (I only use Jupyter Notebooks if I really have to, the Interactive Window is a better and cleaner product in my opinion)
It kinda works in the interactive window. At least in cells already run. Doesn't work in the input box because VS code doesn't treat that the same.
Oh and you have to expand the cells after they run to get the help.
In that picture I've run a cell where the last line is 'pd.array'. As I move the cursor around in that line, the contextual help changes.
One of the great benefits of python notebook is the exploratory nature of it. I personally find the contextual help window in
jupyter lab
a very helpful feature that makes the exploratory data analysis very easy by providing a fluid guide for the many API's that one might have to try. I don't know how big of an ask this is, but it would be much appreciated to provide this in VScode notebook editor.Below is a screen shot of what I am referring to in jupyter lab. The functionality is that by clicking on each function, the docstring for that function is show in the contextual help window.