This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is bigger update since all of these changes are done on the same parts of code and they are dependent on each other, so it's hard to separate them to individual PRs.
Don't be overwhelmed by long change list (I'm a bit pedantic), many points are the result of one fix/change, but code changes are rather straight forward.
Description of the Change
added
mixedtype (PHP 8.0)statictype in method's return (PHP 8.0)meta.function.parameter.variadic.phpsince this is unique parameter without default value, token could be more useful than removedarrayvariantfixed
$in a parameters (only one is allowed)support.class.phpinstead ofstorage.type.php. Fixes Inconsistent primitive typehint tokenization #387, PHP class and primitive type function parameters scoped and highlighted identically microsoft/vscode#95029meta.function.closure.use.phpwidened to wholeusestatementchanged
removed
meta.function.parameter.array.phpandinvalid.illegal.non-null-typehinted.php- problematic with union types (since 8.0), broken by constant expressions in default value (since 5.6) and logic errors should be checked by intellisense anyway. Also fixes Default array value syntax error with class constants #363 and Coloring/Highlighting Issues for Exceptions and Constants in PHP #390 2nd pointstorage.type.phpfor namespace name in namespaced class reference - probably added by mistake in 2 places (one by me, sorry)test spec
false)mixedtypestaticreturn type in methodsAlternate Designs
meta.function.parameter.type.phpandmeta.function.return.type.php(type/typehint) for whole type hint (union, nullable). Could be useful, but feedback is needed.parent,self,staticprobably should be changed fromstorage.type.phptosupport.class.parent.phporkeyword.other.parent.phpor something like this.meta.function.php, maybe this should be changed tometa.function.method.phpormeta.method.phpparameter-default-typescan be changed to$self, but more tests are needed.Possible Drawbacks
This update will break PR #389, but at the same time fixes original problem making mentioned PR not needed anymore.
There may be some coloring changes, but all should be improvements, rather than degradation.
Applicable Issues
PHP 8.0 update log: #395
fix #363 fix #387 fix microsoft/vscode#95029
closes #389
partially #390 (point 2)