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

Exception raised when trying to run change pair in a markdown file #2470

Closed
jaresty opened this issue Jul 6, 2024 · 2 comments
Closed

Exception raised when trying to run change pair in a markdown file #2470

jaresty opened this issue Jul 6, 2024 · 2 comments
Labels
wontfix This will not be worked on

Comments

@jaresty
Copy link
Contributor

jaresty commented Jul 6, 2024

I got an exception when I tried to run change pair in a markdown file today. My cursor was in the middle of some backticks. I saw this in the logs:

 SyntaxError: Invalid flags: ds
	at k (/Users/tkma6d4/.vscode/extensions/gruntfuggly.todo-tree-0.0.226/dist/extension.js:114:74341)
	at Array.d (/Users/tkma6d4/.vscode/extensions/gruntfuggly.todo-tree-0.0.226/dist/extension.js:114:3580)
	at Object.parse (/Users/tkma6d4/.vscode/extensions/gruntfuggly.todo-tree-0.0.226/dist/extension.js:114:71938)
	at r.parse (/Users/tkma6d4/.vscode/extensions/gruntfuggly.todo-tree-0.0.226/dist/extension.js:1:12754)
	at Object.parse (/Users/tkma6d4/.vscode/extensions/gruntfuggly.todo-tree-0.0.226/dist/extension.js:114:415)
	at l (/Users/tkma6d4/.vscode/extensions/gruntfuggly.todo-tree-0.0.226/dist/extension.js:52:165)
	at Array.get [as indices] (/Users/tkma6d4/.vscode/extensions/gruntfuggly.todo-tree-0.0.226/dist/extension.js:52:2895)
	at iD.run (/Users/tkma6d4/.vscode/extensions/pokey.cursorless-0.28.1158/extension.cjs:133:100520)
	at predicate (/Users/tkma6d4/.vscode/extensions/pokey.cursorless-0.28.1158/extension.cjs:133:98074)
	at /Users/tkma6d4/.vscode/extensions/pokey.cursorless-0.28.1158/extension.cjs:133:104145
	at Array.every (<anonymous>)
	at /Users/tkma6d4/.vscode/extensions/pokey.cursorless-0.28.1158/extension.cjs:133:104136
	at Array.filter (<anonymous>)
	at t.matches (/Users/tkma6d4/.vscode/extensions/pokey.cursorless-0.28.1158/extension.cjs:133:104089)
	at wy.generateScopeCandidates (/Users/tkma6d4/.vscode/extensions/pokey.cursorless-0.28.1158/extension.cjs:133:34153)
	at generateScopeCandidates.next (<anonymous>)
	at wy.generateScopes (/Users/tkma6d4/.vscode/extensions/pokey.cursorless-0.28.1158/extension.cjs:133:28877)
	at generateScopes.next (<anonymous>)
	at pP (/Users/tkma6d4/.vscode/extensions/pokey.cursorless-0.28.1158/extension.cjs:120:6146)
	at u9 (/Users/tkma6d4/.vscode/extensions/pokey.cursorless-0.28.1158/extension.cjs:148:26958)
	at M2.getScopeSupport (/Users/tkma6d4/.vscode/extensions/pokey.cursorless-0.28.1158/extension.cjs:148:26705)
	at r (/Users/tkma6d4/.vscode/extensions/pokey.cursorless-0.28.1158/extension.cjs:148:28102)
	at /Users/tkma6d4/.vscode/extensions/pokey.cursorless-0.28.1158/extension.cjs:148:28269
	at Array.map (<anonymous>)
@jaresty
Copy link
Contributor Author

jaresty commented Jul 6, 2024

Seems to be happening because of a bad interaction between cursorless and the extension 'gruntfuggly.todo-tree'. When I uninstalled the extension the exception went away. I haven't opened an issue with them yet.

@AndreasArvidsson
Copy link
Member

AndreasArvidsson commented Jul 12, 2024

This appears to be because we are using the regex flag d that was introduced in ECMAScript 2022.

const match = text.match(new RegExp(pattern, "ds"));

I don't know why gruntfuggly.todo-tree is affected by this, but this line at Array.get [as indices] (/Users/tkma6d4/.vscode/extensions/gruntfuggly.todo-tree-0.0.226/dist/extension.js:52:2895) might indicate that they are actually modifying something on the regex prototype.

Edit: I should have looked for issues first :D
gruntfuggly.todo-tree is globally replacing the regex implementation. I would definitely not recommend this extension.
Gruntfuggly/todo-tree#853

Also there's nothing we from the Cursorless side can do about this. I would just recommend closing this issue and following the development on the gruntfuggly.todo-tree repository.

@AndreasArvidsson AndreasArvidsson added the wontfix This will not be worked on label Jul 12, 2024
@pokey pokey reopened this Jul 19, 2024
@pokey pokey closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants