✨ Highlight Matching Tags

未关闭
#274 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
28/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
swift
领域
devtools

调研方向

该 issue 未列出任何文件、测试或入口点。首先定位编辑器中负责标签解析、光标匹配、高亮显示和编辑同步的组件;当对于所描述的光标位置,相匹配的开始标签和结束标签都被高亮显示,并且在编辑名称时仍保持同步,即视为完成。

由索引模型根据 Issue 内容生成。

描述

enhancement
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>

主要语言
Swift
星标
720
派生
162
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CodeEditApp/CodeEditSourceEditor 的其他 Issue

查看 CodeEditApp/CodeEditSourceEditor 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。