PHP syntax highlighting not working

What would be the best way to debug Theia and check why PHP syntax highlighting is not working?

I have the following message in the console log:


logger-protocol.ts:112 root INFO [03c23b5d-6d11-4879-abda-70b99732f0c5][vscode.php]: Loaded contributions.
logger-protocol.ts:112 root INFO [03c23b5d-6d11-4879-abda-70b99732f0c5][vscode.php-language-features]: Loaded contributions.

logger-protocol.ts:112 root INFO [03c23b5d-6d11-4879-abda-70b99732f0c5][felixfbecker.php-debug]: Loaded contributions.
logger-protocol.ts:112 root INFO [03c23b5d-6d11-4879-abda-70b99732f0c5][felixfbecker.php-intellisense]: Loaded contributions.
logger-protocol.ts:112 root INFO [03c23b5d-6d11-4879-abda-70b99732f0c5] Load contributions of 26 plugins took: 173.0 ms

logger-protocol.ts:112 root WARN Error: ‘php’ language is remapped from ‘source.php’ to ‘text.html.php’ scope
at e.mapLanguageIdToTextmateGrammar (https://mytheia.cloud/bundle.js:14:249262)
at https://mytheia.cloud/bundle.js:14:895862
at A (https://mytheia.cloud/bundle.js:14:893687)
at https://mytheia.cloud/bundle.js:14:895791
logger-protocol.ts:112 root WARN Error: a registered grammar configuration for ‘php’ language is overridden
at e.registerGrammarConfiguration (https://mytheia.cloud/bundle.js:14:249933)
at https://mytheia.cloud/bundle.js:14:895986
at A (https://mytheia.cloud/bundle.js:14:893687)
at https://mytheia.cloud/bundle.js:14:895907

And my package.json looks like this:

https://paste.ofcode.org/UKBNgKGbN3cT3ZTq5Dn53m

[original thread by jvsoares]

Seems to come from textmate-registry.ts, which is browser-side: just open the developer tools in your browser and set a breakpoint. Or is that not the question?

Syntax highlighting should come from vscode.php. Does it work if you remove all other php extensions?

I think it happens when many extensions trying to contribute to the same language.

btw https://github.com/bmewburn/vscode-intelephense seems to work better, you have to remove php-language-feature and php-intellisense

[jvsoares]

@tsmaeder The issue is more related to the PHP support, but thanks!

@anton-kosyakov After many tests I have found that PHP capabilities stop working if you add the following to your settings.json file:

"files.associations": { 
    "*.php": "php"
}

I know it sounds weird but you can try yourself with this docker image https://github.com/theia-ide/theia-apps/tree/master/theia-php-docker

[jvsoares]

[jvsoares]

[jvsoares]

I have filed an issue https://github.com/theia-ide/theia-apps/issues/357

it sounds like a bug