vscode-woocommerce icon indicating copy to clipboard operation
vscode-woocommerce copied to clipboard

Intelliphense.?

Open MarkCanada opened this issue 3 years ago • 6 comments

Hi

I must be doing something wrong.? The autocomplete works, but Intelliphense shows the functions as not defined. What am I missing?

Thanks

MarkCanada avatar Sep 04 '22 22:09 MarkCanada

Same thing here, did you get it working?

ialtice-Regiowelt avatar Jan 29 '23 18:01 ialtice-Regiowelt

No 😒

MarkCanada avatar Jan 30 '23 02:01 MarkCanada

Any news on this?

anton-definit avatar Jan 31 '23 12:01 anton-definit

I am developing in a plugin folder in an active WordPress install and after a lot of research I now have a "settings.json" file in the ".vscode" folder in the plugin's folder and that file contains: { "intelephense.environment.includePaths": [ "../woocommerce" ] } If you are working in a workspace, the setting should be in the workspace file.

To set it up in the UI: File -> Preferences -> Settings Select "Workspace" and search for: "intelephense environment include paths" then "Add Item" "../woocommerce" If you are developing a theme, it would probably be "../../plugins/woocommerce" - I didn't test it, but I think that's what it should be.

...and this is in addition to this plugin...

MarkCanada avatar Feb 02 '23 21:02 MarkCanada

@MarkCanada I added

/Users/me/code/woocommerce-stubs

for intelephense environment include paths as path to WooCommerce stubs.

Screenshot 2024-01-18 at 08 04 22

Then I restarted VS Studio Code. Did however still see warnings like

Undefined method 'get_product_id'.intelephense(P1013)
Undefined method 'get_items'.intelephense(P1013)

Perhaps because the stubs are outside the project directory reading https://github.com/bmewburn/vscode-intelephense/issues/1798

jasperf avatar Jan 18 '24 01:01 jasperf