nikic / scalar_objects

Extension that adds support for method calls on primitive types in PHP
MIT License
1.13k stars 44 forks source link

Feature Request: IDE Support(as plugin maybe)? #38

Open HallofFamer opened 4 years ago

HallofFamer commented 4 years ago

I heard from PHP Reddit that Nikita is now hired to for Jetbrains. Its excellent news, and I wonder if it is possible to bring IDE support for scalar objects? A straight forward idea would be to make it as a PHP Storm plugin? Is this doable?

still-dreaming-1 commented 3 years ago

Another approach might be to get Psalm to recognize the "methods". Not sure if this would require writing a Psalm plugin or if there is a simpler way. After that, the Psalm provided LSP support might recognize these "methods". Then any IDE or editor you use that you successfully integrate with the Psalm provided LSP should then support scalar objects. I will let you know what I find out if I ever try this.

still-dreaming-1 commented 3 years ago

I have had a chance to experiment with this a little, very little. Currently, as a user of this php extension and Psalm, there is no way to get Psalm to understand these functions. I still don't know if writing a Psalm plugin is a way to get this to work or if Psalm itself would have to support this extension. I tried writing my own Psalm plugin as an experiment, but I failed to get it to do anything at all, let alone something along these lines.