Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to get WebStorm to autocomplete tag attribute values?

Tags:

webstorm

I'm trying to get WebStorm to autocomplete some HTML attribute values while working with Angular Material.

Editor > Inspections > HTML > Unknown HTML tag attribute

I added some attributes here like flex, flex-md and layout, but how can I get autocomplete for a situation like below?

<div layout="can be row or column"></div>

A layout's value is either a row or column, so I want row and column to appear when I type layout="row/column here", is it possible?

I'm using WebStorm 12 EAP.

like image 443
salep Avatar asked Mar 17 '16 06:03

salep


People also ask

How do I get auto suggestions on IntelliJ?

Start typing. By default, IntelliJ IDEA displays the code completion popup automatically as you type. If automatic completion is disabled, press Ctrl+Shift+Space or choose Code | Code Completion | Type-Matching from the main menu. If necessary, press Ctrl+Shift+Space once again.

How does code completion work?

Intelligent code completion uses an automatically generated in-memory database of classes, variable names, and other constructs that given computer code defines or references.

Why is IntelliJ autocomplete not working?

I have tried the following according to this thread (Intellij IDEA CE 12 Android XML Code Completion not working): Go to File->Power Save Mode and disable it - it is off. Go to Preferences->Editor->Code Completion and check Autopopup code completion - this has been checked. Go to File->Invalidate Caches and restart.

What is code completion in typescript?

Code completion is one of the essential features of the WebStorm editor. To show you completion suggestions, WebStorm goes through the project files with the source code and adds classes, methods, functions, and variables defined in them to a special internal index.


2 Answers

I've done some research too, but found nothing answering this question. Looks like you just can add custom tag, which will be automatically completed, e.g. tolayout="", but not their value.
You can't change the behaviour of autocompletion at the moment, see this old ticket

like image 116
Nizarii Avatar answered Oct 14 '22 07:10

Nizarii


Well, you can try to import. In the TypeScript context, WebStorm can generate import statements for modules, classes, and any other symbol that can be exported and called as a type.

Here's link from official documentation.

like image 2
Josip Ivic Avatar answered Oct 14 '22 07:10

Josip Ivic