Specific kind of autocomplete
WebbieFrank opened this issue · 1 comments
Hi,
I am looking for a plugin with a specific type of autocomplete and I seem to have looked in the wrong place.
I was looking for some thing that completes things like eg. when you type "<script">, it fills in "</script>" for you, or it completes the brackets for PHP or CSS statements, or "<!Doctype" a the beginning.
Is it a case of autocomplete being able to do this but me doing it wrong or is there a different plugin that can achieve the things I want?
Thank you in advance.
I see 3 kinds of features in the mentioned list.
1. Closing tag creation. For example, you've got <div>
, you want to automate creation of </div>
.
Can be done via close-tags. It's very handy, I use it, CMD,OPTION + .
sequence — it's awesome because it closes HTML tags everywhere, even in JS files (I've just checked, it does).
Personally, I prefer when tags are created upon clicking the certain command, not fully automatically, like in VSCode.
Also, there are plugins in VSCode that automatically rename closing tag when you rename opening tag. I guess more relevant to JSX where component tags are long and custom. In pure HTML, one rarely renames let's say div
into section
...
2. Bracket completion. For example, a) you type opening bracket <
and program puts >
right after. b) You type JSX <SpecialTextComponent
and when you add >
, it adds a closing counterpart, </SpecialTextComponent>
.
a) Personally I don't like, only single/double quotes and backticks work this way. There are many false positive cases possible. b) Somewhat mitigated by close-tags
— VSCode is more aggressively doing this, it's helping but sometimes it does it wrongly and breaks the whole JSX file, closing tags at topmost scope.
3. Adding <!doctype>
if it's missing. For example, you edit HTML file, doctype is missing, squiggly lines are put at the top and upon a first file save, it's added. Keyboard cursor position irrelevant.
To me it looks like it's a feature for an HTML linter.
I suspect this package is for tag/attribute suggestions mainly, things to appear as you type, like in Dreamweaver back in the day. I might be wrong.