todo-tree icon indicating copy to clipboard operation
todo-tree copied to clipboard

Extension breaks other extensions due to using Regexp shim

Open j-fulbright opened this issue 1 year ago • 5 comments

After reviewing an error for a different extension, it was determined that the extension was broken due to TODO Tree.

From the other extension author:

gruntfuggly is using a package called [regexp-match-indices](https://www.npmjs.com/package/regexp-match-indices) which replaces the javascript RegExp object globally and causes unexpected behaviour in RegExp.exec().

Versionlens uses a RegExp with the flags /gd which are valid [RegExp flags](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions#regex_flags)
but the shim gruntfuggly uses doesn't support them....

its very bad that this extension replaces the RegExp object globally. 
This will potentially cause many problems in vscode.

This particular usage here: https://github.com/Gruntfuggly/todo-tree/blob/a6f60e0ce830c4649ac34fc05e5a1799ec91d151/src/highlights.js#L2

j-fulbright avatar Jun 19 '24 14:06 j-fulbright