oleg-shilo / codemap.vscode

Code map (syntax tree) of the active document
MIT License
85 stars 28 forks source link

bug fix: opening new unopened script initially filters all nodes #81

Closed Timhobson-source closed 1 year ago

Timhobson-source commented 1 year ago

Settings functionality accidently added in a bug that sometimes occurs when first opening a new file in the vscode session and using the mapper. The refresh of the code-map tree sometimes occurs before the settings-tree.

The code-map tree provider calls a method of the settings tree provider to get the "valid node types" of the code-map tree. In this case the settings tree didn't know what nodes of the code-map are valid as it wasn't refreshed. So it returns no nodes to the code-map tree provider, and all nodes are filtered out leaving a blank map. The settings tree then is refreshed so we have a valid settings window but no map. See below:

image

If you refresh the tree by saving or altering the window the issue resolves itself.

As a fix I've forced the settings tree provider to manually refresh the settings information when it's called by the code-map tree provider.

oleg-shilo commented 1 year ago

All done. Release v1.20.0 Thank you for addressing it so quickly