Typing `/` after a `<` when we know the tag isn't closed should close the open tag.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 234
- Forks
- 92
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the discussion in pull request 501 and the existing HTML Language Server handling for html/autoInsert when typing / after <. Trace the parser validation used for the > case, including LiquidHTMLASTParsing errors. Done means safely completing an unclosed tag without adding duplicate closing tags.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, typescript
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100