Skip to content

BUG: Tags syntax highlighting in React components doesnt work for components that have children #62015

Closed as not planned
@psnet

Description

@psnet

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.101.2
  • OS Version: Windows_NT x64 10

Steps to Reproduce

  1. Lets have test code:
import React from 'react';
import {View} from 'react-native';
import {ComponentWithoutChildren} from './ComponentWithoutChildren';

export const Test = () => {
    return (
        <>
            <View>
                <ComponentWithoutChildren />
            </View>

            <View>
                <ComponentWithoutChildren />
            </View>

            {/* its only for testing bug purposes, RN doesnt support div tags for mobile */}
            <div>
                hello
            </div>

            <div>
                hello
            </div>
        </>
    );
};
  1. If we put cursor at component ComponentWithoutChildren which doesnt have children so it is "self closed tag" and vs code will highlight all its occurrences:

Image

  1. If we put cursor at component View which has children so it is NOT "self closing tag" and vs code will highlight only current pair but forgot to highlight all other its occurrences:

Image

the same is for div tags that present in test example code.

Problem

So different tags are highlighted differently and this causes confusion and even wrong quick understanding of code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Not a DefectThis behavior is one of several equally-correct options

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions