marlonfan / coc-phpls

🐭 php language server for coc.nvim
MIT License
212 stars 16 forks source link

Any way to add stubs for Wordpress? #39

Closed willdavidow closed 4 years ago

willdavidow commented 4 years ago

I'm having a little difficulty figuring out whether or not there's a way to add stubs for Wordpress development?

I noticed this repository mentioned in an issue in the intelephense repo: https://github.com/php-stubs/wordpress-stubs but I'm having trouble figuring out whether or not it's possible to somehow include this in my COC configuration to prevent/stop intelephense errors on Wordpress built-in functions.

Screen Shot 2019-12-08 at 10 00 40 PM
willdavidow commented 4 years ago

I'm not 100% sure how definitions and sources are gathered by LSP's but this appears to be working just fine now without any configuration change on my end.

Screen Shot 2019-12-12 at 11 59 10 AM

Closing this for now since my question appears to have resolved itself.

wanecek commented 3 years ago

FWIW: I stumbled across the same issue. One solution is to get the raw wordpress-stubs.php-file from https://github.com/GiacoCorsiglia/wordpress-stubs, and put it anywhere in the project directory. Intelliphense will pick it up when indexing, and this will stub the methods. When doing so, one may want to include it in your (global) gitignore as well.