vscode-inline-bookmarks
vscode-inline-bookmarks copied to clipboard
Resolve bug in which filtering the inline bookmarks pane always fails
This code resolves the problem in which filtering the inline bookmarks pane always fails.
The cause was the filtering logic. When RegExp filters were present, they were being tested against branch nodes (i.e., the filenames), not just against the leaf nodes (i.e., the actual bookmark notes).
The current code resolves this by doing two things:
-
Only perform the RegExp check against leaf nodes, passing the branch nodes through
-
To eliminate branch nodes with no matching children, call the underlying data model instance for every passed node to see if any of its children match and in that case, do filter it out.
Regarding performance and correctness, in my tests, not provided here, I checked multiple bookmark types across multiple files and it worked without any glitches and very quickly for a moderate-sized workspace. With apologies, I do not have time to provide test cases for either accuracy or performance. However, the issue is resolved with this commit and the extension is now usable again.