Theia: files.associations is breaking PHP features and probably affecting other languages too

Created on 11 May 2020  路  8Comments  路  Source: eclipse-theia/theia

Bug Description:

During my tests I have found that when I add file.associations to the settings.json file, the PHP language features are gone and the syntax highlighting stops working, the association with other extensions (.inc) to the PHP language doesn't work too.

Steps to Reproduce:

  1. test using one of the following approaches:

    • theia-php:latest:



      • docker pull theiaide/theia-php


      • docker run -it --init -p 3000:3000 theiaide/theia-php



    • use this repo and include the following extensions:

"vscode-builtin-php": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/php-1.39.1-prel.vsix",
"vscode-builtin-php-language-features": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/php-language-features-1.39.1-prel.vsix",
"vscode-php-intellisense": "https://github.com/felixfbecker/vscode-php-intellisense/releases/download/v2.3.5/php-intellisense.vsix",
"vscode-php-debug": "https://github.com/felixfbecker/vscode-php-debug/releases/download/v1.13.0/php-debug.vsix"
  1. open a php project or file (notice that syntax-highlighting works correctly)
  2. add the following file.associations preference (save):
{
  "files.associations": {
    "*.php": "php",
    "*.gitignore": "php"
  }
}
  1. reload the application and re-open the php file, the syntax-highlighting stops working

Additional Information

Working without file.associations:
image

Not working with file.associations:
image


bug php

All 8 comments

I attempted to reproduce the problem in this repo by including the extensions
(taken from theia-php):

"vscode-builtin-php": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/php-1.39.1-prel.vsix",
"vscode-builtin-php-language-features": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/php-language-features-1.39.1-prel.vsix",
"vscode-php-intellisense": "https://github.com/felixfbecker/vscode-php-intellisense/releases/download/v2.3.5/php-intellisense.vsix",
"vscode-php-debug": "https://github.com/felixfbecker/vscode-php-debug/releases/download/v1.13.0/php-debug.vsix"

I was unable to reproduce the problem, and adding associations to php also worked correctly:

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

I'll need to verify if the behavior in the image is also consistent.

Screen Shot 2020-05-11 at 12 31 18 PM

@joazvsoares I am unable to reproduce the issue on the docker image theia-php as well.

@vince-fugnitto it only stops working for me after I change the preferences and reload the page, could you try that?

@vince-fugnitto it only stops working for me after I changed the preferences and reloaded the page, could you try that?

I see the issue now (after reloading), I'll update the issue to be a bit clearer :)

Sorry, I should have mentioned that step in the description! Thank you!

Hi @akosyakov @vince-fugnitto
I can try to help on this one if I get some hints on what could be causing the issue, is there any guess?

trying to investigate...

@vince-fugnitto btw why we don't have vscode-builtin-php by default in our example applications, we should have as much as possible, do you know whether we excluded something else?

I think it is caused by https://github.com/eclipse-theia/theia/issues/5017, i.e. on reload:

  • an editor for .gitignore is opened as plain text first
  • then languages are applied but they do nothing since .gitingore is not covered for php
  • then associations are applied but they do nothing because of https://github.com/eclipse-theia/theia/issues/5017

I will send a PR. It is a bit tricky since we have to trigger internal Monaco event.

Was this page helpful?
0 / 5 - 0 ratings