vincaslt / vscode-highlight-matching-tag

Highlights matching opening or closing tag in VSCode
https://marketplace.visualstudio.com/items?itemName=vincaslt.highlight-matching-tag
MIT License
159 stars 16 forks source link

HTML Tag highlight issue if comments are present. #133

Open dev-rish opened 3 years ago

dev-rish commented 3 years ago

Below is a code snippet. Seems like if there are comments in the code, the highlight feature breaks due to the comment.

const Component1 = (props) => {
  return (
    <circle
      // onMouseEnter={(e) => {
      onClick={(e) => {
        console.log("sadfa");
      }}
    ></circle>
  );
};

Upon removing the commented code the highlighting feature starts to work normally. Also there are cases in which behaviour is unexpected and variable names get highlighted. Below are few more code snippets. Clicking on tags, variable names , etc might reveal more unexpected highlighting. Highlighting in even Component2 stops working along with Component1

const Component1 = (props) => {
  return (
    <circle
      // onMouseEnter={(e) => {
      onClick={(e) => {
        console.log("sadfa");
      }}
    ></circle>
  );
};

const Component2 = () => {
  return <div></div>;
};
const Component1 = (props) => {
  return (
    <div>
      <circle
        // onMouseEnter={(e) => {
        onClick={(e) => {
          console.log("sadfa");
        }}
      ></circle>
    </div>
  );
};

const Component2 = () => {
  return <rect></rect>;
};

Version Info vincaslt.highlight-matching-tag : v0.10.1 VS Code : 1.58.1 (stable)