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

✨ Highlight Matching Tags #274

Open
Lachiave opened this issue Nov 10, 2024 · 1 comment
Open

✨ Highlight Matching Tags #274

Lachiave opened this issue Nov 10, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Lachiave
Copy link

Lachiave commented Nov 10, 2024

Description

We want to enhance tag-matching behavior in markup languages such as HTML, XML, and JSX by highlighting matching tags based on cursor position. This feature is inspired by bracket matching in Xcode, where matching brackets are highlighted based on cursor placement.

When the cursor is placed within a tag, the corresponding opening or closing tag should be highlighted. Additionally, if any tag name is modified in either the beginning or end tag, the matching tag should update to reflect the change.

Behavior Examples

In the following examples, | represents the cursor position, and underlined text represents the highlighted matching tags:

  • <|div class="wrapper">Hello world!</div>
  • <div| class="wrapper">Hello world!</div>
  • <div class="wrapper">|Hello world!</div>
  • <div class="wrapper">Hello world!<|/div>
  • <div class="wrapper">Hello world!</div|>
  • <div class="wrapper">Hello world!</div>|

Requirements

  1. Cursor-Based Tag Matching:

    • When the cursor is within a tag name, either at the opening or closing tag, the corresponding tag should be highlighted.
  2. Tag Synchronization:

    • When a tag name is edited, the matching tag should update to reflect the change in real-time, ensuring that both tags are always in sync.
  3. Highlight Behavior:

    • Highlighting should clearly indicate the matching tag, using a distinct visual style (e.g., underline or color change) for both the opening and closing tags to enhance visibility.

This feature will improve the editing experience by making it easier to identify matching tags, reducing errors in nested or complex structures.

Original Issue Description

Is it possible to highlight the opening and closing tags? Example: <div> </div>

@Lachiave Lachiave added the enhancement New feature or request label Nov 10, 2024
@austincondiff austincondiff changed the title ✨ tags opening and closing ✨ Highlight Matching Tags Nov 11, 2024
@austincondiff
Copy link
Collaborator

Edited the issue description with necessary details to complete this feature, previously discussed in Discord here.

Transferring to CodeEditSourceEditor.

@austincondiff austincondiff transferred this issue from CodeEditApp/CodeEdit Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants