Skip to content

Fix header errors when parsed standalone #14272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2024

Conversation

iluuu1994
Copy link
Member

@iluuu1994 iluuu1994 commented May 19, 2024

This is annoying for multiple reasons:

  1. LSPs can show many errors for these files.
  2. LSP can stop parsing these files completely if there are too many errors, resulting in spotty LSP features.

On my machine, two debug build without ccache took 55s/56s for master, and 56s/56s for this branch, so it does not seem like it changed significantly.

@iluuu1994 iluuu1994 marked this pull request as ready for review May 19, 2024 23:11
@iluuu1994 iluuu1994 requested a review from dstogov as a code owner May 19, 2024 23:11
@iluuu1994 iluuu1994 requested review from Girgias and TimWolla May 19, 2024 23:11
Copy link
Member

@dstogov dstogov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see anything bad.
I'm not sure why do you need a separate header for zend_result...

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This is annoying for multiple reasons:

1. LSPs can show many errors for these files.
2. LSP can stop parsing these files completely if there are too many errors,
   resulting in spotty LSP features.
@iluuu1994 iluuu1994 force-pushed the fix-header-errors branch from 8bd45c3 to 5edc5e5 Compare May 20, 2024 16:33
@iluuu1994
Copy link
Member Author

I'm not sure why do you need a separate header for zend_result...

It reduced a few imports of zend_types.h. I reverted the change and include zend_types.h instead.

Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favor, but would like to point out this RFC: https://wiki.php.net/rfc/include_cleanup and this PR: #10609.

I believe there should be a more systematic approach than just making a few changes here and there when one notices the issues.

@iluuu1994
Copy link
Member Author

I'm aware of the RFC, but since it was declined, it doesn't seem sincere to make the same changes again. Another proposal might be more successful now, with less drama.

@iluuu1994 iluuu1994 merged commit 6335264 into php:master May 20, 2024
10 checks passed
@MaxKellermann
Copy link
Contributor

This PR adds forward declarations which was an idea I proposed in https://wiki.php.net/rfc/include_cleanup but was rejected by the majority of PHP developers, including @dstogov - now I wonder why he agreed with this PR ... ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants