Compare commits

...

110 Commits

Author SHA1 Message Date
Felix Becker 6001269db0 build: fix package-lock.json 2019-12-26 19:05:54 +01:00
Dylan McGannon 4898e75f4e fix: prevent focusing the output tab (#454) 2019-12-26 18:50:27 +01:00
Renovate Bot 9785d23da7 chore(deps): update dependency semver to v6 2019-12-14 20:51:02 +00:00
Felix Becker 5e61b44249 build: add package-lock.json 2019-09-20 17:38:06 +02:00
Felix Becker 18c03ef974 fix: bump PHP version requirement to 7.1
PHP 7.0 reached end of life: https://www.php.net/supported-versions.php

Fixes #447
2019-09-20 17:34:37 +02:00
Felix Becker 7281961bde fix: include stubs autoloader map 2019-09-19 14:23:48 +02:00
Felix Becker ab20916e50 fix: set the minimum php version to 7.0 2019-09-19 11:28:27 +02:00
Felix Becker 3bd389a5e6 fix: update dependencies 2019-09-19 11:20:20 +02:00
Renovate Bot 51e9ca1cdb chore(deps): update dependency @types/mocha to v5.2.7 2019-08-10 09:52:42 +00:00
Renovate Bot 3fdd166950 chore(deps): update dependency @types/mocha to v5.2.6 2019-02-14 00:38:26 +00:00
Renovate Bot 3b78c60524 chore(deps): update dependency prettier to v1.15.3 2018-11-30 09:17:37 +01:00
MarvinJWendt ff778bb66b docs: update copyright year (#397) 2018-11-22 09:08:15 +01:00
Renovate Bot aed701a705 fix(deps): update dependency felixfbecker/language-server to v5.4.6 2018-11-14 00:57:16 +01:00
Felix Becker 9e4e9ce240 chore(renovate): separate minor and patch
to make commit type config work
2018-11-13 22:35:18 +01:00
Renovate Bot 00bac7d66d chore(deps): pin dependency tslint-config-prettier to 1.15.0 2018-11-11 19:43:49 +01:00
Felix Becker 207b078038 chore(renovate): fix semanticCommitType
https://github.com/renovatebot/renovate/issues/2796#issuecomment-437687873
2018-11-11 18:37:45 +01:00
Felix Becker 0c2985e776 style: use prettier 2018-11-11 18:32:27 +01:00
renovate[bot] edd8806ab7 fix(deps): update dependency felixfbecker/language-server to v5.4.5 (#390) 2018-11-11 14:11:48 +01:00
renovate[bot] 331f59a6a4 chore(deps): update dependency vscode-languageclient to v5.1.1 (#389) 2018-11-11 12:49:33 +01:00
Felix Becker 99749d96dd chore(renovate): set no schedule for language server updates 2018-11-11 05:32:36 +01:00
Felix Becker 36107c80a8 chore(renovate): group updates together 2018-11-11 05:29:28 +01:00
Renovate Bot c18c02ac42 fix(deps): update dependency semver to v5.6.0 2018-11-11 05:25:55 +01:00
Renovate Bot 4fd20ab036 chore(deps): update dependency typescript to v3.1.6 2018-11-11 05:25:29 +01:00
Renovate Bot 4e4185634d chore(deps): update dependency semantic-release to v15.10.8 2018-11-11 05:25:19 +01:00
Felix Becker 9765c68f5d fix: improve handling of php executable 2018-11-11 05:16:58 +01:00
Felix Becker ba3c42d35a fix: log stderr output to output channel
e.g. stack traces from crashes
2018-11-11 05:16:09 +01:00
Felix Becker aeab9204a0 chore(renovate): disable rollback PRs 2018-11-11 04:24:51 +01:00
Felix Becker 118dd76487 chore: fix package.json 2018-11-11 04:24:28 +01:00
Felix Becker a687c4a454 chore(deps): update husky to 1.1.3 2018-11-11 04:22:06 +01:00
Renovate Bot e40b07e227 chore(deps): update commitlint monorepo 2018-11-11 04:18:36 +01:00
Felix Becker 9e7351dea5 perf: update language server to 5.4.3 2018-11-11 04:17:37 +01:00
Dependencies.io Bot a81b48e7fa fix: Update felixfbecker/advanced-json-rpc from v3.0.1 to v3.0.3 2018-11-11 04:06:15 +01:00
Dependencies.io Bot 09149c5317 fix: Update microsoft/tolerant-php-parser from v0.0.13 to v0.0.15 2018-11-11 04:05:58 +01:00
Felix Becker 0f9fecdf98 fix: update dependencies 2018-09-02 13:45:58 +02:00
renovate[bot] 01b0b6fb89 chore(deps): update dependency vscode-languageclient to v5 (#357) 2018-09-02 13:31:04 +02:00
Renovate Bot fe4c682182 chore(deps): update commitlint monorepo to v7 2018-09-02 13:27:08 +02:00
Renovate Bot 6773c16ecc chore(deps): update dependency typescript to v3 2018-09-02 13:26:40 +02:00
Renovate Bot 23ca5f252f chore(deps): update dependency @types/mz to v0.0.32 2018-09-02 03:48:32 +00:00
Renovate Bot 16a85121f6 chore(deps): pin dependencies 2018-09-02 02:26:29 +02:00
Renovate Bot aa8a9e0dae chore(deps): update dependency @types/mocha to v5.2.5 2018-09-02 00:03:14 +00:00
renovate[bot] aa9645af54 chore: configure Renovate (#350) 2018-09-01 23:50:41 +02:00
Felix Becker 83846ffa0b fix: update dependencies 2018-08-21 20:15:44 +02:00
Felix Becker 861de7e8b9
docs(badges): remove Gemnasium badge 2018-07-11 00:37:33 -07:00
Dependencies.io Bot 4070a9438a fix: Update microsoft/tolerant-php-parser from v0.0.11 to v0.0.12 2018-06-12 09:45:26 -07:00
Felix Becker f37f2b7365 chore: update semantic-release-vsce to fix bug 2018-05-30 15:17:58 -07:00
dependencies[bot] 4945fec380 fix: Update microsoft/tolerant-php-parser from v0.0.10 to v0.0.11 (#310) 2018-05-30 14:46:13 -07:00
Felix Becker f9e7e2f488 chore: use commitlint instead of validate-commit-msg 2018-05-30 14:32:17 -07:00
Felix Becker 16ef106ac8 chore: update semantic-release to v15 2018-05-30 14:26:16 -07:00
Felix Becker ff0573deb2 chore: change Languages -> Programming Languages category 2018-05-15 01:49:26 -07:00
dependencies[bot] 2a3af2d5ee chore: Update @types/mocha from 2.2.48 to 5.0.0 (#282) 2018-05-15 01:48:07 -07:00
dependencies[bot] dc7f2c3715 chore: Update sabre/event from 5.0.2 to 5.0.3 (#276) 2018-05-15 01:46:57 -07:00
Matt Welke 21d79b5fd6 docs(features): change readme for 'format code' (new extension PHP CS Fixer) (#252) 2018-04-26 17:02:30 -07:00
Zachary Hamm ff761ef616 docs(readme): npm command in README.md should be 'run build' (#290) 2018-04-26 17:00:37 -07:00
dependencies[bot] e039550c92 chore: Update composer/xdebug-handler in / from 1.0.0 to 1.1.0 (#291) 2018-04-11 09:58:54 -07:00
Jonathan Carter 42eca3f8d7 fix: restricting language services to file schemes 2018-04-04 17:21:31 -07:00
Dependencies.io Bot 2765625a9f fix: Update microsoft/tolerant-php-parser from v0.0.9 to v0.0.10 2018-03-19 13:46:18 -07:00
Dependencies.io Bot c0ceebbb40 feat: Update felixfbecker/language-server from v5.3.7 to v5.4.0 2018-03-19 13:46:05 -07:00
Dependencies.io Bot 2535d716c8 fix: Update felixfbecker/language-server from v5.3.6 to v5.3.7 2018-03-01 16:55:45 -08:00
Dependencies.io Bot e750b0e590 fix: Update microsoft/tolerant-php-parser from v0.0.8 to v0.0.9 2018-02-14 11:30:08 -08:00
Dependencies.io Bot 45a291bdea fix: Update felixfbecker/language-server from v5.3.5 to v5.3.6 2018-02-07 12:36:41 -08:00
Felix Becker 3d9b1e83dd chore: downgrade semantic-release/git to v2
v3 is only compatible with semantic-release v13
2018-02-03 14:02:44 -08:00
Felix Becker 0d1443e127 ci(release): update to semantic-release 12 2018-02-03 09:48:50 -08:00
Dependencies.io Bot c74f2b6973 fix: Update felixfbecker/language-server from v5.3.4 to v5.3.5 2018-02-03 08:58:04 -08:00
dependencies[bot] a83faf1658 fix: Update felixfbecker/language-server from v5.3.3 to v5.3.4 (#251) 2018-01-09 09:51:00 -08:00
Felix Becker 79edb58199 fix(memoryLimit): use default memory limit of 4G - 1
closes #240
2018-01-02 10:29:34 -08:00
dependencies[bot] 339b8a3b89 fix: Update felixfbecker/language-server from v5.3.2 to v5.3.3 (#238) 2017-12-30 23:10:56 -08:00
Eric Romano a3e2822904 fix(config): set a default memory limit (#235) 2017-12-30 23:10:46 -08:00
dependencies[bot] 9558c8aaca fix: Update felixfbecker/language-server from v5.3.1 to v5.3.2 (#231) 2017-12-24 23:52:39 -08:00
dependencies[bot] dbfcdbc490 fix: Update felixfbecker/language-server from v5.3.0 to v5.3.1 (#230) 2017-12-24 02:45:03 -08:00
Felix Becker 8a58743c58 ci(branches): only build on master 2017-12-23 14:30:28 -08:00
Felix Becker 7aebb777ce chore: remove bundled semantic-release/github dep 2017-12-23 14:27:40 -08:00
dependencies[bot] 4c93a9ff0a feat: Update felixfbecker/language-server from v5.2.0 to v5.3.0 (#229) 2017-12-23 14:26:50 -08:00
Felix Becker 294e4df2d2 docs: add signature help demo gif 2017-12-09 21:58:49 -08:00
Dependencies.io Bot ef25b8cf36 feat: Update felixfbecker/language-server from v5.1.2 to v5.2.0 2017-12-09 21:58:49 -08:00
Felix Becker 35999fa16e build(tsconfig): exclude vendor 2017-12-09 21:09:23 -08:00
dependencies[bot] fa97865c8f fix: Update felixfbecker/language-server from v5.1.1 to v5.1.2 (#219) 2017-12-03 22:04:02 -08:00
dependencies[bot] 6be3148dd2 fix: Update felixfbecker/language-server from v5.1.0 to v5.1.1 (#218) 2017-12-03 14:48:03 -08:00
dependencies[bot] 38dde53947 fix: Update phpdocumentor/reflection-docblock from 4.1.1 to 4.2.0 (#206) 2017-11-28 14:48:21 -08:00
Felix Becker c50bbb1633 ci(travis): always install node 2017-11-28 09:35:02 -08:00
Felix Becker 6a56007586 ci(travis): fix test stage 2017-11-28 09:29:44 -08:00
Felix Becker 766370ddf6 chore: update to semantic-release v11 2017-11-25 14:57:01 -08:00
Felix Becker bdd4a8b869 ci(release): update semantic-release config 2017-11-22 22:04:44 -08:00
Felix Becker d70664fd84 ci(release): use last-release-git-tag as a workaround 2017-11-22 17:09:59 -08:00
Felix Becker 0763f37e8a ci(release): use semantic-release v10 2017-11-22 16:46:18 -08:00
Felix Becker ad483b305a docs(readme): remove mentions of formatting 2017-11-20 09:07:06 -08:00
Felix Becker 9e9bd18083 docs(badges): workaround encoding issue 2017-11-18 18:42:57 -08:00
Felix Becker ddddf2a178 fix: always use a TCP socket instead of STDIO
STDIO locks up for large responses
2017-11-18 18:39:15 -08:00
Felix Becker a62996fe33 feat: update dependencies
Updates the language server to 5.2.0
 - Don't suggest <?php on > character in HTML
 - Properly resolve self, static, parent
 - Warn if $this is used in invalid contexts

BREAKING CHANGE:
This update removes the PHP CodeSniffer formatting support.
To get the same formatter back in VS Code, please install https://marketplace.visualstudio.com/items?itemName=ikappas.phpcs
See https://github.com/felixfbecker/php-language-server/issues/501 for details.
2017-11-18 18:18:53 -08:00
Felix Becker 77c0c8fe43 docs(badges): update badges 2017-11-04 17:08:31 -07:00
Felix Becker 4f25cc8f13 docs(readme): add note that language server is bundled 2017-11-03 14:17:10 -07:00
Felix Becker e01b4e9cae docs(badges): change badges 2017-11-03 14:15:48 -07:00
Felix Becker fbb1ee6632 chore: optimize package 2017-11-01 23:45:55 -07:00
Felix Becker 3cb3331cc9 ci(dependencies.io): use latest php-composer actor 2017-10-29 15:33:06 -07:00
Felix Becker bf45cc01fc ci(dependencies.io): set commit_message_prefix for npm dependencies 2017-10-29 15:32:39 -07:00
Felix Becker 7de29395df docs: add changelog that points to GitHub releases
closes #101
2017-10-29 15:25:03 -07:00
dependencies[bot] cbe345f05c fix: update felixfbecker/language-server from v4.6.3 to v4.6.4 (#166) 2017-10-29 13:44:14 -07:00
Felix Becker d336aee927 ci: determine last release from git tags 2017-10-28 14:55:17 -07:00
Felix Becker 9ad8a72ffb fix: update dependencies 2017-10-28 14:50:30 -07:00
Felix Becker 9ddacd94f0 ci: set BUILD_LEADER_ID for semantic-release 2017-10-28 14:50:30 -07:00
Felix Becker d293ba3323 ci(dependencies.io): receive PRs for indirect dependencies too (#165) 2017-10-23 14:10:47 -07:00
Felix Becker e3c59becae ci(dependencies.io): put commit_message_prefix under right key 2017-10-20 15:58:18 -07:00
Felix Becker 52e56a2973 chore(release): add semantic-release 2017-10-20 15:47:46 -07:00
Felix Becker a24cef4574 Pin language server version 2017-10-20 13:12:47 -07:00
Felix Becker 380b4776b0 Correct dependency name 2017-10-19 15:42:52 -07:00
dependencies[bot] f0a51c95ce Add dependencies.yml for dependencies.io (#162) 2017-10-19 15:34:33 -07:00
Felix Becker 1d402ed51b Update @types/mz 2017-10-19 15:04:21 -07:00
Felix Becker 61c2ae75d0 1.5.2 2017-10-19 14:53:20 -07:00
Felix Becker 48585c357b Update language server 2017-10-19 14:52:58 -07:00
Felix Becker 7bef21228c Update vscode version 2017-10-19 14:51:16 -07:00
Felix Becker 243ce61f21 Disable package-lock.json 2017-10-19 14:49:28 -07:00
25 changed files with 11295 additions and 1607 deletions

View File

@ -1,4 +1,3 @@
<!--
THERE IS A 99% CHANCE YOU ARE FILING THIS ISSUE IN THE WRONG REPOSITORY.

5
.gitignore vendored
View File

@ -1,7 +1,4 @@
out/
node_modules/
out/
vendor/
composer.lock
typings/
.DS_Store
package-lock.json

4
.prettierignore Normal file
View File

@ -0,0 +1,4 @@
package.json
package-lock.json
vendor/
out/

22
.prettierrc Normal file
View File

@ -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
}
}
]
}

View File

@ -1,7 +1,7 @@
language: php
php:
- '7.0'
- '7.1'
cache:
directories:
@ -9,29 +9,34 @@ cache:
- $HOME/.composer/cache
before_install:
- nvm install 6.5.0
- nvm use 6.5.0
- nvm install '12.4.0'
- nvm use '12.4.0'
install:
- npm install
- composer install --prefer-dist
- npm ci
script:
- npm run lint
- npm run build
# If build on a tag, publish a new release and upload vsix to the GitHub release
before_deploy:
- ./node_modules/.bin/vsce package
- ./node_modules/.bin/vsce publish -p $VSCE_TOKEN
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
deploy:
provider: releases
skip_cleanup: true
api_key:
secure: Jxe2EeDH4+pd4e/GhwUz+CQo5W4K7qBjdXQce9v+hUJZzoZgcwfkxZny0EWM53YyC6W8/10OZlo06KB2ZyiS90vYk9h0Wy5qva4le0m+ekW6u2YNexUd22z+9n6eKr5T+wzx60TTSHNLIprGyJfWyK5Q1vJbOzX0eBartXvu4NgXFakrBgykbur+8NwHQuZSAsiAnjooSTrVV+IJruCNti1ZhkVbwyjMMOzMvXU7y7wx2KZ30p0UL0S0/DbPRtfKJeLrLhkUYSVaxcoNsExVJaWKWrWiu8GZ6WBL0uryhSptobxllrFWH93ox0IDw2WGJNKMronGdxbafle20ILLK/q/0HN0QRa0h8dcFEerLyMSLOxF/dgdVVvlqockCC4/fISreTjrFAd8o0RLL+BIgfvrTmSsHJ0dD1sOVVO2ZnMmYOia0Ehex1wBBO2PXE+yHQBqwVjIEqPx5cwdO94Js1RCFiMaJmAEMaF1+JceWobwCsIpGyhsq3202XtnbPxHyi5o1IcsQWeMDdo2GsNozJgCMf8IuWB+z5jKa6Vlz92TXmGEPUAzTERHyGKNMKN9oHw0WhUkgFVt4dn1wMLGnFjy+BSrlmBzg4UCYT1LD2HYCkhQPrOgHGLiCBiBENoRCXOr/01mZpu16ibpJxMf114udtwA2TThHrmnRgWNXms=
file: php-intellisense-*.vsix
file_glob: true
on:
repo: felixfbecker/vscode-php-intellisense
tags: true
stages:
- test
- name: release
if: branch = master AND type = push AND fork = false
branches:
only:
- master
- /^renovate\/.+/

9
.vscode/launch.json vendored
View File

@ -7,9 +7,7 @@
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}"
],
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}/out"
@ -19,10 +17,7 @@
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test"
],
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test"],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}/out/test"

16
.vscode/settings.json vendored
View File

@ -1,10 +1,10 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
"typescript.tsdk": "./node_modules/typescript/lib" // we want to use the TS server from our node_modules folder to control its version
}
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
"typescript.tsdk": "./node_modules/typescript/lib" // we want to use the TS server from our node_modules folder to control its version
}

8
.vscode/tasks.json vendored
View File

@ -6,16 +6,12 @@
{
"type": "npm",
"script": "build",
"problemMatcher": [
"$tsc"
]
"problemMatcher": ["$tsc"]
},
{
"type": "npm",
"script": "watch",
"problemMatcher": [
"$tsc-watch"
]
"problemMatcher": ["$tsc-watch"]
}
]
}

View File

@ -1,9 +1,23 @@
.github/**
.vscode/**
typings/**
images/**
!images/logo.png
out/test/**
test/**
src/**
vendor/jetbrains/phpstorm-stubs/**
!vendor/jetbrains/phpstorm-stubs/PhpStormStubsMap.php
vendor/bin/**
**/.DS_Store
**/.editorconfig
**/.gitignore
**/.npmrc
**/.styleci.yml
**/.travis.yml
**/*.d.ts
**/*.map
.gitignore
tsconfig.json
tslint.json
**/appveyor.yml
**/dependencies.yml
**/jshintrc
**/phpunit.xml.dist
**/tsconfig.json
**/tslint.json

1
CHANGELOG.md Normal file
View File

@ -0,0 +1 @@
# See [GitHub releases](https://github.com/felixfbecker/vscode-php-intellisense/releases)

View File

@ -1,6 +1,6 @@
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
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,59 +1,77 @@
# PHP IntelliSense
[![Latest Release](https://vsmarketplacebadge.apphb.com/version-short/felixfbecker.php-intellisense.svg)](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense) [![Installs](https://vsmarketplacebadge.apphb.com/installs/felixfbecker.php-intellisense.svg)](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense) [![Rating](https://vsmarketplacebadge.apphb.com/rating-short/felixfbecker.php-intellisense.svg)](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense) [![Build Status](https://travis-ci.org/felixfbecker/vscode-php-intellisense.svg?branch=master)](https://travis-ci.org/felixfbecker/vscode-php-intellisense) [![Dependency Status](https://gemnasium.com/felixfbecker/vscode-php-intellisense.svg)](https://gemnasium.com/felixfbecker/vscode-php-intellisense) [![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.0-8892BF.svg)](https://php.net/) [![Gitter](https://badges.gitter.im/felixfbecker/vscode-php-intellisense.svg)](https://gitter.im/felixfbecker/vscode-php-intellisense?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![vs marketplace](https://img.shields.io/vscode-marketplace/v/felixfbecker.php-intellisense.svg?label=vs%20marketplace)](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense) [![downloads](https://img.shields.io/vscode-marketplace/d/felixfbecker.php-intellisense.svg)](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense) [![rating](https://img.shields.io/vscode-marketplace/r/felixfbecker.php-intellisense.svg)](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense) [![build](https://travis-ci.org/felixfbecker/vscode-php-intellisense.svg?branch=master)](https://travis-ci.org/felixfbecker/vscode-php-intellisense) [![php: >=7.0.0](https://img.shields.io/badge/php->=7.0-8892BF.svg)](https://php.net/) [![chat: on gitter](https://badges.gitter.im/felixfbecker/vscode-php-intellisense.svg)](https://gitter.im/felixfbecker/vscode-php-intellisense?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
Advanced PHP IntelliSense for Visual Studio Code.
**Note: This is just the VS Code extension that spawns the actual language server. The language server itself is implemented purely in PHP [in its own repository](https://github.com/felixfbecker/php-language-server), all features need to be implemented there and all issues should be reported there.**
**Note: This is just the VS Code extension that spawns the actual language server. The language server itself is implemented purely in PHP [in its own repository](https://github.com/felixfbecker/php-language-server), all features need to be implemented there and all issues should be reported there. You do NOT need to install it manually though, it is bundled in this extension.**
## Installation
You need at least PHP 7 installed for the extension to work. You can either add it to your PATH or set the `php.executablePath` setting.
You need at least PHP 7 installed for the extension to work. You can either add it to your PATH or set the `php.executablePath` setting.
I recommend to disable VS Code's built-in PHP IntelliSense by setting `php.suggest.basic` to `false` to avoid duplicate suggestions.
## Features
### Completion
![Completion search demo](images/completion.gif)
### Signature Help
![Signature help demo](images/signatureHelp.gif)
### Workspace symbol search
![Workspace symbol search demo](images/workspaceSymbol.gif)
### Find all References
![Find References demo](images/references.png)
### Go to Definition
![Go To Definition demo](images/definition.gif)
### Hover
![Hover class demo](images/hoverClass.png)
![Hover parameter demo](images/hoverParam.png)
### Find all symbols
![Find all symbols demo](images/documentSymbol.gif)
### Format code
![Format code demo](images/formatDocument.gif)
### Column-accurate error reporting
![Error reporting demo](images/publishDiagnostics.png)
### 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
- Rename
- Signature help
- Rename
- Signature help
## Contributing
Clone whole repository and in root directory execute:
```bash
composer install
composer install
npm install
npm run compile
npm run build
code .
```
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.

View File

@ -1,8 +1,13 @@
{
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"platform": {
"php": "7.1.0"
}
},
"require": {
"felixfbecker/language-server": "^4.6.0"
"felixfbecker/language-server": "5.4.6"
},
"scripts": {
"parse-stubs": "LanguageServer\\ComposerScripts::parseStubs",

864
composer.lock generated Normal file
View File

@ -0,0 +1,864 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "9c2828a729b23a2d11872a4acf98a8e5",
"packages": [
{
"name": "composer/xdebug-handler",
"version": "1.3.3",
"source": {
"type": "git",
"url": "https://github.com/composer/xdebug-handler.git",
"reference": "46867cbf8ca9fb8d60c506895449eb799db1184f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/xdebug-handler/zipball/46867cbf8ca9fb8d60c506895449eb799db1184f",
"reference": "46867cbf8ca9fb8d60c506895449eb799db1184f",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0",
"psr/log": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
},
"type": "library",
"autoload": {
"psr-4": {
"Composer\\XdebugHandler\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "John Stevenson",
"email": "john-stevenson@blueyonder.co.uk"
}
],
"description": "Restarts a process without xdebug.",
"keywords": [
"Xdebug",
"performance"
],
"time": "2019-05-27T17:52:04+00:00"
},
{
"name": "felixfbecker/advanced-json-rpc",
"version": "v3.0.4",
"source": {
"type": "git",
"url": "https://github.com/felixfbecker/php-advanced-json-rpc.git",
"reference": "23366dd0cab0a0f3fd3016bf3c0b36dec74348e7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/23366dd0cab0a0f3fd3016bf3c0b36dec74348e7",
"reference": "23366dd0cab0a0f3fd3016bf3c0b36dec74348e7",
"shasum": ""
},
"require": {
"netresearch/jsonmapper": "^1.0",
"php": ">=7.0",
"phpdocumentor/reflection-docblock": "^4.0.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0.0"
},
"type": "library",
"autoload": {
"psr-4": {
"AdvancedJsonRpc\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"ISC"
],
"authors": [
{
"name": "Felix Becker",
"email": "felix.b@outlook.com"
}
],
"description": "A more advanced JSONRPC implementation",
"time": "2019-09-12T22:41:08+00:00"
},
{
"name": "felixfbecker/language-server",
"version": "v5.4.6",
"source": {
"type": "git",
"url": "https://github.com/felixfbecker/php-language-server.git",
"reference": "1da3328bc23ebd6418529035d357481c8c028640"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/felixfbecker/php-language-server/zipball/1da3328bc23ebd6418529035d357481c8c028640",
"reference": "1da3328bc23ebd6418529035d357481c8c028640",
"shasum": ""
},
"require": {
"composer/xdebug-handler": "^1.0",
"felixfbecker/advanced-json-rpc": "^3.0.0",
"felixfbecker/language-server-protocol": "^1.0.1",
"jetbrains/phpstorm-stubs": "dev-master",
"microsoft/tolerant-php-parser": "0.0.*",
"netresearch/jsonmapper": "^1.0",
"php": "^7.0",
"phpdocumentor/reflection-docblock": "^4.0.0",
"psr/log": "^1.0",
"sabre/event": "^5.0",
"sabre/uri": "^2.0",
"webmozart/glob": "^4.1",
"webmozart/path-util": "^2.3"
},
"require-dev": {
"phpunit/phpunit": "^6.3",
"squizlabs/php_codesniffer": "^3.1"
},
"bin": [
"bin/php-language-server.php"
],
"type": "library",
"autoload": {
"psr-4": {
"LanguageServer\\": "src/"
},
"files": [
"src/utils.php",
"src/FqnUtilities.php",
"src/ParserHelpers.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"ISC"
],
"authors": [
{
"name": "Felix Becker",
"email": "felix.b@outlook.com"
}
],
"description": "PHP Implementation of the Visual Studio Code Language Server Protocol",
"keywords": [
"autocompletion",
"code",
"intellisense",
"language",
"microsoft",
"php",
"refactor",
"server",
"studio",
"visual"
],
"time": "2018-11-13T17:33:21+00:00"
},
{
"name": "felixfbecker/language-server-protocol",
"version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/felixfbecker/php-language-server-protocol.git",
"reference": "378801f6139bb74ac215d81cca1272af61df9a9f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/378801f6139bb74ac215d81cca1272af61df9a9f",
"reference": "378801f6139bb74ac215d81cca1272af61df9a9f",
"shasum": ""
},
"require": {
"php": "^7.0"
},
"require-dev": {
"phpstan/phpstan": "*",
"phpunit/phpunit": "^6.3",
"squizlabs/php_codesniffer": "^3.1"
},
"type": "library",
"autoload": {
"psr-4": {
"LanguageServerProtocol\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"ISC"
],
"authors": [
{
"name": "Felix Becker",
"email": "felix.b@outlook.com"
}
],
"description": "PHP classes for the Language Server Protocol",
"keywords": [
"language",
"microsoft",
"php",
"server"
],
"time": "2019-06-23T21:03:50+00:00"
},
{
"name": "jetbrains/phpstorm-stubs",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/JetBrains/phpstorm-stubs.git",
"reference": "f3a010af18f763091fe2182b16c041333ba6a7fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/JetBrains/phpstorm-stubs/zipball/f3a010af18f763091fe2182b16c041333ba6a7fb",
"reference": "f3a010af18f763091fe2182b16c041333ba6a7fb",
"shasum": ""
},
"require-dev": {
"nikic/php-parser": "^4",
"php": "^7.1",
"phpdocumentor/reflection-docblock": "^4.3",
"phpunit/phpunit": "^7"
},
"type": "library",
"autoload": {
"files": [
"PhpStormStubsMap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"description": "PHP runtime & extensions header files for PhpStorm",
"homepage": "https://www.jetbrains.com/phpstorm",
"keywords": [
"autocomplete",
"code",
"inference",
"inspection",
"jetbrains",
"phpstorm",
"stubs",
"type"
],
"time": "2019-09-18T14:39:59+00:00"
},
{
"name": "microsoft/tolerant-php-parser",
"version": "v0.0.18",
"source": {
"type": "git",
"url": "https://github.com/microsoft/tolerant-php-parser.git",
"reference": "e255aa978b45729094da2a1a6f9954044a244ff2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/microsoft/tolerant-php-parser/zipball/e255aa978b45729094da2a1a6f9954044a244ff2",
"reference": "e255aa978b45729094da2a1a6f9954044a244ff2",
"shasum": ""
},
"require": {
"php": ">=7.0"
},
"require-dev": {
"phpunit/phpunit": "^6.4"
},
"type": "library",
"autoload": {
"psr-4": {
"Microsoft\\PhpParser\\": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Rob Lourens",
"email": "roblou@microsoft.com"
}
],
"description": "Tolerant PHP-to-AST parser designed for IDE usage scenarios",
"time": "2019-07-01T02:21:00+00:00"
},
{
"name": "netresearch/jsonmapper",
"version": "v1.6.0",
"source": {
"type": "git",
"url": "https://github.com/cweiske/jsonmapper.git",
"reference": "0d4d1b48d682a93b6bfedf60b88c7750e9cb0b06"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/0d4d1b48d682a93b6bfedf60b88c7750e9cb0b06",
"reference": "0d4d1b48d682a93b6bfedf60b88c7750e9cb0b06",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-pcre": "*",
"ext-reflection": "*",
"ext-spl": "*",
"php": ">=5.6"
},
"require-dev": {
"phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4",
"squizlabs/php_codesniffer": "~1.5"
},
"type": "library",
"autoload": {
"psr-0": {
"JsonMapper": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"OSL-3.0"
],
"authors": [
{
"name": "Christian Weiske",
"role": "Developer",
"email": "cweiske@cweiske.de",
"homepage": "http://github.com/cweiske/jsonmapper/"
}
],
"description": "Map nested JSON structures onto PHP classes",
"time": "2019-08-15T19:41:25+00:00"
},
{
"name": "phpdocumentor/reflection-common",
"version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionCommon.git",
"reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a",
"reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"require-dev": {
"phpunit/phpunit": "~6"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"autoload": {
"psr-4": {
"phpDocumentor\\Reflection\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jaap van Otterdijk",
"email": "opensource@ijaap.nl"
}
],
"description": "Common reflection classes used by phpdocumentor to reflect the code structure",
"homepage": "http://www.phpdoc.org",
"keywords": [
"FQSEN",
"phpDocumentor",
"phpdoc",
"reflection",
"static analysis"
],
"time": "2018-08-07T13:53:10+00:00"
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "4.3.2",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e",
"reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e",
"shasum": ""
},
"require": {
"php": "^7.0",
"phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0",
"phpdocumentor/type-resolver": "~0.4 || ^1.0.0",
"webmozart/assert": "^1.0"
},
"require-dev": {
"doctrine/instantiator": "^1.0.5",
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^6.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.x-dev"
}
},
"autoload": {
"psr-4": {
"phpDocumentor\\Reflection\\": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mike van Riel",
"email": "me@mikevanriel.com"
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2019-09-12T14:27:41+00:00"
},
{
"name": "phpdocumentor/type-resolver",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9",
"reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9",
"shasum": ""
},
"require": {
"php": "^7.1",
"phpdocumentor/reflection-common": "^2.0"
},
"require-dev": {
"ext-tokenizer": "^7.1",
"mockery/mockery": "~1",
"phpunit/phpunit": "^7.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"phpDocumentor\\Reflection\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mike van Riel",
"email": "me@mikevanriel.com"
}
],
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"time": "2019-08-22T18:11:29+00:00"
},
{
"name": "psr/log",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd",
"reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"time": "2018-11-20T15:27:04+00:00"
},
{
"name": "sabre/event",
"version": "5.0.3",
"source": {
"type": "git",
"url": "https://github.com/sabre-io/event.git",
"reference": "f5cf802d240df1257866d8813282b98aee3bc548"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sabre-io/event/zipball/f5cf802d240df1257866d8813282b98aee3bc548",
"reference": "f5cf802d240df1257866d8813282b98aee3bc548",
"shasum": ""
},
"require": {
"php": ">=7.0"
},
"require-dev": {
"phpunit/phpunit": ">=6",
"sabre/cs": "~1.0.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Sabre\\Event\\": "lib/"
},
"files": [
"lib/coroutine.php",
"lib/Loop/functions.php",
"lib/Promise/functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Evert Pot",
"role": "Developer",
"email": "me@evertpot.com",
"homepage": "http://evertpot.com/"
}
],
"description": "sabre/event is a library for lightweight event-based programming",
"homepage": "http://sabre.io/event/",
"keywords": [
"EventEmitter",
"async",
"coroutine",
"eventloop",
"events",
"hooks",
"plugin",
"promise",
"reactor",
"signal"
],
"time": "2018-03-05T13:55:47+00:00"
},
{
"name": "sabre/uri",
"version": "2.1.3",
"source": {
"type": "git",
"url": "https://github.com/sabre-io/uri.git",
"reference": "18f454324f371cbcabdad3d0d3755b4b0182095d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sabre-io/uri/zipball/18f454324f371cbcabdad3d0d3755b4b0182095d",
"reference": "18f454324f371cbcabdad3d0d3755b4b0182095d",
"shasum": ""
},
"require": {
"php": ">=7"
},
"require-dev": {
"phpunit/phpunit": "^6"
},
"type": "library",
"autoload": {
"files": [
"lib/functions.php"
],
"psr-4": {
"Sabre\\Uri\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Evert Pot",
"email": "me@evertpot.com",
"homepage": "http://evertpot.com/",
"role": "Developer"
}
],
"description": "Functions for making sense out of URIs.",
"homepage": "http://sabre.io/uri/",
"keywords": [
"rfc3986",
"uri",
"url"
],
"time": "2019-09-09T23:00:25+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.12.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "550ebaac289296ce228a706d0867afc34687e3f4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4",
"reference": "550ebaac289296ce228a706d0867afc34687e3f4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.12-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"ctype",
"polyfill",
"portable"
],
"time": "2019-08-06T08:03:45+00:00"
},
{
"name": "webmozart/assert",
"version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4",
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4",
"shasum": ""
},
"require": {
"php": "^5.3.3 || ^7.0",
"symfony/polyfill-ctype": "^1.8"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^7.5.13"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3-dev"
}
},
"autoload": {
"psr-4": {
"Webmozart\\Assert\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bernhard Schussek",
"email": "bschussek@gmail.com"
}
],
"description": "Assertions to validate method input/output with nice error messages.",
"keywords": [
"assert",
"check",
"validate"
],
"time": "2019-08-24T08:43:50+00:00"
},
{
"name": "webmozart/glob",
"version": "4.1.0",
"source": {
"type": "git",
"url": "https://github.com/webmozart/glob.git",
"reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/glob/zipball/3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe",
"reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe",
"shasum": ""
},
"require": {
"php": "^5.3.3|^7.0",
"webmozart/path-util": "^2.2"
},
"require-dev": {
"phpunit/phpunit": "^4.6",
"sebastian/version": "^1.0.1",
"symfony/filesystem": "^2.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
}
},
"autoload": {
"psr-4": {
"Webmozart\\Glob\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bernhard Schussek",
"email": "bschussek@gmail.com"
}
],
"description": "A PHP implementation of Ant's glob.",
"time": "2015-12-29T11:14:33+00:00"
},
{
"name": "webmozart/path-util",
"version": "2.3.0",
"source": {
"type": "git",
"url": "https://github.com/webmozart/path-util.git",
"reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725",
"reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"webmozart/assert": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "^4.6",
"sebastian/version": "^1.0.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.3-dev"
}
},
"autoload": {
"psr-4": {
"Webmozart\\PathUtil\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bernhard Schussek",
"email": "bschussek@gmail.com"
}
],
"description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.",
"time": "2015-12-17T08:42:14+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "dev",
"stability-flags": [],
"prefer-stable": true,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"platform-overrides": {
"php": "7.1.0"
}
}

33
dependencies.yml Normal file
View File

@ -0,0 +1,33 @@
collectors:
- type: js-npm
path: /
actors:
# pull requests for new major versions
- type: js-npm
versions: 'Y.0.0'
settings:
# these updates should generally not have an effect on users
commit_message_prefix: 'chore: '
# 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,
# semantic-release will bundle a new patch or feature version of the extension
- type: php-composer
path: /
settings:
collect_transitive: true
actors:
- type: php-composer
versions: 'L.L.Y'
settings:
commit_message_prefix: 'fix: '
- type: php-composer
versions: 'L.Y.0'
settings:
commit_message_prefix: 'feat: '
- type: php-composer
versions: 'Y.0.0'
settings:
commit_message_prefix: 'chore: '

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

BIN
images/signatureHelp.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

11413
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -7,9 +7,9 @@
"license": "MIT",
"private": true,
"preview": false,
"version": "1.5.1",
"version": "1.5.4",
"engines": {
"vscode": "^1.13.0"
"vscode": "^1.26.1"
},
"keywords": [
"php",
@ -19,7 +19,7 @@
"refactor"
],
"categories": [
"Languages"
"Programming Languages"
],
"icon": "images/logo.png",
"galleryBanner": {
@ -38,26 +38,64 @@
"workspaceContains:**/*.php"
],
"main": "./out/extension",
"husky": {
"hooks": {
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS"
}
},
"scripts": {
"build": "tsc -p .",
"watch": "tsc -w -p .",
"postinstall": "node ./node_modules/vscode/bin/install",
"lint": "tslint -c tslint.json \"src/**/*.ts\""
"lint": "npm run prettier && npm run tslint",
"tslint": "tslint -p tsconfig.json -c tslint.json \"src/**/*.ts\"",
"prettier": "prettier '**/{*.{js?(on),ts,yml},.*.js?(on),.*.yml,.prettierrc,*.md}' --write --list-different",
"semantic-release": "semantic-release"
},
"devDependencies": {
"@types/mocha": "^2.2.42",
"@types/mz": "0.0.31",
"@types/node": "^8.0.24",
"@types/semver": "^5.3.34",
"tslint": "^5.0.0",
"typescript": "^2.1.4",
"vsce": "^1.8.1",
"vscode": "^1.0.0"
"@commitlint/cli": "7.2.1",
"@commitlint/config-conventional": "7.1.2",
"@types/execa": "0.9.0",
"@types/mocha": "5.2.7",
"@types/mz": "0.0.32",
"@types/node": "8.10.29",
"@types/semver": "6.2.0",
"husky": "1.1.3",
"prettier": "1.15.3",
"semantic-release": "15.10.8",
"semantic-release-vsce": "2.1.2",
"tslint": "5.11.0",
"tslint-config-prettier": "1.15.0",
"typescript": "3.1.6",
"vscode": "1.1.21"
},
"dependencies": {
"mz": "^2.4.0",
"semver": "^5.3.0",
"vscode-languageclient": "^3.0.3"
"execa": "1.0.0",
"mz": "2.7.0",
"semver": "6.3.0",
"vscode-languageclient": "5.1.1"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"release": {
"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": {
"configuration": {
@ -66,8 +104,8 @@
"properties": {
"php.memoryLimit": {
"type": "string",
"default": "-1",
"description": "The memory limit of the php language server. [Number][K|M|G]. Use '-1' to allow unlimited use of the RAM(default).",
"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 is 4G).",
"pattern": "^\\d+[KMG]?$"
},
"php.executablePath": {

41
renovate.json Normal file
View File

@ -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"
}
]
}

View File

@ -1,123 +1,137 @@
import * as path from 'path';
import { spawn, execFile, ChildProcess } from 'mz/child_process';
import * as vscode from 'vscode';
import { LanguageClient, LanguageClientOptions, StreamInfo } from 'vscode-languageclient';
import * as semver from 'semver';
import * as net from 'net';
import * as url from 'url';
import execa from 'execa'
import { ChildProcess, spawn } from 'mz/child_process'
import * as net from 'net'
import * as path from 'path'
import * as semver from 'semver'
import * as url from 'url'
import * as vscode from 'vscode'
import { LanguageClient, LanguageClientOptions, RevealOutputChannelOn, StreamInfo } from 'vscode-languageclient'
const composerJson = require('../composer.json')
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 executablePath = conf.get<string>('executablePath') || 'php';
const memoryLimit = conf.get<string>('memoryLimit') || '-1';
const memoryLimit = conf.get<string>('memoryLimit') || '4095M'
if (memoryLimit !== '-1' && !/^\d+[KMG]?$/.exec(memoryLimit)) {
const selected = await vscode.window.showErrorMessage(
'The memory limit you\'d provided is not numeric, nor "-1" nor valid php shorthand notation!',
'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)
let stdout: string;
let stdout: string
try {
[stdout] = await execFile(executablePath, ['--version']);
stdout = await execa.stdout(executablePath, ['--version'])
} catch (err) {
if (err.code === 'ENOENT') {
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',
'Open settings'
);
)
if (selected === 'Open settings') {
await vscode.commands.executeCommand('workbench.action.openGlobalSettings');
await vscode.commands.executeCommand('workbench.action.openGlobalSettings')
}
} else {
vscode.window.showErrorMessage('Error spawning PHP: ' + err.message);
console.error(err);
vscode.window.showErrorMessage('Error spawning PHP: ' + err.message)
console.error(err)
}
return;
return
}
// 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) {
vscode.window.showErrorMessage('Error parsing PHP version. Please check the output of php --version');
return;
vscode.window.showErrorMessage('Error parsing PHP version. Please check the output of php --version')
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
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')) {
vscode.window.showErrorMessage('The language server needs at least PHP 7 installed. Version found: ' + version);
return;
if (semver.lt(version, composerJson.config.platform.php)) {
vscode.window.showErrorMessage('The language server needs at least PHP 7.1 installed. Version found: ' + version)
return
}
const serverOptions = () => new Promise<ChildProcess | StreamInfo>((resolve, reject) => {
function spawnServer(...args: string[]): ChildProcess {
// The server is implemented in PHP
args.unshift(context.asAbsolutePath(path.join('vendor', 'felixfbecker', 'language-server', 'bin', 'php-language-server.php')));
args.push('--memory-limit=' + memoryLimit);
const childProcess = spawn(executablePath, args);
childProcess.stderr.on('data', (chunk: Buffer) => {
console.error(chunk + '');
});
childProcess.stdout.on('data', (chunk: Buffer) => {
console.log(chunk + '');
});
return childProcess;
}
if (process.platform === 'win32') {
// Use a TCP socket on Windows because of blocking STDIO
let client: LanguageClient
const serverOptions = () =>
new Promise<ChildProcess | StreamInfo>((resolve, reject) => {
// Use a TCP socket because of problems with blocking STDIO
const server = net.createServer(socket => {
// 'connection' listener
console.log('PHP process connected');
console.log('PHP process connected')
socket.on('end', () => {
console.log('PHP process disconnected');
});
server.close();
resolve({ reader: socket, writer: socket });
});
console.log('PHP process disconnected')
})
server.close()
resolve({ reader: socket, writer: socket })
})
// Listen on random port
server.listen(0, '127.0.0.1', () => {
spawnServer('--tcp=127.0.0.1:' + server.address().port);
});
} else {
// Use STDIO on Linux / Mac
resolve(spawnServer());
}
});
// The server is implemented in PHP
const childProcess = spawn(executablePath, [
context.asAbsolutePath(
path.join('vendor', 'felixfbecker', 'language-server', 'bin', 'php-language-server.php')
),
'--tcp=127.0.0.1:' + server.address().port,
'--memory-limit=' + memoryLimit,
])
childProcess.stderr.on('data', (chunk: Buffer) => {
const str = chunk.toString()
console.log('PHP Language Server:', str)
client.outputChannel.appendLine(str)
})
// childProcess.stdout.on('data', (chunk: Buffer) => {
// 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
const clientOptions: LanguageClientOptions = {
// Register the server for php documents
documentSelector: ['php'],
documentSelector: [{ scheme: 'file', language: 'php' }, { scheme: 'untitled', language: 'php' }],
revealOutputChannelOn: RevealOutputChannelOn.Never,
uriConverters: {
// VS Code by default %-encodes even the colon after the drive letter
// NodeJS handles it much better
code2Protocol: uri => url.format(url.parse(uri.toString(true))),
protocol2Code: str => vscode.Uri.parse(str)
protocol2Code: str => vscode.Uri.parse(str),
},
synchronize: {
// Synchronize the setting section 'php' to the server
configurationSection: 'php',
// 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.
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
// client can be deactivated on extension deactivation
context.subscriptions.push(disposable);
context.subscriptions.push(disposable)
}

View File

@ -4,7 +4,7 @@
//
// 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
// 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
suite('Extension Tests', () => {
// Defines a Mocha unit test
test('Something 1', () => {
assert.equal(-1, [1, 2, 3].indexOf(5));
assert.equal(-1, [1, 2, 3].indexOf(0));
});
});
assert.equal(-1, [1, 2, 3].indexOf(5))
assert.equal(-1, [1, 2, 3].indexOf(0))
})
})

View File

@ -10,13 +10,13 @@
// to report the results back to the caller. When the tests are finished, return
// 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
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
testRunner.configure({
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
useColors: true // colored output from test results
});
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
useColors: true, // colored output from test results
})
module.exports = testRunner;
module.exports = testRunner

View File

@ -1,14 +1,13 @@
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "out",
"lib": [
"es6"
],
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "out",
"esModuleInterop": true,
"lib": ["es6"],
"noImplicitAny": true,
"sourceMap": true,
"sourceMap": true,
"rootDir": "src",
"strictNullChecks": true,
"noImplicitThis": true,
@ -16,9 +15,6 @@
"noUnusedLocals": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false
},
"exclude": [
"node_modules",
"out"
]
},
"exclude": ["node_modules", "out", "vendor"]
}

View File

@ -1,43 +1,85 @@
{
"extends": ["tslint:recommended", "tslint-config-prettier"],
"rules": {
"class-name": true,
"comment-format": [true, "check-space"],
"indent": [true, "spaces"],
"no-eval": true,
"no-internal-module": true,
"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": [
"adjacent-overload-signatures": true,
"array-type": [true, "array"],
"arrow-return-shorthand": [true, "multiline"],
"await-promise": [true, "Thenable"],
"ban": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
"name": ["*", "forEach"]
},
["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",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace"
"destructuring": "all"
}
],
"variable-name": [true, "ban-keywords"],
"whitespace": [true, "check-branch", "check-decl", "check-operator", "check-separator", "check-type"],
"jsdoc-format": true,
"no-consecutive-blank-lines": true,
"one-variable-per-declaration": [true, "ignore-for-loop"],
"curly": true,
"no-empty": true,
"no-unused-expression": true,
"eofline": true,
"trailing-comma": [true, {"singleline": "never", "multiline": "never"}],
"align": [true, "parameters", "statements"]
"prefer-for-of": true,
"prefer-template": [false, "allow-single-concat"],
"return-undefined": true,
"triple-equals": [true],
"typedef": [true, "call-signature"],
"unified-signatures": true,
"variable-name": [true, "ban-keywords"]
}
}