Changing how autocomplete works

Is it possible to change how autocomplete fills in the blanks? Right now I'm editing HTML and I want to be able to use single quotes for my attributes, but PS keeps putting in double quotes. Searching the settings for "complet" doesn't seem to get me where I want to go.

7 comments
Comment actions Permalink

It depends.

If that completion entry is provided by Live Templates mechanism then you can go into Settings/Preferences and alter that particular Live Template as you wish.

If it's something else (e.g. Emmet or normal completion etc) then no -- there is no option for that unfortunately. https://youtrack.jetbrains.com/issue/WEB-459 -- watch this ticket (star/vote/comment) to get notified on progress.

1
Comment actions Permalink

Oh yeah, the Live Templates. Well, under "html/xml" there's "CD", "t", "T", and "T2", so I'm guessing no. I don't suppose it would do any good to create another Live Template, since this is also a feature that's hardcoded, isn't it?

Voted. Unfortunately, folk have been waiting a few years already for progress.

0
Comment actions Permalink

No need to be *that* sarcastic about Live Templates -- it's more than what you have listed here -- there is still whole "Zen HTML" group (used in conjunction with Emmet) with lots of entries :) ...

BTW -- if it would be "hardcoded" then you would not be able to change it all ... but you actual can.

0
Comment actions Permalink

Zen, eh? I'm not sure what that is. We have some kind of web api called "Zen" we are using here, but we are migrating away from it. I don't know if that's the same thing. Are you saying that my HTML files are being treated like Zen HTML? And I can get the behaviour I want by editing those? There sure are a lot of tags to change, though.

0
Comment actions Permalink

Yes -- Zen, now known as Emmet. PhpStorm's implementation of it uses those Live Templates for some aspects (abbreviations).

It's just a suggestion since I do not know what completion in particular you are taking about (you have not provided any examples/screenshots with your completion popup). Most likely though it will be that ticket and not Live Templates.

0
Comment actions Permalink

Pretty well any HTML tag attribute I've come across, PhpStorm will automatically generate double quotes to surround the value. If you need to examples of what I've used, there's been <div />, <form />, <input /> to name a few and the attributes have been "id", "class", "name" and so on. If there's a way to make that single quotes, I'm all ears. Even if the automatic generation of any quotes for HTML attributes could be suppressed, that would be an improvement.

0
Comment actions Permalink

>Even if the automatic generation of any quotes for HTML attributes could be suppressed, that would be an improvement.

Settings/Preferences | Editor | General | Smart Keys --> Add quotes for attribute on typing '=' and attribute completion

1

Please sign in to leave a comment.