Compare commits
85 Commits
Author | SHA1 | Date |
---|---|---|
|
6001269db0 | |
|
4898e75f4e | |
|
9785d23da7 | |
|
5e61b44249 | |
|
18c03ef974 | |
|
7281961bde | |
|
ab20916e50 | |
|
3bd389a5e6 | |
|
51e9ca1cdb | |
|
3fdd166950 | |
|
3b78c60524 | |
|
ff778bb66b | |
|
aed701a705 | |
|
9e4e9ce240 | |
|
00bac7d66d | |
|
207b078038 | |
|
0c2985e776 | |
|
edd8806ab7 | |
|
331f59a6a4 | |
|
99749d96dd | |
|
36107c80a8 | |
|
c18c02ac42 | |
|
4fd20ab036 | |
|
4e4185634d | |
|
9765c68f5d | |
|
ba3c42d35a | |
|
aeab9204a0 | |
|
118dd76487 | |
|
a687c4a454 | |
|
e40b07e227 | |
|
9e7351dea5 | |
|
a81b48e7fa | |
|
09149c5317 | |
|
0f9fecdf98 | |
|
01b0b6fb89 | |
|
fe4c682182 | |
|
6773c16ecc | |
|
23ca5f252f | |
|
16a85121f6 | |
|
aa8a9e0dae | |
|
aa9645af54 | |
|
83846ffa0b | |
|
861de7e8b9 | |
|
4070a9438a | |
|
f37f2b7365 | |
|
4945fec380 | |
|
f9e7e2f488 | |
|
16ef106ac8 | |
|
ff0573deb2 | |
|
2a3af2d5ee | |
|
dc7f2c3715 | |
|
21d79b5fd6 | |
|
ff761ef616 | |
|
e039550c92 | |
|
42eca3f8d7 | |
|
2765625a9f | |
|
c0ceebbb40 | |
|
2535d716c8 | |
|
e750b0e590 | |
|
45a291bdea | |
|
3d9b1e83dd | |
|
0d1443e127 | |
|
c74f2b6973 | |
|
a83faf1658 | |
|
79edb58199 | |
|
339b8a3b89 | |
|
a3e2822904 | |
|
9558c8aaca | |
|
dbfcdbc490 | |
|
8a58743c58 | |
|
7aebb777ce | |
|
4c93a9ff0a | |
|
294e4df2d2 | |
|
ef25b8cf36 | |
|
35999fa16e | |
|
fa97865c8f | |
|
6be3148dd2 | |
|
38dde53947 | |
|
c50bbb1633 | |
|
6a56007586 | |
|
766370ddf6 | |
|
bdd4a8b869 | |
|
d70664fd84 | |
|
0763f37e8a | |
|
ad483b305a |
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
THERE IS A 99% CHANCE YOU ARE FILING THIS ISSUE IN THE WRONG REPOSITORY.
|
THERE IS A 99% CHANCE YOU ARE FILING THIS ISSUE IN THE WRONG REPOSITORY.
|
||||||
|
|
|
@ -2,4 +2,3 @@ node_modules/
|
||||||
out/
|
out/
|
||||||
vendor/
|
vendor/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
package-lock.json
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
package.json
|
||||||
|
package-lock.json
|
||||||
|
vendor/
|
||||||
|
out/
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"tabWidth": 4,
|
||||||
|
"printWidth": 120,
|
||||||
|
"proseWrap": "preserve",
|
||||||
|
"semi": false,
|
||||||
|
"trailingComma": "es5",
|
||||||
|
"singleQuote": true,
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": "{*.js?(on),*.y?(a)ml,.*.js?(on),.*.y?(a)ml,*.md,.prettierrc,.stylelintrc,.babelrc}",
|
||||||
|
"options": {
|
||||||
|
"tabWidth": 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": "composer.{json,lock}",
|
||||||
|
"options": {
|
||||||
|
"tabWidth": 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
36
.travis.yml
36
.travis.yml
|
@ -1,11 +1,7 @@
|
||||||
language: php
|
language: php
|
||||||
|
|
||||||
php:
|
php:
|
||||||
- '7.0'
|
- '7.1'
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- BUILD_LEADER_ID=1
|
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
|
@ -13,22 +9,34 @@ cache:
|
||||||
- $HOME/.composer/cache
|
- $HOME/.composer/cache
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- git config --replace-all remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
|
- nvm install '12.4.0'
|
||||||
- git fetch --tags
|
- nvm use '12.4.0'
|
||||||
- nvm install 8
|
|
||||||
- nvm use 8
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- npm install
|
- npm ci
|
||||||
- composer install --prefer-dist --optimize-autoloader
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- npm run lint
|
- npm run lint
|
||||||
- npm run build
|
- npm run build
|
||||||
|
|
||||||
after_success:
|
jobs:
|
||||||
|
include:
|
||||||
|
- stage: test
|
||||||
|
- stage: release
|
||||||
|
php: '7.1'
|
||||||
|
install:
|
||||||
|
- npm ci
|
||||||
|
- composer install --prefer-dist --no-interaction --optimize-autoloader
|
||||||
|
script:
|
||||||
|
- npm run build
|
||||||
- npm run semantic-release
|
- npm run semantic-release
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- test
|
||||||
|
- name: release
|
||||||
|
if: branch = master AND type = push AND fork = false
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
except:
|
only:
|
||||||
- /^v\d+\.\d+\.\d+$/
|
- master
|
||||||
|
- /^renovate\/.+/
|
||||||
|
|
|
@ -7,9 +7,7 @@
|
||||||
"type": "extensionHost",
|
"type": "extensionHost",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"runtimeExecutable": "${execPath}",
|
"runtimeExecutable": "${execPath}",
|
||||||
"args": [
|
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
|
||||||
"--extensionDevelopmentPath=${workspaceRoot}"
|
|
||||||
],
|
|
||||||
"stopOnEntry": false,
|
"stopOnEntry": false,
|
||||||
"sourceMaps": true,
|
"sourceMaps": true,
|
||||||
"outDir": "${workspaceRoot}/out"
|
"outDir": "${workspaceRoot}/out"
|
||||||
|
@ -19,10 +17,7 @@
|
||||||
"type": "extensionHost",
|
"type": "extensionHost",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"runtimeExecutable": "${execPath}",
|
"runtimeExecutable": "${execPath}",
|
||||||
"args": [
|
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test"],
|
||||||
"--extensionDevelopmentPath=${workspaceRoot}",
|
|
||||||
"--extensionTestsPath=${workspaceRoot}/out/test"
|
|
||||||
],
|
|
||||||
"stopOnEntry": false,
|
"stopOnEntry": false,
|
||||||
"sourceMaps": true,
|
"sourceMaps": true,
|
||||||
"outDir": "${workspaceRoot}/out/test"
|
"outDir": "${workspaceRoot}/out/test"
|
||||||
|
|
|
@ -6,16 +6,12 @@
|
||||||
{
|
{
|
||||||
"type": "npm",
|
"type": "npm",
|
||||||
"script": "build",
|
"script": "build",
|
||||||
"problemMatcher": [
|
"problemMatcher": ["$tsc"]
|
||||||
"$tsc"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "npm",
|
"type": "npm",
|
||||||
"script": "watch",
|
"script": "watch",
|
||||||
"problemMatcher": [
|
"problemMatcher": ["$tsc-watch"]
|
||||||
"$tsc-watch"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ images/**
|
||||||
out/test/**
|
out/test/**
|
||||||
src/**
|
src/**
|
||||||
vendor/jetbrains/phpstorm-stubs/**
|
vendor/jetbrains/phpstorm-stubs/**
|
||||||
|
!vendor/jetbrains/phpstorm-stubs/PhpStormStubsMap.php
|
||||||
vendor/bin/**
|
vendor/bin/**
|
||||||
**/.DS_Store
|
**/.DS_Store
|
||||||
**/.editorconfig
|
**/.editorconfig
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
|
|
||||||
# See [GitHub releases](https://github.com/felixfbecker/vscode-php-intellisense/releases)
|
# See [GitHub releases](https://github.com/felixfbecker/vscode-php-intellisense/releases)
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2017 Felix Becker
|
Copyright (c) 2017-2018 Felix Becker
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
28
README.md
28
README.md
|
@ -1,6 +1,6 @@
|
||||||
# PHP IntelliSense
|
# PHP IntelliSense
|
||||||
|
|
||||||
[](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense) [](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense) [](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense) [](https://travis-ci.org/felixfbecker/vscode-php-intellisense) [](https://gemnasium.com/felixfbecker/vscode-php-intellisense) [](https://php.net/) [](https://gitter.im/felixfbecker/vscode-php-intellisense?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [](https://github.com/semantic-release/semantic-release)
|
[](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense) [](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense) [](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense) [](https://travis-ci.org/felixfbecker/vscode-php-intellisense) [](https://php.net/) [](https://gitter.im/felixfbecker/vscode-php-intellisense?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [](https://github.com/semantic-release/semantic-release)
|
||||||
|
|
||||||
Advanced PHP IntelliSense for Visual Studio Code.
|
Advanced PHP IntelliSense for Visual Studio Code.
|
||||||
|
|
||||||
|
@ -15,45 +15,63 @@ I recommend to disable VS Code's built-in PHP IntelliSense by setting `php.sugge
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
### Completion
|
### Completion
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
### Signature Help
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
### Workspace symbol search
|
### Workspace symbol search
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Find all References
|
### Find all References
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Go to Definition
|
### Go to Definition
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Hover
|
### Hover
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Find all symbols
|
### Find all symbols
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Format code
|
|
||||||

|
|
||||||
|
|
||||||
### Column-accurate error reporting
|
### Column-accurate error reporting
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
### Code style linting
|
||||||
|
|
||||||
|
Please use a dedicated extension like [PHP CodeSniffer](https://marketplace.visualstudio.com/items?itemName=ikappas.phpcs).
|
||||||
|
|
||||||
|
### Format code
|
||||||
|
|
||||||
|
Please use a dedicated extension like [PHP CS Fixer](https://marketplace.visualstudio.com/items?itemName=junstyle.php-cs-fixer).
|
||||||
|
|
||||||
## Todo
|
## Todo
|
||||||
|
|
||||||
- Rename
|
- Rename
|
||||||
- Signature help
|
- Signature help
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Clone whole repository and in root directory execute:
|
Clone whole repository and in root directory execute:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
composer install
|
composer install
|
||||||
npm install
|
npm install
|
||||||
npm run compile
|
npm run build
|
||||||
code .
|
code .
|
||||||
```
|
```
|
||||||
|
|
||||||
The last command will open the folder in VS Code. Hit `F5` to launch an Extension Development Host with the extension.
|
The last command will open the folder in VS Code. Hit `F5` to launch an Extension Development Host with the extension.
|
||||||
For working on the language server, the easiest way is to replace the language server installation from composer in `vendor/felixfbecker/language-server` with a symlink to your local clone.
|
For working on the language server, the easiest way is to replace the language server installation from composer in `vendor/felixfbecker/language-server` with a symlink to your local clone.
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
{
|
{
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
|
"config": {
|
||||||
|
"platform": {
|
||||||
|
"php": "7.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"felixfbecker/language-server": "^5.0.0"
|
"felixfbecker/language-server": "5.4.6"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"parse-stubs": "LanguageServer\\ComposerScripts::parseStubs",
|
"parse-stubs": "LanguageServer\\ComposerScripts::parseStubs",
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,14 +1,13 @@
|
||||||
collectors:
|
collectors:
|
||||||
|
|
||||||
- type: js-npm
|
- type: js-npm
|
||||||
path: /
|
path: /
|
||||||
actors:
|
actors:
|
||||||
# pull requests for new major versions
|
# pull requests for new major versions
|
||||||
- type: js-npm
|
- type: js-npm
|
||||||
versions: "Y.0.0"
|
versions: 'Y.0.0'
|
||||||
settings:
|
settings:
|
||||||
# these updates should generally not have an effect on users
|
# these updates should generally not have an effect on users
|
||||||
commit_message_prefix: "chore: "
|
commit_message_prefix: 'chore: '
|
||||||
|
|
||||||
# receive pull requests to update composer.lock for any update to the language server or dependencies of it
|
# receive pull requests to update composer.lock for any update to the language server or dependencies of it
|
||||||
# after merging, depending on whether it was a patch or feature update,
|
# after merging, depending on whether it was a patch or feature update,
|
||||||
|
@ -18,18 +17,17 @@ collectors:
|
||||||
settings:
|
settings:
|
||||||
collect_transitive: true
|
collect_transitive: true
|
||||||
actors:
|
actors:
|
||||||
|
- type: php-composer
|
||||||
|
versions: 'L.L.Y'
|
||||||
|
settings:
|
||||||
|
commit_message_prefix: 'fix: '
|
||||||
|
|
||||||
- type: php-composer
|
- type: php-composer
|
||||||
versions: "L.L.Y"
|
versions: 'L.Y.0'
|
||||||
settings:
|
settings:
|
||||||
commit_message_prefix: "fix: "
|
commit_message_prefix: 'feat: '
|
||||||
|
|
||||||
- type: php-composer
|
- type: php-composer
|
||||||
versions: "L.Y.0"
|
versions: 'Y.0.0'
|
||||||
settings:
|
settings:
|
||||||
commit_message_prefix: "feat: "
|
commit_message_prefix: 'chore: '
|
||||||
|
|
||||||
- type: php-composer
|
|
||||||
versions: "Y.0.0"
|
|
||||||
settings:
|
|
||||||
commit_message_prefix: "chore: "
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 51 KiB |
Binary file not shown.
After Width: | Height: | Size: 316 KiB |
File diff suppressed because it is too large
Load Diff
81
package.json
81
package.json
|
@ -7,9 +7,9 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"private": true,
|
"private": true,
|
||||||
"preview": false,
|
"preview": false,
|
||||||
"version": "0.0.0-development",
|
"version": "1.5.4",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.17.1"
|
"vscode": "^1.26.1"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"php",
|
"php",
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
"refactor"
|
"refactor"
|
||||||
],
|
],
|
||||||
"categories": [
|
"categories": [
|
||||||
"Languages"
|
"Programming Languages"
|
||||||
],
|
],
|
||||||
"icon": "images/logo.png",
|
"icon": "images/logo.png",
|
||||||
"galleryBanner": {
|
"galleryBanner": {
|
||||||
|
@ -38,41 +38,64 @@
|
||||||
"workspaceContains:**/*.php"
|
"workspaceContains:**/*.php"
|
||||||
],
|
],
|
||||||
"main": "./out/extension",
|
"main": "./out/extension",
|
||||||
|
"husky": {
|
||||||
|
"hooks": {
|
||||||
|
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS"
|
||||||
|
}
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc -p .",
|
"build": "tsc -p .",
|
||||||
"watch": "tsc -w -p .",
|
"watch": "tsc -w -p .",
|
||||||
"postinstall": "node ./node_modules/vscode/bin/install",
|
"postinstall": "node ./node_modules/vscode/bin/install",
|
||||||
"lint": "tslint -c tslint.json \"src/**/*.ts\"",
|
"lint": "npm run prettier && npm run tslint",
|
||||||
"semantic-release": "semantic-release pre && vsce publish -p $VSCE_TOKEN && semantic-release post",
|
"tslint": "tslint -p tsconfig.json -c tslint.json \"src/**/*.ts\"",
|
||||||
"commitmsg": "validate-commit-msg"
|
"prettier": "prettier '**/{*.{js?(on),ts,yml},.*.js?(on),.*.yml,.prettierrc,*.md}' --write --list-different",
|
||||||
|
"semantic-release": "semantic-release"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/mocha": "^2.2.42",
|
"@commitlint/cli": "7.2.1",
|
||||||
"@types/mz": "^0.0.31",
|
"@commitlint/config-conventional": "7.1.2",
|
||||||
"@types/node": "^8.0.24",
|
"@types/execa": "0.9.0",
|
||||||
"@types/semver": "^5.3.34",
|
"@types/mocha": "5.2.7",
|
||||||
"cz-conventional-changelog": "^2.0.0",
|
"@types/mz": "0.0.32",
|
||||||
"husky": "^0.14.3",
|
"@types/node": "8.10.29",
|
||||||
"last-release-git": "0.0.3",
|
"@types/semver": "6.2.0",
|
||||||
"semantic-release": "^8.2.0",
|
"husky": "1.1.3",
|
||||||
"tslint": "^5.0.0",
|
"prettier": "1.15.3",
|
||||||
"typescript": "^2.1.4",
|
"semantic-release": "15.10.8",
|
||||||
"validate-commit-msg": "^2.14.0",
|
"semantic-release-vsce": "2.1.2",
|
||||||
"vsce": "^1.8.1",
|
"tslint": "5.11.0",
|
||||||
"vscode": "^1.0.0"
|
"tslint-config-prettier": "1.15.0",
|
||||||
|
"typescript": "3.1.6",
|
||||||
|
"vscode": "1.1.21"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"mz": "^2.4.0",
|
"execa": "1.0.0",
|
||||||
"semver": "^5.3.0",
|
"mz": "2.7.0",
|
||||||
"vscode-languageclient": "^3.0.3"
|
"semver": "6.3.0",
|
||||||
|
"vscode-languageclient": "5.1.1"
|
||||||
},
|
},
|
||||||
"config": {
|
"commitlint": {
|
||||||
"commitizen": {
|
"extends": [
|
||||||
"path": "./node_modules/cz-conventional-changelog"
|
"@commitlint/config-conventional"
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"release": {
|
"release": {
|
||||||
"getLastRelease": "last-release-git"
|
"verifyConditions": [
|
||||||
|
"semantic-release-vsce",
|
||||||
|
"@semantic-release/github"
|
||||||
|
],
|
||||||
|
"prepare": {
|
||||||
|
"path": "semantic-release-vsce",
|
||||||
|
"packageVsix": "php-intellisense.vsix"
|
||||||
|
},
|
||||||
|
"publish": [
|
||||||
|
"semantic-release-vsce",
|
||||||
|
{
|
||||||
|
"path": "@semantic-release/github",
|
||||||
|
"assets": "php-intellisense.vsix"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"contributes": {
|
"contributes": {
|
||||||
"configuration": {
|
"configuration": {
|
||||||
|
@ -81,8 +104,8 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"php.memoryLimit": {
|
"php.memoryLimit": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "-1",
|
"default": "4095M",
|
||||||
"description": "The memory limit of the php language server. [Number][K|M|G]. Use '-1' to allow unlimited use of the RAM(default).",
|
"description": "The memory limit of the php language server. [Number][K|M|G]. Use '-1' to allow unlimited use of the RAM (default is 4G).",
|
||||||
"pattern": "^\\d+[KMG]?$"
|
"pattern": "^\\d+[KMG]?$"
|
||||||
},
|
},
|
||||||
"php.executablePath": {
|
"php.executablePath": {
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
{
|
||||||
|
"extends": ["config:base", ":maintainLockFilesMonthly"],
|
||||||
|
"prCreation": "not-pending",
|
||||||
|
"rangeStrategy": "pin",
|
||||||
|
"semanticCommits": true,
|
||||||
|
"npm": {
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"packagePatterns": ["*"],
|
||||||
|
"semanticCommitType": "chore",
|
||||||
|
"minor": {
|
||||||
|
"groupName": "all non-major dependencies",
|
||||||
|
"groupSlug": "all-minor-patch"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"separateMinorPatch": true,
|
||||||
|
"composer": {
|
||||||
|
"enabled": true,
|
||||||
|
"rollbackPrs": false
|
||||||
|
},
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"packagePatterns": ["^@types/"],
|
||||||
|
"automerge": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"packageNames": ["felixfbecker/language-server"],
|
||||||
|
"schedule": [],
|
||||||
|
"updateTypes": ["minor"],
|
||||||
|
"semanticCommitType": "feat"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"packageNames": ["felixfbecker/language-server"],
|
||||||
|
"schedule": [],
|
||||||
|
"updateTypes": ["patch"],
|
||||||
|
"semanticCommitType": "fix"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
128
src/extension.ts
128
src/extension.ts
|
@ -1,117 +1,137 @@
|
||||||
|
import execa from 'execa'
|
||||||
import * as path from 'path';
|
import { ChildProcess, spawn } from 'mz/child_process'
|
||||||
import { spawn, execFile, ChildProcess } from 'mz/child_process';
|
import * as net from 'net'
|
||||||
import * as vscode from 'vscode';
|
import * as path from 'path'
|
||||||
import { LanguageClient, LanguageClientOptions, StreamInfo } from 'vscode-languageclient';
|
import * as semver from 'semver'
|
||||||
import * as semver from 'semver';
|
import * as url from 'url'
|
||||||
import * as net from 'net';
|
import * as vscode from 'vscode'
|
||||||
import * as url from 'url';
|
import { LanguageClient, LanguageClientOptions, RevealOutputChannelOn, StreamInfo } from 'vscode-languageclient'
|
||||||
|
const composerJson = require('../composer.json')
|
||||||
|
|
||||||
export async function activate(context: vscode.ExtensionContext): Promise<void> {
|
export async function activate(context: vscode.ExtensionContext): Promise<void> {
|
||||||
|
const conf = vscode.workspace.getConfiguration('php')
|
||||||
|
const executablePath =
|
||||||
|
conf.get<string>('executablePath') ||
|
||||||
|
conf.get<string>('validate.executablePath') ||
|
||||||
|
(process.platform === 'win32' ? 'php.exe' : 'php')
|
||||||
|
|
||||||
const conf = vscode.workspace.getConfiguration('php');
|
const memoryLimit = conf.get<string>('memoryLimit') || '4095M'
|
||||||
const executablePath = conf.get<string>('executablePath') || 'php';
|
|
||||||
|
|
||||||
const memoryLimit = conf.get<string>('memoryLimit') || '-1';
|
|
||||||
|
|
||||||
if (memoryLimit !== '-1' && !/^\d+[KMG]?$/.exec(memoryLimit)) {
|
if (memoryLimit !== '-1' && !/^\d+[KMG]?$/.exec(memoryLimit)) {
|
||||||
const selected = await vscode.window.showErrorMessage(
|
const selected = await vscode.window.showErrorMessage(
|
||||||
'The memory limit you\'d provided is not numeric, nor "-1" nor valid php shorthand notation!',
|
'The memory limit you\'d provided is not numeric, nor "-1" nor valid php shorthand notation!',
|
||||||
'Open settings'
|
'Open settings'
|
||||||
);
|
)
|
||||||
if (selected === 'Open settings') {
|
if (selected === 'Open settings') {
|
||||||
await vscode.commands.executeCommand('workbench.action.openGlobalSettings');
|
await vscode.commands.executeCommand('workbench.action.openGlobalSettings')
|
||||||
}
|
}
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check path (if PHP is available and version is ^7.0.0)
|
// Check path (if PHP is available and version is ^7.0.0)
|
||||||
let stdout: string;
|
let stdout: string
|
||||||
try {
|
try {
|
||||||
[stdout] = await execFile(executablePath, ['--version']);
|
stdout = await execa.stdout(executablePath, ['--version'])
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.code === 'ENOENT') {
|
if (err.code === 'ENOENT') {
|
||||||
const selected = await vscode.window.showErrorMessage(
|
const selected = await vscode.window.showErrorMessage(
|
||||||
'PHP executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath setting',
|
'PHP executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath setting',
|
||||||
'Open settings'
|
'Open settings'
|
||||||
);
|
)
|
||||||
if (selected === 'Open settings') {
|
if (selected === 'Open settings') {
|
||||||
await vscode.commands.executeCommand('workbench.action.openGlobalSettings');
|
await vscode.commands.executeCommand('workbench.action.openGlobalSettings')
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
vscode.window.showErrorMessage('Error spawning PHP: ' + err.message);
|
vscode.window.showErrorMessage('Error spawning PHP: ' + err.message)
|
||||||
console.error(err);
|
console.error(err)
|
||||||
}
|
}
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse version and discard OS info like 7.0.8--0ubuntu0.16.04.2
|
// Parse version and discard OS info like 7.0.8--0ubuntu0.16.04.2
|
||||||
const match = stdout.match(/^PHP ([^\s]+)/m);
|
const match = stdout.match(/^PHP ([^\s]+)/m)
|
||||||
if (!match) {
|
if (!match) {
|
||||||
vscode.window.showErrorMessage('Error parsing PHP version. Please check the output of php --version');
|
vscode.window.showErrorMessage('Error parsing PHP version. Please check the output of php --version')
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
let version = match[1].split('-')[0];
|
let version = match[1].split('-')[0]
|
||||||
// Convert PHP prerelease format like 7.0.0rc1 to 7.0.0-rc1
|
// Convert PHP prerelease format like 7.0.0rc1 to 7.0.0-rc1
|
||||||
if (!/^\d+.\d+.\d+$/.test(version)) {
|
if (!/^\d+.\d+.\d+$/.test(version)) {
|
||||||
version = version.replace(/(\d+.\d+.\d+)/, '$1-');
|
version = version.replace(/(\d+.\d+.\d+)/, '$1-')
|
||||||
}
|
}
|
||||||
if (semver.lt(version, '7.0.0')) {
|
if (semver.lt(version, composerJson.config.platform.php)) {
|
||||||
vscode.window.showErrorMessage('The language server needs at least PHP 7 installed. Version found: ' + version);
|
vscode.window.showErrorMessage('The language server needs at least PHP 7.1 installed. Version found: ' + version)
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const serverOptions = () => new Promise<ChildProcess | StreamInfo>((resolve, reject) => {
|
let client: LanguageClient
|
||||||
|
|
||||||
|
const serverOptions = () =>
|
||||||
|
new Promise<ChildProcess | StreamInfo>((resolve, reject) => {
|
||||||
// Use a TCP socket because of problems with blocking STDIO
|
// Use a TCP socket because of problems with blocking STDIO
|
||||||
const server = net.createServer(socket => {
|
const server = net.createServer(socket => {
|
||||||
// 'connection' listener
|
// 'connection' listener
|
||||||
console.log('PHP process connected');
|
console.log('PHP process connected')
|
||||||
socket.on('end', () => {
|
socket.on('end', () => {
|
||||||
console.log('PHP process disconnected');
|
console.log('PHP process disconnected')
|
||||||
});
|
})
|
||||||
server.close();
|
server.close()
|
||||||
resolve({ reader: socket, writer: socket });
|
resolve({ reader: socket, writer: socket })
|
||||||
});
|
})
|
||||||
// Listen on random port
|
// Listen on random port
|
||||||
server.listen(0, '127.0.0.1', () => {
|
server.listen(0, '127.0.0.1', () => {
|
||||||
// The server is implemented in PHP
|
// The server is implemented in PHP
|
||||||
const childProcess = spawn(executablePath, [
|
const childProcess = spawn(executablePath, [
|
||||||
context.asAbsolutePath(path.join('vendor', 'felixfbecker', 'language-server', 'bin', 'php-language-server.php')),
|
context.asAbsolutePath(
|
||||||
|
path.join('vendor', 'felixfbecker', 'language-server', 'bin', 'php-language-server.php')
|
||||||
|
),
|
||||||
'--tcp=127.0.0.1:' + server.address().port,
|
'--tcp=127.0.0.1:' + server.address().port,
|
||||||
'--memory-limit=' + memoryLimit
|
'--memory-limit=' + memoryLimit,
|
||||||
]);
|
])
|
||||||
childProcess.stderr.on('data', (chunk: Buffer) => {
|
childProcess.stderr.on('data', (chunk: Buffer) => {
|
||||||
console.error(chunk + '');
|
const str = chunk.toString()
|
||||||
});
|
console.log('PHP Language Server:', str)
|
||||||
childProcess.stdout.on('data', (chunk: Buffer) => {
|
client.outputChannel.appendLine(str)
|
||||||
console.log(chunk + '');
|
})
|
||||||
});
|
// childProcess.stdout.on('data', (chunk: Buffer) => {
|
||||||
return childProcess;
|
// console.log('PHP Language Server:', chunk + '');
|
||||||
});
|
// });
|
||||||
});
|
childProcess.on('exit', (code, signal) => {
|
||||||
|
client.outputChannel.appendLine(
|
||||||
|
`Language server exited ` + (signal ? `from signal ${signal}` : `with exit code ${code}`)
|
||||||
|
)
|
||||||
|
if (code !== 0) {
|
||||||
|
client.outputChannel.show()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return childProcess
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
// Options to control the language client
|
// Options to control the language client
|
||||||
const clientOptions: LanguageClientOptions = {
|
const clientOptions: LanguageClientOptions = {
|
||||||
// Register the server for php documents
|
// Register the server for php documents
|
||||||
documentSelector: ['php'],
|
documentSelector: [{ scheme: 'file', language: 'php' }, { scheme: 'untitled', language: 'php' }],
|
||||||
|
revealOutputChannelOn: RevealOutputChannelOn.Never,
|
||||||
uriConverters: {
|
uriConverters: {
|
||||||
// VS Code by default %-encodes even the colon after the drive letter
|
// VS Code by default %-encodes even the colon after the drive letter
|
||||||
// NodeJS handles it much better
|
// NodeJS handles it much better
|
||||||
code2Protocol: uri => url.format(url.parse(uri.toString(true))),
|
code2Protocol: uri => url.format(url.parse(uri.toString(true))),
|
||||||
protocol2Code: str => vscode.Uri.parse(str)
|
protocol2Code: str => vscode.Uri.parse(str),
|
||||||
},
|
},
|
||||||
synchronize: {
|
synchronize: {
|
||||||
// Synchronize the setting section 'php' to the server
|
// Synchronize the setting section 'php' to the server
|
||||||
configurationSection: 'php',
|
configurationSection: 'php',
|
||||||
// Notify the server about changes to PHP files in the workspace
|
// Notify the server about changes to PHP files in the workspace
|
||||||
fileEvents: vscode.workspace.createFileSystemWatcher('**/*.php')
|
fileEvents: vscode.workspace.createFileSystemWatcher('**/*.php'),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
// Create the language client and start the client.
|
// Create the language client and start the client.
|
||||||
const disposable = new LanguageClient('PHP Language Server', serverOptions, clientOptions).start();
|
client = new LanguageClient('PHP Language Server', serverOptions, clientOptions)
|
||||||
|
const disposable = client.start()
|
||||||
|
|
||||||
// Push the disposable to the context's subscriptions so that the
|
// Push the disposable to the context's subscriptions so that the
|
||||||
// client can be deactivated on extension deactivation
|
// client can be deactivated on extension deactivation
|
||||||
context.subscriptions.push(disposable);
|
context.subscriptions.push(disposable)
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
// The module 'assert' provides assertion methods from node
|
// The module 'assert' provides assertion methods from node
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert'
|
||||||
|
|
||||||
// You can import and use all API from the 'vscode' module
|
// You can import and use all API from the 'vscode' module
|
||||||
// as well as import your extension to test it
|
// as well as import your extension to test it
|
||||||
|
@ -13,10 +13,9 @@ import * as assert from 'assert';
|
||||||
|
|
||||||
// Defines a Mocha test suite to group tests of similar kind together
|
// Defines a Mocha test suite to group tests of similar kind together
|
||||||
suite('Extension Tests', () => {
|
suite('Extension Tests', () => {
|
||||||
|
|
||||||
// Defines a Mocha unit test
|
// Defines a Mocha unit test
|
||||||
test('Something 1', () => {
|
test('Something 1', () => {
|
||||||
assert.equal(-1, [1, 2, 3].indexOf(5));
|
assert.equal(-1, [1, 2, 3].indexOf(5))
|
||||||
assert.equal(-1, [1, 2, 3].indexOf(0));
|
assert.equal(-1, [1, 2, 3].indexOf(0))
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
// to report the results back to the caller. When the tests are finished, return
|
// to report the results back to the caller. When the tests are finished, return
|
||||||
// a possible error to the callback or null if none.
|
// a possible error to the callback or null if none.
|
||||||
|
|
||||||
const testRunner = require('vscode/lib/testrunner');
|
const testRunner = require('vscode/lib/testrunner')
|
||||||
|
|
||||||
// You can directly control Mocha options by uncommenting the following lines
|
// You can directly control Mocha options by uncommenting the following lines
|
||||||
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
|
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
|
||||||
testRunner.configure({
|
testRunner.configure({
|
||||||
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
|
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
|
||||||
useColors: true // colored output from test results
|
useColors: true, // colored output from test results
|
||||||
});
|
})
|
||||||
|
|
||||||
module.exports = testRunner;
|
module.exports = testRunner
|
||||||
|
|
|
@ -4,9 +4,8 @@
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"outDir": "out",
|
"outDir": "out",
|
||||||
"lib": [
|
"esModuleInterop": true,
|
||||||
"es6"
|
"lib": ["es6"],
|
||||||
],
|
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
|
@ -17,8 +16,5 @@
|
||||||
"allowUnreachableCode": false,
|
"allowUnreachableCode": false,
|
||||||
"allowUnusedLabels": false
|
"allowUnusedLabels": false
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": ["node_modules", "out", "vendor"]
|
||||||
"node_modules",
|
|
||||||
"out"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
108
tslint.json
108
tslint.json
|
@ -1,43 +1,85 @@
|
||||||
{
|
{
|
||||||
|
"extends": ["tslint:recommended", "tslint-config-prettier"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"class-name": true,
|
"adjacent-overload-signatures": true,
|
||||||
"comment-format": [true, "check-space"],
|
"array-type": [true, "array"],
|
||||||
"indent": [true, "spaces"],
|
"arrow-return-shorthand": [true, "multiline"],
|
||||||
"no-eval": true,
|
"await-promise": [true, "Thenable"],
|
||||||
"no-internal-module": true,
|
"ban": [
|
||||||
"no-trailing-whitespace": true,
|
|
||||||
"no-var-keyword": true,
|
|
||||||
"one-line": [true, "check-catch", "check-finally", "check-else", "check-open-brace", "check-whitespace"],
|
|
||||||
"quotemark": [true, "single"],
|
|
||||||
"semicolon": [true, "always"],
|
|
||||||
"triple-equals": [true, "allow-null-check"],
|
|
||||||
"typedef-whitespace": [
|
|
||||||
true,
|
true,
|
||||||
{
|
{
|
||||||
"call-signature": "nospace",
|
"name": ["*", "forEach"]
|
||||||
"index-signature": "nospace",
|
|
||||||
"parameter": "nospace",
|
|
||||||
"property-declaration": "nospace",
|
|
||||||
"variable-declaration": "nospace"
|
|
||||||
},
|
},
|
||||||
|
["describe", "only"],
|
||||||
|
["it", "only"]
|
||||||
|
],
|
||||||
|
"callable-types": true,
|
||||||
|
"class-name": true,
|
||||||
|
"comment-format": [true, "check-space"],
|
||||||
|
"curly": true,
|
||||||
|
"deprecation": {
|
||||||
|
"severity": "warning"
|
||||||
|
},
|
||||||
|
"interface-name": [false],
|
||||||
|
"interface-over-type-literal": true,
|
||||||
|
"jsdoc-format": true,
|
||||||
|
"max-classes-per-file": false,
|
||||||
|
"member-access": [true, "check-accessor"],
|
||||||
|
"member-ordering": [false],
|
||||||
|
"no-angle-bracket-type-assertion": true,
|
||||||
|
"no-arg": true,
|
||||||
|
"no-bitwise": false,
|
||||||
|
"no-boolean-literal-compare": true,
|
||||||
|
"no-conditional-assignment": true,
|
||||||
|
"no-console": [false],
|
||||||
|
"no-construct": true,
|
||||||
|
"no-debugger": true,
|
||||||
|
"no-duplicate-super": true,
|
||||||
|
"no-duplicate-variable": true,
|
||||||
|
"no-empty": true,
|
||||||
|
"no-empty-interface": false,
|
||||||
|
"no-eval": true,
|
||||||
|
"no-floating-promises": [true],
|
||||||
|
"no-for-in-array": true,
|
||||||
|
"no-inferrable-types": [true],
|
||||||
|
"no-inferred-empty-object-type": true,
|
||||||
|
"no-internal-module": true,
|
||||||
|
"no-invalid-template-strings": true,
|
||||||
|
"no-magic-numbers": false,
|
||||||
|
"no-misused-new": true,
|
||||||
|
"no-namespace": [false, "allow-declarations"],
|
||||||
|
"no-reference-import": true,
|
||||||
|
"no-shadowed-variable": false,
|
||||||
|
"no-sparse-arrays": true,
|
||||||
|
"no-string-literal": true,
|
||||||
|
"no-string-throw": true,
|
||||||
|
"no-unbound-method": true,
|
||||||
|
"no-unnecessary-callback-wrapper": false,
|
||||||
|
"no-unnecessary-qualifier": true,
|
||||||
|
"no-unnecessary-type-assertion": false,
|
||||||
|
"no-unsafe-any": false,
|
||||||
|
"no-unsafe-finally": true,
|
||||||
|
"no-unused-expression": true,
|
||||||
|
"no-use-before-declare": true,
|
||||||
|
"no-var-keyword": true,
|
||||||
|
"no-var-requires": false,
|
||||||
|
"no-void-expression": false,
|
||||||
|
"object-literal-shorthand": true,
|
||||||
|
"object-literal-sort-keys": false,
|
||||||
|
"one-variable-per-declaration": [true, "ignore-for-loop"],
|
||||||
|
"only-arrow-functions": [true, "allow-declarations", "allow-named-functions"],
|
||||||
|
"prefer-const": [
|
||||||
|
true,
|
||||||
{
|
{
|
||||||
"call-signature": "onespace",
|
"destructuring": "all"
|
||||||
"index-signature": "onespace",
|
|
||||||
"parameter": "onespace",
|
|
||||||
"property-declaration": "onespace",
|
|
||||||
"variable-declaration": "onespace"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"variable-name": [true, "ban-keywords"],
|
"prefer-for-of": true,
|
||||||
"whitespace": [true, "check-branch", "check-decl", "check-operator", "check-separator", "check-type"],
|
"prefer-template": [false, "allow-single-concat"],
|
||||||
"jsdoc-format": true,
|
"return-undefined": true,
|
||||||
"no-consecutive-blank-lines": true,
|
"triple-equals": [true],
|
||||||
"one-variable-per-declaration": [true, "ignore-for-loop"],
|
"typedef": [true, "call-signature"],
|
||||||
"curly": true,
|
"unified-signatures": true,
|
||||||
"no-empty": true,
|
"variable-name": [true, "ban-keywords"]
|
||||||
"no-unused-expression": true,
|
|
||||||
"eofline": true,
|
|
||||||
"trailing-comma": [true, {"singleline": "never", "multiline": "never"}],
|
|
||||||
"align": [true, "parameters", "statements"]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue