I can find many examples having simple button-like action, I'de like to know if this kind of view is possible via the vscode api.
Related
I'm creating a custom editor document extension for vscode and I want to have a custom find widget that will suit what I'm doing in my document. How do I capture the find event and execute some code. I tried registering a command for "actions.find" but this made other tabs not able to use the find command. Is there an easy way to do this?
When I edit JavaScript code, VSCode immediately show me a popup with a list of parameters as soon as I have typed a function name followed by (.
When editing Dart code this is not the case. Here I have to use the mouse to hover over the function name to show a popup with information about the function.
Is this normal behaviour? Are there any way to change this behaviour? Does anyone know a shortcut to show the popup?
This is controlled by a VS Code user setting in the Dart extension (dart.triggerSignatureHelpAutomatically). It's not on by default because there are some quirks (that I don't remember exactly off the top of my head).
There's work in progress to move the extension to using the LSP protocol which will push some of this functionality into the Dart analysis server, which may make it easier to make some functionality like this more reliable (since more info is available in the language server than is currently exposed to the VS Code extension).
When working with multiple tabs open, it is important to be able to identify which tabs "go together" or are more important than others. Is there a extension to VS code that let you assign different color for each tab individually or somehow otherwise group tabs together without wasting screen estate using split views
As of today it looks like there are no extensions allowing this. VSCode's team intentionally doesn't want extensions to change the VScode UI, so it looks like it won't be possible with an extension anytime soon.
It is a feature I would very much like to see in VSCode too, there is a feature request on github. Vote to get it seen and maybe added to VSCode !
I'm trying to make an extension for VSCode to Find text in File (Like in Notepad++).
Is there an API for using a modal in a VSCode extension? or at least extend the Command Palette?
VS Code (1.34) has no concept modal UI. Extensions can only show basic dialog messages modally using the showMessage apis.
Messages can show message text and a set of buttons. By default VS Code will render messages in its UI. The MessageOptions.modal option makes VS Code render the message using system UI instead.
Try positing a more specific question about what you are trying to accomplish. VS Code's extension model is different from other editors, so if you are trying to replicate functionality from another editor like Notepad++ you may need to rethink the user experience.
I believe what you are looking for is an input box. It will show a UI where you can input text. From there you can grab the text of a document and parse it for entered text. For completeness, VS Code does this with ctrl + f or cmd + f depending on OS. Add the shift key to search the whole project.
As mentioned above there are the limited built-in inputs and message box (which can also be used to display choice buttons).
You can also have a look at WebView these can be used to display a side-bar view (like the EXPLORER) or a full document. They are made up from HTML and plain old JavaScript. You will have to pass simple string messages between your HTML/JS view and vscode itself.
https://code.visualstudio.com/api/extension-guides/webview
https://github.com/Microsoft/vscode-extension-samples/tree/main/tree-view-sample
A large 'document' view example vscode extension is call 'nearest-icons'
https://github.com/noGreg/nearest-icons
Is there a way to quickly navigate through large files with multiple functions?
Something like class view in VS ?
Yes, there is the workbench.action.gotoSymbol command also known as outlining. Its default shortcut is CTRL+Shift+O.
If you have an extension installed which supports this command for the current file type then a list of methods, classes and maybe other symbols for the current file will drop down which allows you to jump to their definitions.
Yes, there is now a built-in Outline View in VS CODE
There is a built-in Outline View in Vscode (as other answer said)
There is also [outline-map] https://marketplace.visualstudio.com/items?itemName=Gerrnperl.outline-map
it collapses the object/hierarchy automatically, & expands as you scroll to it.
(recommended, more usable than the built-in one)
(or just find other ones in Vscode Extension Marketplace)