facelessuser / BracketHighlighter

Bracket and tag highlighter for Sublime Text
https://facelessuser.github.io/BracketHighlighter/
1.75k stars 245 forks source link

"Matching bracket could not be found" with Arrow Functions #618

Closed michaelalandawson closed 1 year ago

michaelalandawson commented 1 year ago

Description

BH displays the "Matching bracket could not be found" popup when an arrow function exists between the brackets.

The following code blocks are functionally equivalent to each other. The only difference is how the function is defined.

<cfscript>

if (thisTag.executionMode == "start") {
    tagStack = getBaseTagList().lCase().listToArray().filter(tag => tag.find("cf_"));
}

if (thisTag.executionMode == "start") {
    tagStack = getBaseTagList().lCase().listToArray().filter((tag, index) => tag.find("cf_"));
}

if (thisTag.executionMode == "start") {
    tagStack = getBaseTagList().lCase().listToArray().filter((tag, index) => {tag.find("cf_")});
}

if (thisTag.executionMode == "start") {
    tagStack = getBaseTagList().lCase().listToArray().filter(function(tag) {tag.find("cf_")});
}

</cfscript>

This image shows how the first three (arrow function) blocks are not understood. The fourth block is correctly understood.

image

Support Info

Steps to Reproduce Issue

The code block, above, can be used to reproduce this issue.

Thanks for your help!

facelessuser commented 1 year ago

Can you tell me what syntax highlighter you are using for this code snippet? And where I can find the package?

michaelalandawson commented 1 year ago

The syntax is CFML.

I'm using a forked version of this package:

https://github.com/jcberquist/sublimetext-cfml

My version is pretty much the same except for a few upper/lower-case changes.

Thanks!

facelessuser commented 1 year ago

Something in the syntax changed from when we originally added support. "storage.type.function.arrow.cfml" needs to be added to scope_exclude for the HTML angle rule.

michaelalandawson commented 1 year ago

Thank you so much. That resolved the issue. I appreciate it!