is there any way to collapse the tree view programatically.
I want to collapse my tree view when a button is clicked
PFA Screenshot.
I want Minimise the Firmware Layout View when 'Locate in Project View' is clicked.
There is a commit with a new command which may help, see 157410 Add Command to Fully Collapse Tree Items and in that commit this command:
list.collapseAllToFocus
[Update: now that I can test this I don't think this new command does what you need - it doesn't get to the top of the view and collapse that. It does collapse any included item and any of its included subItem items (so collapsing recursively - which is new) - but not at the top level, which is what you need.]
Here is an issue on this: API to programatically expand/collapse tree view
You can collapse that view - its contents only - but it appears you can't actually close the view itself - so it is reduced to a single line. Which I think is what you want. To collapse the contents so they are not visible (but still taking up their previous vertical space) read on. If there were a way to focus that view header which I believe it is called, then it would be easy to collapse the entire thing with the list.collapse command.
If you have your extension running, either in the Extension Host for testing or an installed version, look in the Keyboard Shortcuts and type collapse. You will see that vscode automatically creates a command like this:
workbench.actions.treeView.*******.collapseAll with your treeView id where the asterisks are.
So you could call that command the usual way with:
vscode.commands.executeCommand('workbench.actions.treeView.IDHere.collapseAll');
By the way, vscode also creates a
workbench.actions.treeView.someTreeViewIDHere.refresh command for all custom TreeViews.
Related
I have a singular view residing in a view container, and I wish to have one title encompassing them. For instance, this view's default position is in the panel, but when moved to the activity bar in another view container, the title is displayed as [view container title]:[view title]. While this makes sense, it would be nice to display my view as [view or view container title], without a colon expecting a second part. The VSCode standard views like Problems, Output, Debug Console exhibit the wanted behavior. They just display as "Output" or "Problems" when placed in another container, rather than something like "Panel:Output". Is it possible to have a single title with no colon/second part? Thanks.
You may try to use the contextualTitle property of the view. Based on its documentation when launched, it should fit your needs:
https://code.visualstudio.com/updates/v1_46#_flexible-layout
For extension authors contributing views or view containers
When views are moved around the workbench, they sometimes need to be presented differently, either with an icon or extra context if they aren't in their default location. When contributing a view, authors may now provide an icon property and a contextualTitle. If not provided, these will default to the icon and title of the view container to which they are contributed.
I'm not sure they updated the API or updated the behavior since then but, if not, you will probably face the same issue I had while trying to use it. I even opened an issue to the VS Code team (https://github.com/microsoft/vscode/issues/102447), but they marked the issue as designed and I gave up on using it.
Hope this helps
In Chrome 80 the devtools now seems to auto horizontal scroll, to the right, to the content in tree views, but not back to the left when navigating back to a parent node. This makes the Elements tab very difficult to use with Word Wrap disabled. I mainly use the Elements tab to highlight elements to view the styles or to see the the parent/child relationship of the nodes. Word wrap makes it hard to view the hierarchy, because a node with many attributes will just take up all the horizontal space when it wraps. Now every time I click a child element I have to manually scroll back to the left to see the start of the parent nodes.
I don't know if this would be considered a bug, because I could see scrolling to the content useful in some places, but it has made the Elements tab difficult to use. Does there happen to be a way to toggle this feature to make horizontal scrolling manual only, because if I need to scroll I will just use the scrollbar myself.
Update:
This is fixed on canary now. The commits that broke and fixed it are referenced from the issue I reported here: https://crbug.com/1050868
When I open one file in two split views in visual studio CODE, I can scroll them separately to a different position. I can edit in one view and see another position in the other view. However, when I hit return to add a new line, the other view suddenly jumps to that position, which is rather annoying.
Not sure, whether this is a bug or a feature. How can it be disabled?
is there a way in ipython notebook to navigate between cells which are far apart? For example if I have a large notebook and I want to move from a cell near the top of the notebook and then back to one at the bottom. Can I do this? I was thinking there might be a "goto cell 23" command or if not something similar to the mark command in vim.
thanks
You can create internal hyperlinks to navigate between cells. Here's how you can do that:
First, define the destination in the cell you want to link with a html anchor tag and give it an Id. For example:
<a id='another_cell'></a>
Note - When you run the above cell in markdown, it will become invisible. You can add some text above the anchor to identify the cell.
Second, create the internal hyperlink to the destination created above using Markdown syntax in another cell and run it:
[Another Cell](#another_cell)
Now, clicking on link should take you to the destination.
There is a table-of-content extension which uses the heading cells to generate a floating toc with hyperlinks. This is quite similar to marks in vim. You can find it here. This extension is also discussed in this question and looks e.g like
I'm new to Delphi. I really wanted to build a Preferences Windows in my company legacy system (which uses 'Delphi 2010' today) just like Eclipse's.
I could already mimic almost all the items:
Divided the whole screen in 3 panels (one at the left, one at the right and one at the bottom),
On TTreeView inside the left panel, and one TScrollBox on the panel of the right to be able to scroll things if they don't fit on the window for any reason (low monitor resolution or too much options). Even used a TSplitter between panel on the right and the panel on the left.
Here's what I could get:
My doubt is: what should I do to be able to load multiple options once an item inside the TreeView is selected? What delphi component should I use to mimic all this info in the right panel?
Make a frame for each page. This is kind of a "sub-form" that you can design visually. Create and destroy them at runtime in the appropriate event-handlers of the tree view.
Use a TPageControl. Add a TTabSheet for each group of controls you plan to have — one for each item in the tree control. Set TabVisible := False for each sheet to keep the tabs from appearing at the top of the page control. Each time an item in the tree control is selected, make the corresponding tab sheet visible by setting the page control's ActivePage property. Put controls on the sheets according to the preferences associated with that sheet's category.