Intermittent PHP syntax highlighting issue


#1

Still getting same issue in Atom 1.0.

But I wondering why sometimes it works and something doesn’t :frowning:


PHP syntax not being highlighted
#2

What issue is that? As far as I can tell this is your first post.


#3

The above was a theme issue related to Atom Dark. If you’re seeing the same thing, can you switch the theme and see if that fixes it?
If it’s not the same thing, could you open a new thread, or better yet an issue on the relevant repo?


#4

I mean, I’m using Atom 1.0 with One Dark theme and occasionally php syntax is not being highligted


#5

It sounds like it isn’t the same issue as what you were replying to. It sounds like what you’re running into is this known issue:


#6

Yes it is.

I’ve tried using monokai, but like I said it sometime not being highlighted. See it doesn’t work

But, after trying to restart and it works :sweat:

What’s the real problem here…?


#7

I don’t know … is it being recognized as PHP? The Settings View was focused, so I couldn’t see the grammar selector in your screenshot.


#8

Yes! it recognized as PHP. Sorry for the focus…

Just try to restart it again and not working again :sweat_smile:


#9

Can you try completely exiting Atom and starting it in Safe Mode using atom --safe?


#10

Tried 5x times and it seems works using atom --safe

So, what’s the problem?


#11

That means that some other package you have installed is breaking the PHP syntax highlighting.


#12

Well, I’ll try to resintall it and will give result each time i install a plugin.


#13

You can disable packages too instead of uninstalling them.


#14

I know, but I love my way :smile:


#15

It will really depend on which package is messing with you here.
Could it be you have two packages installed that interfere with each other, e.g. both trying to do something with the PHP file syntax or something?


#16

I found it! Plugin that causing this problem is language-vue-component.

Thanks for advising me guys. :smile:

Edit: typo (I have poor english btw) :sweat_smile:


#17

I’m facing this intermittent PHP syntax highlighting issue too.

I’m using v1.0.0. with the default “one dark” theme. I’ve not installed any packages.

Contrary to what has been said elsewhere in this forum, PHP syntax highlighting is NOT dependent on:

  1. the presence of <!DOCTYPE> or any other HTML in the file
  2. restarting Atom
  3. starting Atom in --safe mode

Can someone provide a definitive answer for what is going on here?


#18

I figured it out. Some of my .php files always got syntax highlighting, and others pretty much never did. The ones that didn’t work didn’t have <?php ?> at the top of the page. You don’t need to put any PHP in the tags but make sure the tags are there before and it’ll work every time! :smile:


#19

Make sure you have PHP tags at the top of your page before even if they’re empty. Just this: <?php ?> is all you need to make sure it highlights all your PHP.