When declaring a variable or field in Java, it is common practice to specify the type.
For example:
public SomeDataType someDataType = new SomeDataType(123)
As you begin typing Som..
, IntelliJ's autocomplete feature will likely suggest SomeDataType
for you to select by pressing tab.
Once you've specified that the type is SomeDataType, when you start typing the name som..
, it will suggest someDataType
as the variable name.
In Java, there is a clear sequence. The actual typing process looks like this:
pu[tab]Som[tab]som[tab]
On the other hand, in TypeScript, the order is reversed:
public someDataType: SomeDataType;
Is there a similar feature for TypeScript in IntelliJ? As far as I know, you currently have to write the following to achieve the same behavior:
pu[tab]:Som[tab][ctrl + <-][ctrl + <-]som[tab][ctrl + ->][ctrl + ->]
This method can be awkward and disruptive to your flow, especially if your linter requires a lot of spaces.
So what's the real trick here?