Skip to content

Commit 2a09939

Browse files
committedJun 28, 2016
There was a little mistake in the logic to determine whether a file extension was set in additionalExtensions or not. Fixed that. Also updated readme. to reflect that change. And updated package.json to show the correct publisher, version and categories.
1 parent e6219d5 commit 2a09939

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed
 

‎README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@ This extension contributes the following settings:
3535

3636
## Release Notes
3737

38+
### 0.0.5
39+
40+
Added working support for multiple file extensions besides .php. See `phpformatter.additionalExtensions` setting for more info.
41+
3842
### 0.0.4
3943

40-
* All paths now support spaces (`' '`).
41-
* Added working support for multiple file extensions besides .php. See `phpformatter.additionalExtensions` setting for more info.
44+
All paths now support spaces (`' '`).
4245

4346
### 0.0.3
4447

‎extension.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,16 @@ function fix(document) {
2727
_settings.additionalExtensions = config.get('additionalExtensions', []);
2828
_settings.enableFixerLogging = config.get('enableFixerLogging', false);
2929

30-
if(_settings.onSave == false || document.languageId != 'php') {
30+
if(_settings.onSave == false) {
3131
return;
3232
}
33-
if(Array.isArray(_settings.additionalExtensions) && _settings.additionalExtensions.indexOf(document.languageId) != -1) {
34-
return;
33+
if(document.languageId != 'php') {
34+
if(Array.isArray(_settings.additionalExtensions) && _settings.additionalExtensions.indexOf(document.languageId) != -1) {
35+
// This was set as additional extension.
36+
} else {
37+
// This is neither a .php files, nor anything that was set in additionalExtensions.
38+
return;
39+
}
3540
}
3641

3742
var args = ['fix'];

‎package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
"name": "php-formatter",
33
"displayName": "PHP Formatter",
44
"description": "A wrapper for the Sensiolabs PHP CS Fixer. Analyzes some PHP source code and tries to fix coding standards issues (PSR-1 and PSR-2 compatible).",
5-
"version": "0.0.1",
6-
"publisher": "Dick Visser",
5+
"version": "0.0.5",
6+
"publisher": "Sophisticode",
77
"engines": {
88
"vscode": "^1.0.0"
99
},
1010
"categories": [
11+
"Linters",
1112
"Other"
1213
],
1314
"activationEvents": [

0 commit comments

Comments
 (0)