After my previous post, I've made some progress with a duplicate TreeView schema in my VS Code extension. You can find the code in this repository:
https://github.com/trebleCode/dxdevcheck.git
I have managed to display static JSON file contents in custom viewsContainers setting and now my goal is to dynamically update icons based on the content. However, I'm facing an issue with the refresh()
method not updating the icons as expected.
If you clone the repo, run npm i
, and press F5, you should be able to see a lightning bolt icon that leads to a menu labeled VALIDATE. This menu contains expandable items with children, and clicking on the circular icon will trigger a modal message at the bottom right.
The problem lies within the implementation of icon updating in my extension, specifically in the refresh()
method of the ValidateMenuProvider class located in validateMenu.ts file. Any guidance on resolving this issue would be greatly appreciated.
Below is a snippet of my main class:
import * as vscode from "vscode";
...
export class ValidateMenuProvider implements vscode.TreeDataProvider<ValidateMenu> {
...
}
export class ValidateMenu extends vscode.TreeItem {
...
}
Here's a glimpse of the static JSON file structure:
{
"name": "root",
"children": {
"child1": [
{"id": "id1", "name": "child1name1"},
{"id": "id2", "name": "child2name2"}
],
...
}
}
In addition, there are some utility functions defined in customUtils.ts file which are used for checking configuration status:
export function checkIsConfigured(name: string): boolean {
...
}
Lastly, let's take a look at the package.json file for this extension:
{
"name": "myview",
...
}