Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: added support for generics #5

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open

WIP: added support for generics #5

wants to merge 61 commits into from

Conversation

i582
Copy link
Contributor

@i582 i582 commented Mar 14, 2022

Generics support

At the moment, new generics are being developed in KPHP, which will become much more convenient and will also be applicable to classes, which will make developing in KPHP more convenient and safer.

However, when it comes to generic support in PhpStorm, we see a sad picture, the current support does not suit us and we want to have full control over the syntax and features of generics.

It is also worth considering that without support in the IDE, generics in KPHP will not be super convenient, any development with them will be accompanied by inconveniences, since the IDE simply will not understand them.

For example, if the IDE does not know that there is a link to the class in the comments or in the phpdoc, then when renaming, we will get an invalid link due to which KPHP will not be able to compile the code.

Therefore, we decided to try to make our own implementation and this PR for the moment adds initial support for generics for functions. Adding support for classes is planned for later, when issues with generics for functions are resolved.

Description of generics will be added a bit later.

@i582 i582 added the enhancement New feature or request label Mar 14, 2022
…ject language

- Added intention to collapse generics instantiation comments
- IDE version has been updated to 2022.1.1, as there is a bug in 2022.1 due to which KphpStormASTFactory does not work
@i582 i582 added the generics Everything related to generics label May 26, 2022
i582 added 9 commits May 30, 2022 07:07
- fixed type compatibility for a callable and a typed callable
- fixed default types handling
- improved handling for union instantiations for methods and fields
- generic hint now contains only "<T>"
- fixed InstantiationParamsCount inspection
- fixed callable and string type compatibility
- fixed support for new 2022.2 int<X,Y> type
- fixed cases with any
- added KPHP tests
- added more comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request generics Everything related to generics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant