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

[php] Build 3114 syntax highlighting misses keywords #410

Closed
danielbachhuber opened this issue May 19, 2016 · 4 comments
Closed

[php] Build 3114 syntax highlighting misses keywords #410

danielbachhuber opened this issue May 19, 2016 · 4 comments
Labels

Comments

@danielbachhuber
Copy link

Here are some keywords that are missing for me:

Build 3114:

image

$bits = explode( '/', $assoc_args['name'] );
if ( 2 !== count( $bits ) || empty( $bits[0] ) || empty( $bits[1] ) ) {
    WP_CLI::error( "'{$assoc_args['name']}' is an invalid package name. Package scaffold expects '<author>/<package>'." );
}

image

<?php

namespace WP_CLI;

use WP_CLI;
use WP_CLI\Process;
use WP_CLI\Utils;

Build 3013:

image

image

Originally #389 (comment)

@wbond
Copy link
Member

wbond commented May 19, 2016

The scopes changes since 3103 since the PHP syntax has been heavily refactored to support new syntax and better handle various constructs.

I've confirmed that error in WP_CLI::error() is getting the correct scopes. The most specific part is:

meta.function-call.static variable.function

In the use statements example, the identifiers are getting the correct scopes also. When use is encountered, it is unknown if the path ends in a namespace, or a class name. Thus, we don't highlight the final identifier with any specific scope. However, namespace names preceding the final identifier do have the scope support.other.namespace.

I'd be open to ideas on how to handle the ambiguity of scoping namespace/class names in a use statement.

@wbond wbond added the question label May 19, 2016
@wesbos
Copy link

wesbos commented May 30, 2016

Hey - does this mean that my theme should be updated? It's not an error on the highlighter side, but the theme should handle the new scope?

@wbond
Copy link
Member

wbond commented Jun 1, 2016

@wesbos Yes, some of the scope names have changed as we are making things more consistent. If you want to retain the same colors as before for the tokens in the screen shots, I believe your color scheme will need a few tweaks. I believe the advice from @FichteFoll at wesbos/cobalt2#104 should help in getting the colors back to where they were before.

@wbond
Copy link
Member

wbond commented Jul 22, 2016

I don't believe there is anything to be done here, closing.

@wbond wbond closed this as completed Jul 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants