bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.61k stars 94 forks source link

wp_admin_notice isn't recognized as a function #2839

Closed jakeparis closed 3 months ago

jakeparis commented 6 months ago

Describe the bug wp_admin_notice(), which was added in WordPress 6.4 (Nov 2023), isn't recognized by this plugin as a valid function.

On the other hand, I wonder if there's something unusual going on with the WordPress developer documentation page for that function, because the function doc also doesn't show up on https://devdocs.io/wordpress/.


To Reproduce

  1. Ensure that "wordpress" is added to the intelephense stubs setting.
  2. Open a php file and type <?php wp_admin_notice();.

Expected behavior The wp_admin_notice function is NOT marked as unrecognized.

Screenshots Screenshot 2024-04-03 at 10 58 24 AM

Platform and version Mac OSX, Intelephense plugin version v1.10.4

theenoahmason commented 4 months ago

@jakeparis - I am getting the same problem, wp_admin_notice was added at WP 6.1. I am also getting the same issue with is_login which was added at WP 6.4.

Both of these are included in the wordpress stubs package, which I THINK is how intellephense gets its stubs? https://github.com/php-stubs/wordpress-stubs

@bmewburn How do we update stubs packages? How does intelephense update stubs for included settings like "wordpress"?

bmewburn commented 4 months ago

@theenoahmason they can be placed somewhere in your workspace or placed in an external folder and that folder linked to with intelephense.environment.includePaths. wordpress should be removed from intelephense.stubs if you are providing your own

theenoahmason commented 4 months ago

@bmewburn I'd like to not provide my own if possible, it has been working beautifully. Its just missing at least 2 functions and would love to have these covered.

Is it simply that the extension is shipping with out of date stubs? Is there some sort of update cadence? New WordPress functions and methods will be periodically added to core and I'm just trying to figure out how I should keep up with it.

Any suggestions besides just shipping my own?

bmewburn commented 3 months ago

stubs will be updated in 1.11