Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collisions with other extensions #95

Closed
uberkael opened this issue Sep 5, 2024 · 3 comments
Closed

Collisions with other extensions #95

uberkael opened this issue Sep 5, 2024 · 3 comments

Comments

@uberkael
Copy link

uberkael commented Sep 5, 2024

Hello, thank for this great extension.

It seems like there is some collision with another extension (TODO Tree) that uses regex for coloring text in the document:
image

[error] SyntaxError: Invalid flags: dg
    at k (/home/user/.vscode/extensions/gruntfuggly.todo-tree-0.0.226/dist/extension.js:114:74341)
    at Array.d (/home/user/.vscode/extensions/gruntfuggly.todo-tree-0.0.226/dist/extension.js:114:3580)
    at Object.parse (/home/user/.vscode/extensions/gruntfuggly.todo-tree-0.0.226/dist/extension.js:114:71938)
    at Object.r.parse (/home/user/.vscode/extensions/gruntfuggly.todo-tree-0.0.226/dist/extension.js:1:12754)
    at Object.parse (/home/user/.vscode/extensions/gruntfuggly.todo-tree-0.0.226/dist/extension.js:114:415)
    at l (/home/user/.vscode/extensions/gruntfuggly.todo-tree-0.0.226/dist/extension.js:52:165)
    at Array.get [as indices] (/home/user/.vscode/extensions/gruntfuggly.todo-tree-0.0.226/dist/extension.js:52:2895)
    at RegexTest.processMatch (/home/user/.vscode/extensions/pedrohenrique-ql.regex-match-0.4.2/src/RegexTest.ts:87:15)
    at RegexTest.test (/home/user/.vscode/extensions/pedrohenrique-ql.regex-match-0.4.2/src/RegexTest.ts:42:37)
    at /home/user/.vscode/extensions/pedrohenrique-ql.regex-match-0.4.2/src/decorations/TextDecorationApplier.ts:19:72
    at Array.flatMap (<anonymous>)
    at Function.updateDecorations (/home/user/.vscode/extensions/pedrohenrique-ql.regex-match-0.4.2/src/decorations/TextDecorationApplier.ts:19:39)
    at RegexMatchService.updateRegexTest (/home/user/.vscode/extensions/pedrohenrique-ql.regex-match-0.4.2/src/RegexMatchService.ts:85:27)
    at RegexMatchService.openRegexTestWindow (/home/user/.vscode/extensions/pedrohenrique-ql.regex-match-0.4.2/src/RegexMatchService.ts:80:10)
    at d.h (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:154:206473) regex-match.openRegexMatchWindow {"value":"pedrohenrique-ql.regex-match","_lower":"pedrohenrique-ql.regex-match"}

Even if is not the extension fault, maybe this error can highlight unwanted interactions or leaking in the code.

Thanks!

@uberkael uberkael changed the title Collision with another extensions Collisions with other extensions Sep 5, 2024
@uberkael
Copy link
Author

uberkael commented Sep 5, 2024

Probably related:

Gruntfuggly/todo-tree#853
Gruntfuggly/todo-tree#858

cursorless-dev/cursorless#2470 (comment)

Seems like TODO Tree overwrite the prototype of regex.

@pedrohenrique-ql
Copy link
Owner

Hi, @uberkael! Thanks for the report and the acknowledgements, I still plan to make many improvements!

Regarding the issue, from what I saw in the issue Gruntfuggly/todo-tree#853, the TODO Tree extension replaces the RegExp object globally and does not accept the /d flag, which is valid (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions#regex_flags). This flag is essential for Regex Match to get the indexes of the matches.

I will comment on the issue as other developers have done, as I believe it is not a good practice to replace something like this.

Thanks!

@uberkael
Copy link
Author

Yes, it seems that TODO Tree is to blame.

Thank for the extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants