[Workaround] Nuclide should identify PHP files as php not hack


#1

Nuclide is incorrectly identifying and providing hack syntax highlighting for my PHP files.

I do not use hack at present.

I can manually change the language type but this is annoying.

How do I fix this?


#2

You can override Atom’s language recognition with a config.cson entry.


#3

Cool - thanks! :slight_smile:

I tried making the correct? entry but Nuclide seems to be still insisting that my php is hack.

I understand the fact that php is generally legal hack but identifying a xxxxxx.php file as hack is incorrect.


#4

Please screenshot your config.cson and post that.

The language-hack package is telling Atom that php is one of its file extensions. If that’s incorrect, you should submit an issue at the package repo to get it changed.


#5

Apoligies - seems I did not correctly make the config.cson change -

following IS working for me:

        ]
      core:
        customFileTypes:
         --snip --
          "text.html.php": [
            "php"
          ]
          "source.python": [
            "BUCK"
          ]
        disabledPackages: [
          "symbols-view"
          "emmet"

Thanks for your help!


#6

For future reference, you should fence CSON in code tags to preserve the indentation, or post a screenshot of the file. We can’t accurately diagnose issues if we can’t see the indentation.


#7

Done above for future readers…