Is there a function to dynamically change the name of the buttons in vscode notebook toolbar dynamically after an action? - visual-studio-code

This question is not related to Python.
We have a custom language type and using vscode notebooks to execute our code. We have a button called "Select App" similar to "Select Kernel" button in the vscode-jupyter extension.
I want to update the button title to the app name dynamically after selecting from the kernel picker.
The vscode documentation doesn't provide any API docs for the same.
Screenshot
Expecting to rename buttons dynamically in the notebook toolbars.

Related

Custom command palette in VSCode Extension

I am developing a VSCode extension that adds a status bar item. I want that when clicked, it will open a custom command palette with special commands. The functionality I am looking for is very similar to the built in Git item on the left of the status bar, which when clicked open a palette that offer to do Git stuff.
The built-in Git item uses the QuickPick Capability.
Check out the API here, and a demo here.

Custom vscode extension - how to react on text changes in editor (not file - before save)

I am developing my custom vscode extension and for now I have several commands triggered by right click context menu.
Now I would like to add possibility for user, who doesn't like clicks just to write code and display context menu during writing.
Or just react base on typed text (like snippets, but instead of autocomplete, just run my custom command)
So flow is following:
User starts to type 'fooC'
option a) Some listener subscribe and run command FooCommand.
option b) List of available commands is displayed (like context menu during writing)
Is it possible with vscode API ? Do you have any ideas or workarounds ?

How to add a command to Jupyter Notebook toolbar in Visual Studio Code?

My default Jupyter Notebook toolbar in VS Code has a command "Clear Outputs of All Cells". I would like to add a similar but different command Notebook: Clear Cell Outputs, which only clears one cell at a time. I can do that by pressing ALT + DEL, but it would be convenient to have it in toolbar.
I have added this button to the Context Menu Extra extension (v0.4.0) (You need VSC v1.62, because I don't know when some experimental API got public)
If the cell has output you should see the "Clear Cell Output" button in the cell toolbar at first position.
There is no documentation of the allowed groups for this menu. I have used a group the Jupyter extensions also uses. That is the reason it is one of the first buttons.

How to add an icon in Activity bar of Visual Studio Code that will trigger a keyboard shortcut

Is it possible to add an icon in Activity bar of Visual Studio Code that will trigger a keyboard shortcut like Ctrl+Shift+P. Or executing a command from Command Palette.
Only extensions can add an icon in the activity bar (officially called a "views container"). They cannot trigger a command, though. See the official documentation here:
https://code.visualstudio.com/api/extension-capabilities/extending-workbench
https://code.visualstudio.com/updates/v1_23#_custom-activity-bar-views
However, maybe these extensions might fit your needs, they allow creation of custom commands in the status bar or the editor menu bar:
https://marketplace.visualstudio.com/items?itemName=seunlanlege.action-buttons
https://marketplace.visualstudio.com/items?itemName=jerrygoyal.shortcut-menu-bar

How do you show what function you are in in Visual Studio Code?

How do I show what function I'm in? I'd like to be able to see where ever I place my cursor, to see what function I'm in preferably in the footer tray bar.
As mentioned in the comments, this can be achieved without any extension by opening command palette and selecting "View: Toggle Breadcrumbs"
There appears to be a functional extension for this mentioned in the GitHub issue:
Show the current function/method name in the toolbar:
https://github.com/Microsoft/vscode/issues/32869
Here is the extension:
https://marketplace.visualstudio.com/items?itemName=amos402.scope-bar