-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
3,722 additions
and
2,824 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
out | ||
dist | ||
node_modules | ||
npm-debug.log | ||
*.vsix | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
enable-pre-post-scripts=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,15 @@ | ||
.vscode/** | ||
.vscode-test/** | ||
.github | ||
.* | ||
.**/** | ||
patches/** | ||
src/** | ||
scripts/** | ||
out/scripts | ||
out/test/** | ||
out/** | ||
test/** | ||
testProject/** | ||
**/*.map | ||
.gitignore | ||
*.config.ts | ||
tsconfig*.json | ||
.editorconfig | ||
.prettierignore | ||
yarn.lock | ||
pnpm-lock.yaml | ||
prettier.config.*js | ||
.eslintrc.*js | ||
*.log | ||
node_modules/**/.vscode | ||
node_modules/**/*.md | ||
node_modules/**/*.ts | ||
node_modules/**/*.txt | ||
node_modules/**/.editorconfig | ||
node_modules/**/LICENSE* | ||
node_modules/**/license* | ||
node_modules/**/test/* | ||
node_modules/php-parser | ||
node_modules/compare-versions/lib/esm | ||
*.tgz | ||
*.vsix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,19 +3,19 @@ | |
"displayName": "phpfmt - PHP formatter", | ||
"version": "1.1.40", | ||
"description": "Integrates phpfmt into VS Code", | ||
"main": "./out/src/extension", | ||
"main": "./dist/extension", | ||
"scripts": { | ||
"build": "nr clean && tsc", | ||
"build": "nr clean && tsc && tsup", | ||
"build:docs": "tsx scripts/docs.ts", | ||
"prebuild": "nr build:docs", | ||
"watch": "tsc -watch -p ./", | ||
"watch": "tsup --watch", | ||
"clean": "rimraf out", | ||
"postinstall": "node ./node_modules/phpfmt/v2/install", | ||
"postinstall": "node ./node_modules/phpfmt/v2/install && shx cp ./node_modules/phpfmt/v2/fmt.stub.php ./dist", | ||
"pretest": "nr build", | ||
"test": "node ./out/test/runTest.js", | ||
"format": "prettier --write .", | ||
"lint": "eslint --ext .ts,.js --fix src test scripts", | ||
"prepublishOnly": "nr build && vsce publish" | ||
"prepublishOnly": "nr build && vsce publish --no-dependencies" | ||
}, | ||
"keywords": [ | ||
"phpfmt", | ||
|
@@ -27,7 +27,7 @@ | |
"license": "BSD-3-Clause", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/kokororin/vscode-phpfmt.git" | ||
"url": "git+https://github.com/kokororin/vscode-phpfmt.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/kokororin/vscode-phpfmt/issues" | ||
|
@@ -646,9 +646,12 @@ | |
"md5": "^2.3.0", | ||
"mocha": "^10.3.0", | ||
"prettier": "^3.2.5", | ||
"read-pkg-up": "^7.0.1", | ||
"rimraf": "^5.0.5", | ||
"semver": "^7.6.0", | ||
"shx": "^0.3.4", | ||
"simple-git": "^3.22.0", | ||
"tsup": "^8.0.2", | ||
"tsx": "^4.7.1", | ||
"typescript": "~5.3.0" | ||
}, | ||
|
@@ -657,7 +660,12 @@ | |
"detect-indent": "^6.0.0", | ||
"find-up": "^5.0.0", | ||
"mem": "^8.1.1", | ||
"phpfmt": "^0.0.6", | ||
"pjson": "^1.0.9" | ||
"phpfmt": "^0.0.7" | ||
}, | ||
"packageManager": "[email protected]", | ||
"pnpm": { | ||
"patchedDependencies": { | ||
"[email protected]": "patches/[email protected]" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
diff --git a/parser/index.js b/parser/index.js | ||
index 8860b47ff87e52a587bcc17992ecb1deccd40e92..730877562b1db1a2da081ed2fb5b44c750a06720 100644 | ||
--- a/parser/index.js | ||
+++ b/parser/index.js | ||
@@ -21,32 +21,6 @@ parser.getPasses = function (phpfmt, mode) { | ||
passes = passes.filter(function (pass) { | ||
return pass !== 'AdditionalPass'; | ||
}); | ||
- } else if (mode === parser.MODE_PARSER) { | ||
- var phpParser = new (require('php-parser'))({ | ||
- ast: { | ||
- withPositions: true | ||
- } | ||
- }); | ||
- | ||
- var ast = phpParser.parseCode(code); | ||
- | ||
- var traverse = function (node) { | ||
- if (node && typeof node === 'object') { | ||
- if ( | ||
- node.kind === 'class' && | ||
- node.extends && | ||
- (node.extends.name === 'AdditionalPass' || | ||
- node.extends.name === 'FormatterPass') | ||
- ) { | ||
- passes.push(node.name.name); | ||
- } else { | ||
- for (var prop in node) { | ||
- traverse(node[prop]); | ||
- } | ||
- } | ||
- } | ||
- }; | ||
- traverse(ast); | ||
} else { | ||
throw new Error('Unknown mode'); | ||
} |
Oops, something went wrong.