简体   繁体   中英

How can I setup webstorm to automatically add semi-colons to javascript functions, methods, etc

When I write Javascript, I use semi-colons. However when I write in webstorm/phpstorm, it auto completes braces and brackets, but doesn't auto-add a semicolon. I know that isn't required per the standards, etc., but that's the way that I code - and I'm not alone, many people code this way.

Example:

var data = $.ajax({});

Normally, webstorm/phpstorm will do this, and leave the cursor inside the curly braces:

var data = $.ajax({})

All in the world that I want is to not have to add the semicolon manually and have it just auto-complete as I noted in my first example.

When I write Javascript, I use semi-colons. However when I write in webstorm/phpstorm, it auto completes braces and brackets, but doesn't auto-add a semicolon. I know that isn't required per the standards, etc., but that's the way that I code - and I'm not alone, many people code this way.

Example:

var data = $.ajax({});

Normally, webstorm/phpstorm will do this, and leave the cursor inside the curly braces:

var data = $.ajax({})

All in the world that I want is to not have to add the semicolon manually and have it just auto-complete as I noted in my first example.

When I write Javascript, I use semi-colons. However when I write in webstorm/phpstorm, it auto completes braces and brackets, but doesn't auto-add a semicolon. I know that isn't required per the standards, etc., but that's the way that I code - and I'm not alone, many people code this way.

Example:

var data = $.ajax({});

Normally, webstorm/phpstorm will do this, and leave the cursor inside the curly braces:

var data = $.ajax({})

All in the world that I want is to not have to add the semicolon manually and have it just auto-complete as I noted in my first example.

When I write Javascript, I use semi-colons. However when I write in webstorm/phpstorm, it auto completes braces and brackets, but doesn't auto-add a semicolon. I know that isn't required per the standards, etc., but that's the way that I code - and I'm not alone, many people code this way.

Example:

var data = $.ajax({});

Normally, webstorm/phpstorm will do this, and leave the cursor inside the curly braces:

var data = $.ajax({})

All in the world that I want is to not have to add the semicolon manually and have it just auto-complete as I noted in my first example.

When I write Javascript, I use semi-colons. However when I write in webstorm/phpstorm, it auto completes braces and brackets, but doesn't auto-add a semicolon. I know that isn't required per the standards, etc., but that's the way that I code - and I'm not alone, many people code this way.

Example:

var data = $.ajax({});

Normally, webstorm/phpstorm will do this, and leave the cursor inside the curly braces:

var data = $.ajax({})

All in the world that I want is to not have to add the semicolon manually and have it just auto-complete as I noted in my first example.

When I write Javascript, I use semi-colons. However when I write in webstorm/phpstorm, it auto completes braces and brackets, but doesn't auto-add a semicolon. I know that isn't required per the standards, etc., but that's the way that I code - and I'm not alone, many people code this way.

Example:

var data = $.ajax({});

Normally, webstorm/phpstorm will do this, and leave the cursor inside the curly braces:

var data = $.ajax({})

All in the world that I want is to not have to add the semicolon manually and have it just auto-complete as I noted in my first example.

When I write Javascript, I use semi-colons. However when I write in webstorm/phpstorm, it auto completes braces and brackets, but doesn't auto-add a semicolon. I know that isn't required per the standards, etc., but that's the way that I code - and I'm not alone, many people code this way.

Example:

var data = $.ajax({});

Normally, webstorm/phpstorm will do this, and leave the cursor inside the curly braces:

var data = $.ajax({})

All in the world that I want is to not have to add the semicolon manually and have it just auto-complete as I noted in my first example.

When I write Javascript, I use semi-colons. However when I write in webstorm/phpstorm, it auto completes braces and brackets, but doesn't auto-add a semicolon. I know that isn't required per the standards, etc., but that's the way that I code - and I'm not alone, many people code this way.

Example:

var data = $.ajax({});

Normally, webstorm/phpstorm will do this, and leave the cursor inside the curly braces:

var data = $.ajax({})

All in the world that I want is to not have to add the semicolon manually and have it just auto-complete as I noted in my first example.

When I write Javascript, I use semi-colons. However when I write in webstorm/phpstorm, it auto completes braces and brackets, but doesn't auto-add a semicolon. I know that isn't required per the standards, etc., but that's the way that I code - and I'm not alone, many people code this way.

Example:

var data = $.ajax({});

Normally, webstorm/phpstorm will do this, and leave the cursor inside the curly braces:

var data = $.ajax({})

All in the world that I want is to not have to add the semicolon manually and have it just auto-complete as I noted in my first example.

When I write Javascript, I use semi-colons. However when I write in webstorm/phpstorm, it auto completes braces and brackets, but doesn't auto-add a semicolon. I know that isn't required per the standards, etc., but that's the way that I code - and I'm not alone, many people code this way.

Example:

var data = $.ajax({});

Normally, webstorm/phpstorm will do this, and leave the cursor inside the curly braces:

var data = $.ajax({})

All in the world that I want is to not have to add the semicolon manually and have it just auto-complete as I noted in my first example.

When I write Javascript, I use semi-colons. However when I write in webstorm/phpstorm, it auto completes braces and brackets, but doesn't auto-add a semicolon. I know that isn't required per the standards, etc., but that's the way that I code - and I'm not alone, many people code this way.

Example:

var data = $.ajax({});

Normally, webstorm/phpstorm will do this, and leave the cursor inside the curly braces:

var data = $.ajax({})

All in the world that I want is to not have to add the semicolon manually and have it just auto-complete as I noted in my first example.

When I write Javascript, I use semi-colons. However when I write in webstorm/phpstorm, it auto completes braces and brackets, but doesn't auto-add a semicolon. I know that isn't required per the standards, etc., but that's the way that I code - and I'm not alone, many people code this way.

Example:

var data = $.ajax({});

Normally, webstorm/phpstorm will do this, and leave the cursor inside the curly braces:

var data = $.ajax({})

All in the world that I want is to not have to add the semicolon manually and have it just auto-complete as I noted in my first example.

When I write Javascript, I use semi-colons. However when I write in webstorm/phpstorm, it auto completes braces and brackets, but doesn't auto-add a semicolon. I know that isn't required per the standards, etc., but that's the way that I code - and I'm not alone, many people code this way.

Example:

var data = $.ajax({});

Normally, webstorm/phpstorm will do this, and leave the cursor inside the curly braces:

var data = $.ajax({})

All in the world that I want is to not have to add the semicolon manually and have it just auto-complete as I noted in my first example.

For Webstorm 2019.1

1 Select File/Settings... menu.
2 Select Editor/Code Style/JavaScript in the left sidebar of the Settings dialog.

在此处输入图片说明

3 Select the Punctuation tab and make sure that the "semicolon to terminate statements" option is "always".

在此处输入图片说明

4 Select Code/Reformat from the menu.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM