Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
higoka committed Jun 21, 2019
1 parent a29f826 commit 41b5fb1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.0.7] - 2019-06-21
### Changed
- Description for some configurations
- Code cleanup

## [0.0.6] - 2019-06-19
### Added
- Extension Icon
Expand All @@ -32,7 +37,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.0.1] - 2019-06-19
- Initial release

[Unreleased]: https://github.com/higoka/php-cs-fixer/compare/v0.0.6...HEAD
[Unreleased]: https://github.com/higoka/php-cs-fixer/compare/v0.0.7...HEAD
[0.0.7]: https://github.com/higoka/php-cs-fixer/releases/tag/v0.0.7
[0.0.6]: https://github.com/higoka/php-cs-fixer/releases/tag/v0.0.6
[0.0.5]: https://github.com/higoka/php-cs-fixer/releases/tag/v0.0.5
[0.0.4]: https://github.com/higoka/php-cs-fixer/releases/tag/v0.0.4
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ For more information please visit: https://cs.symfony.com/

## Configuration

* `php-cs-fixer.executable`: Path to the php-cs-fixer executable.
* `php-cs-fixer.configFile`: Path to the php-cs-fixer config.
* `php-cs-fixer.pathMode`: Appends the "--path-mode" parameter.
* `php-cs-fixer.executable`: Path to php-cs-fixer executable.
* `php-cs-fixer.configFile`: Path to php-cs-fixer config.
* `php-cs-fixer.pathMode`: Set "--path-mode" parameter.
* `php-cs-fixer.onSave`: Execute command on save.

## Error Handling
Expand Down
6 changes: 3 additions & 3 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function activate(context) {

const config = vscode.workspace.getConfiguration('php-cs-fixer')

context.subscriptions.push(vscode.commands.registerCommand('php-cs-fixer.fix', function () {
context.subscriptions.push(vscode.commands.registerCommand('php-cs-fixer.fix', () => {
const param = []

if (config.executable) {
Expand All @@ -27,7 +27,7 @@ function activate(context) {

// console.log(param.join(' '))

exec(param.join(' '), function (err, stdout, stderr) {
exec(param.join(' '), (err, stdout, stderr) => {
if (err) {
vscode.window.showErrorMessage('PHP-CS-Fixer: An error occurred.')
throw err
Expand All @@ -37,7 +37,7 @@ function activate(context) {
})
}))

context.subscriptions.push(vscode.workspace.onWillSaveTextDocument(function (e) {
context.subscriptions.push(vscode.workspace.onWillSaveTextDocument((e) => {
if (e.document.languageId === 'php' && config.onSave) {
e.waitUntil(vscode.commands.executeCommand('php-cs-fixer.fix'))
}
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "php-cs-fixer",
"displayName": "PHP-CS-Fixer",
"description": "Integrates PHP-CS-Fixer into Visual Studio Code.",
"version": "0.0.6",
"version": "0.0.7",
"publisher": "higoka",
"author": {
"name": "higoka",
Expand Down Expand Up @@ -39,17 +39,17 @@
"title": "PHP-CS-Fixer",
"properties": {
"php-cs-fixer.executable": {
"description": "Path to the php-cs-fixer executable.",
"description": "Path to php-cs-fixer executable.",
"type": "string",
"default": "/usr/local/bin/php-cs-fixer"
},
"php-cs-fixer.configFile": {
"description": "Path to the php-cs-fixer config.",
"description": "Path to php-cs-fixer config.",
"type": "string",
"default": ""
},
"php-cs-fixer.pathMode": {
"description": "Appends the \"--path-mode\" parameter",
"description": "Set \"--path-mode\" parameter.",
"type": "string",
"enum": [
"override",
Expand Down

0 comments on commit 41b5fb1

Please sign in to comment.