Skip to content
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

Doesn't play nice with PHP files #41

Open
mallardduck opened this issue Jan 16, 2019 · 2 comments
Open

Doesn't play nice with PHP files #41

mallardduck opened this issue Jan 16, 2019 · 2 comments

Comments

@mallardduck
Copy link
Contributor

mallardduck commented Jan 16, 2019

Description

When this package is enabled it overrides the outline view for PHP based files. Sometimes this is ok, when the PHP file is mostly HTML with inlined PHP (i.e. WordPress template files).

However, it outright breaks PHP files that are only PHP. So when working on PHP package development ide-html would have to be disabled. For PHP classes such as SslCertificate.php it just shows a single item ? and overrides ide-php or orther php parsers for Atom.

Expected Behavior

For PHP files that are mostly HTML with inline PHP, it would be best for the outline to just show something like <?php indicating that there's a block of php code. Basing the depth on the surrounding HTML.

For PHP files that are only PHP code - ideally the outline will just come from the ide-php or ide-seranata package and not be affected by the this one.

Visual Examples:
The real outline of an all PHP walker-nav file:
walker-nav-real-outline

And a mock up of the mostly HTML template file:
screen shot 2019-01-28 at 7 38 11 am
Note: Image adjusted to 'fix' the current issue being described.

Actual Behavior

See images here:

This an all PHP file, same one as above:
walker-nav-outline

And this is from the common header.php file for wordpress themes:
screen shot 2019-01-28 at 7 34 31 am
The only issue being that the PHP tags included add artficial depth to the a.brand-text tag. And that they could potentially be better represented by <?php rather than ?.

Possible Fix

Make PHP an optional extension to outline for - or improve interop with other ide-* parsers though that may not be as realistic. I'm not very familiar with Atom APIs so I'm not sure if such interop is possible.

Steps to Reproduce

  1. Have ide-html enabled.
  2. Open a .php file
  3. Try to use outline.

Context

In order to properly debug real PHP files of any type I have to disable ide-html. Even in the PHP packages I maintain such as mallardduck/ssl-certificate.

Your Environment

@mallardduck
Copy link
Contributor Author

Just realized that the mockup I created didn't actually get uploaded correctly. I'll try to dig up the correct file and replace the image.

@mallardduck
Copy link
Contributor Author

OP comment updated with new images for WordPress header.php examples.

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

No branches or pull requests

2 participants