Typing `/` after a `<` when we know the tag isn't closed should close the open tag.

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

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
html, typescript

调研方向

首先查看 pull request 501 中的讨论,以及在 \u003c 后输入 / 时现有的 HTML Language Server 对 html/autoInsert 的处理。跟踪 \u003e 情况所使用的 parser 验证,包括 LiquidHTMLASTParsing 错误。完成标准是安全地补全未闭合的标签,而不添加重复的闭合标签。

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

描述

Is your feature request related to a problem? Please describe.
This is a followup of https://github.com/Shopify/theme-tools/pull/501#discussion_r1777602887

It seems like the HTML Language Server also does html/autoInsert when typing / after a <.

Describe the solution you'd like

  • If the user types / after a < and we know that it's safe to close a tag that currently is opened without child, then we should complete it.
  • We shouldn't close tags that are already opened, don't want duplicate close tags (no <div></div></div> pls)

We might be smart and do a "smart edit of the file", pass it through the parser and verify for a LiquidHTMLASTParsing error like we do for the > case.

主要语言
TypeScript
星标
245
派生
108
平均合并
2 天 8 小时
30 天内合并 PR
24

环境准备

从这里开始

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

Shopify/theme-tools 的其他 Issue

查看 Shopify/theme-tools 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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