Skip to content

Commit 0e79d49

Browse files
committed
Update changelog entry
1 parent 423950d commit 0e79d49

File tree

2 files changed

+3
-138
lines changed

2 files changed

+3
-138
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ vscode-php-phan NEWS
44
### 4.0.1 (2021-06-26)
55

66
- Update Phan from 4.0.4 to 4.0.7
7+
- See [Phan's NEWS](https://github.com/phan/phan/blob/4.0.7/NEWS.md) for more details.
78

89
### 4.0.0 (2021-04-17)
910

README.md

Lines changed: 2 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -2,146 +2,10 @@
22

33
[![Latest Release](https://vsmarketplacebadge.apphb.com/version-short/TysonAndre.php-phan.svg)](https://marketplace.visualstudio.com/items?itemName=TysonAndre.php-phan) [![Installs](https://vsmarketplacebadge.apphb.com/installs/TysonAndre.php-phan.svg)](https://marketplace.visualstudio.com/items?itemName=TysonAndre.php-phan) [![Rating](https://vsmarketplacebadge.apphb.com/rating-short/TysonAndre.php-phan.svg)](https://marketplace.visualstudio.com/items?itemName=TysonAndre.php-phan) [![Build Status](https://travis-ci.org/TysonAndre/vscode-php-phan.svg?branch=master)](https://travis-ci.org/TysonAndre/vscode-php-phan) [![Minimum PHP Version](https://img.shields.io/badge/php-%3E=7.2-8892BF.svg)](https://php.net/) [![Gitter](https://badges.gitter.im/phan/phan.svg)](https://gitter.im/phan/phan?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
44

5-
**Supports Unix/Linux, and Windows.**
6-
7-
## Features
8-
9-
+ Adds improved [error detection from Phan](https://github.com/phan/phan#features) to Visual Studio Code.
10-
+ Analyzes code while you're typing.
11-
+ Supports "Go to definition" and "Go to type definition"
12-
(Has some bugs when `pcntl` is unavailable)
13-
+ Supports code completion.
14-
+ Analyzes code while tolerating syntax errors.
15-
+ Suggests alternatives to mistyped elements (variables, constants, classes, class elements, etc.)
16-
17-
## Issue Tracker
18-
19-
**Note: This is just the [VS Code extension that spawns Phan](https://github.com/TysonAndre/vscode-php-phan). Phan is implemented purely in PHP [in its own repository](https://github.com/phan/phan),
20-
bugs in Phan analysis need to be fixed there and all issues should be reported [there](https://github.com/phan/phan/issues).**
21-
22-
However, bugs in this VS code extension (crashes, etc) or related to the language server protocol should be reported [in this extension's issue tracker](https://github.com/TysonAndre/vscode-php-phan/issues)
23-
24-
## Installation
25-
26-
### Dependencies:
27-
28-
1. PHP 7.2+ must be installed.
29-
You can either add it to your PATH or set the `phan.executablePath` setting.
30-
2. `pcntl` is recommended, but not absolutely necessary. (Available on Unix/Linux)
31-
(Phan's Language Server Protocol support depends on `pcntl` module being installed, which is only available on those platforms)
32-
33-
When running the Phan server without `pcntl`,
34-
Phan manually backs up, analyzes the requested files, then restores the server's state instead of forking to analyze, which may less reliably restore state than running the analysis in an independent process.
35-
3. (Optional) For optimal performance and accuracy of analysis,
36-
[the `php-ast` PECL extension](https://pecl.php.net/package/ast) should be installed and enabled.
37-
4. For guidance on how to set up a Phan project, please see [phan/phan](https://github.com/phan/phan),
38-
and the article [Getting Started](https://github.com/phan/phan/wiki/Getting-Started).
39-
40-
### Setup steps
41-
42-
This assumes you have already installed the [dependencies](#dependencies).
43-
44-
Add these entries to your VSCode config (Open the menu at File > Preferences > Settings)
45-
46-
47-
```javascript
48-
{
49-
// The path to a project folder which Phan will analyze
50-
// (or an array of 1 or more folders to independently analyze).
51-
// Each project folder must be the root of a Phan project,
52-
// and contain a .phan/config.php file with a Phan config for that project.
53-
// (including files to parse and analyze).
54-
// On windows, a project folder would be a path such as
55-
// "C:\\Users\\MyUser\\path\\to\\analyzed\\folder"
56-
"phan.analyzedProjectDirectory": "/path/to/folder/to/analyze",
57-
58-
// Limit events sent to the language server to those within `phan.analyzedProjectDirectory`
59-
// where possible.
60-
// Useful when multiple directories are analyzed (e.g. fixes issues with hover flickering).
61-
// "phan.useRelativePatterns": true,
62-
63-
// Path to a php 7.2+ binary
64-
// (preferably with the php-ast PECL extension installed and enabled)
65-
// This should be as similar as possible as the php installation used to run Phan
66-
// (Same php minor version,
67-
// same extensions or phan internal stubs for extensions (excluding xdebug), etc.)
68-
// On windows, this would be "C:\\path\\to\\php-7.2-installation\\php.exe"
69-
"phan.phpExecutablePath": "/path/to/php7.2",
70-
71-
// Optionally, enable unused variable detection
72-
// (off by default. This can also be enabled in `.phan/config.php`
73-
// by `"unused_variable_detection" => true,`)
74-
"phan.unusedVariableDetection": true,
75-
76-
// Files which this should analyze (e.g. "php", "html", "inc")
77-
"phan.analyzedFileExtensions": ["php"],
78-
79-
// Optional. Setting this will provide these additional CLI flags to the Phan server.
80-
// See https://github.com/phan/phan#usage (e.g. `["--quick"]`)
81-
// "phan.additionalCLIFlags": []
82-
}
83-
```
84-
85-
**After adding these entries, close and re-open Visual Studio Code in order for Phan to pick up the new settings.**
86-
87-
If you have issues, see the [Troubleshooting section](#troubleshooting)
88-
89-
## Examples
90-
91-
### Error Detection
92-
93-
![Phan error detection demo](https://raw.githubusercontent.com/TysonAndre/vscode-php-phan/master/images/error_detection.png)
94-
95-
Phan's capabilities are summarized in [Phan's README](https://github.com/phan/phan#features)
96-
97-
### Error Detection (Tolerating Syntax Errors)
98-
99-
![Phan error tolerant detection demo](https://raw.githubusercontent.com/TysonAndre/vscode-php-phan/master/images/tolerant_parsing.png)
100-
101-
Enabled by default. To disable this, set the setting `phan.useFallbackParser` to `false` (also requires disabling `phan.enableCompletion`)
102-
103-
### Go To Definition
104-
105-
+ Supports "Go to definition" for properties, classes, global/class constants, and methods/global functions
106-
+ Supports "Go to type definition" for variables, properties, classes, and methods/global functions
107-
108-
This is enabled by default. To disable this, add `"phan.enableGoToDefinition": false` in your `config.json` settings.
109-
110-
### Hover
111-
112-
+ Supports hover text for generating descriptions of references to classes, properties, methods, constants, functions, etc.
113-
+ Supports hover text for the union types of variables.
114-
115-
This is enabled by default. To disable this, add `"phan.enableHover": false` in your `config.json` settings.
116-
117-
If hovering flickers (with or without showing hover text), increasing the hover delay may fix this (e.g. set it to `"editor.hover.delay": 2000`)
118-
Also, make sure that the setting `"phan.useRelativePatterns"` is `true` (this is the default), if multiple directories are in `phan.analyzedProjectDirectory`.
119-
120-
### Completion
121-
122-
This will complete references to the following element types:
123-
124-
+ global constants, global functions, and class names.
125-
+ class constants, and instance and static method names.
126-
+ variables.
127-
+ instance and static properties.
128-
129-
This is enabled by default. To disable this, add `"phan.enableCompletion": false` in your `config.json` settings.
130-
131-
See [VS Code's documentation of Intellisense](https://code.visualstudio.com/docs/editor/intellisense#_intellisense-features) for how completions work in general.
132-
133-
See [VS Code's documentation of IntelliSense configuration](https://code.visualstudio.com/docs/editor/intellisense#_customizing-intellisense)
134-
for how to control when/how suggestions show up.
135-
136-
You may want to disable VS Code's built-in IntelliSense for PHP by setting `php.suggest.basic` to `false`, to avoid duplicate suggestions.
137-
138-
## Contributing
139-
140-
## Release History
141-
142-
### 4.0.1 (2021-06-26)
5+
4.0.1 (2021-06-26)
1436

1447
- Update Phan from 4.0.4 to 4.0.7
8+
- See [Phan's NEWS](https://github.com/phan/phan/blob/4.0.7/NEWS.md) for more details.
1459

14610
### 4.0.0 (2021-04-17)
14711

0 commit comments

Comments
 (0)