php-stubs / wordpress-stubs

Up-to-date WordPress function and class declaration stubs for static analysis by PHPStan
https://packagist.org/packages/php-stubs/wordpress-stubs
MIT License
151 stars 19 forks source link

Remove 70,000 lines #194

Closed johnbillion closed 4 months ago

johnbillion commented 4 months ago

Here's a radical proposal. If these stubs are only used for static analysis then we only need the relevant machine-readable data in the docblocks. Everything else -- including the descriptions -- can go.

This removes 70,000 lines from the stubs file.

What do you think? This is a big win but it also means the stubs are less useful for tools which provide features other than static analysis, for example an IDE.

johnbillion commented 4 months ago

This needs some more work (for example it's currently wiping out some tags and docblocks that need to be retained). Happy to continue with it if it's a path we want to go down.

szepeviktor commented 4 months ago

What non-tag parts of the docblock does IDE auto completion display?

johnbillion commented 4 months ago

What non-tag parts of the docblock does IDE auto completion display?

Potentially the description.

IanDelMar commented 4 months ago

but it also means the stubs are less useful for tools which provide features other than static analysis, for example an IDE.

I think that people are using the stubs for descriptions in IDEs.

szepeviktor commented 4 months ago

I think that people are using the stubs for descriptions in IDEs.

Do you do that?

IanDelMar commented 4 months ago

I think that people are using the stubs for descriptions in IDEs.

Do you do that?

I haven't used the stubs for this purpose, but I do find it convenient.

johnbillion commented 4 months ago

This was an interesting exercise but I don't think I want to spend more time on it and it still needs a lot more work. Cheers!