Home Download Buy Blog Forum Support

Can't set syntax to PHP

Can't set syntax to PHP

Postby yuucOm on Thu Oct 04, 2012 9:40 am

Hey guys.

I cant set syntax to PHP. When I'm trying to do it, instead of PHP my syntax is set to HTML.. Is this normal ? You have the same thing ?
yuucOm
 
Posts: 7
Joined: Sat Sep 29, 2012 12:34 pm

Re: Can't set syntax to PHP

Postby agibsonsw on Thu Oct 04, 2012 12:31 pm

yuucOm wrote:I cant set syntax to PHP. When I'm trying to do it, instead of PHP my syntax is set to HTML.. Is this normal ? You have the same thing ?


You are not alone, this happens for me too. It hasn't caused me any issue though so I haven't investigated if it can be corrected.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Can't set syntax to PHP

Postby evenous on Thu Oct 04, 2012 5:20 pm

I had similar problem, I installed DetectSyntax package and now all syntaxes are detected automatically 8-)
evenous
 
Posts: 2
Joined: Wed Oct 03, 2012 9:36 am

Re: Can't set syntax to PHP

Postby yuucOm on Sat Oct 06, 2012 10:24 am

Ok i installed DetectSyntax and now i got PHP syntax but when i select HTML syntax i got PHP syntax now so now is the opposite... You got the same situation @evenous ?
This is weird because in work i can select PHP syntax from menu and it works correctly in work but in home its not. There are lots of bugs on windows systems... Not all shortcuts works, on some machines works on some not. This should be corrected in sublime text 2.
yuucOm
 
Posts: 7
Joined: Sat Sep 29, 2012 12:34 pm

Re: Can't set syntax to PHP

Postby phillip.koebbe on Sat Oct 06, 2012 12:20 pm

@yuucOm

Create an issue on GitHub [1] and either paste or gist the file you are having problems with and I'll investigate. Also note in the issue if you added any of your own rules for DetectSyntax or if you were using all the defaults. And if you did add your own, be sure to include those as well.

[1] https://github.com/phillipkoebbe/DetectSyntax/issues
-- Phillip

Code: Select all
while self.living? do
    mistake = Mistake.new
    self.learn_from!(mistake) unless mistake.fatal?
end
phillip.koebbe
 
Posts: 208
Joined: Tue Dec 20, 2011 4:58 pm

Re: Can't set syntax to PHP

Postby koperkuba on Thu Apr 25, 2013 10:46 pm

yuucOm wrote:I cant set syntax to PHP. When I'm trying to do it, instead of PHP my syntax is set to HTML.. Is this normal ? You have the same thing ?

I have the same problem... Any help?
koperkuba
 
Posts: 1
Joined: Thu Apr 25, 2013 10:24 pm

Re: Can't set syntax to PHP

Postby Exavior on Wed Dec 04, 2013 1:39 am

I'm was having the same general issue with Sublime Text 3. It was all working fine earlier today, then suddenly all HTML documents have no syntax highlighting. When I set the syntax to HTML it shows HTML as checked in the selection list, but the active syntax in the bottom right of the editor shows up as PHP. (and no functioning syntax highlighting)

In my case PHP files also show up with PHP as the selected syntax highlighting, but syntax highlighting does not work.

I did notice that the AngularJS package adds "HTML (Angular.js)" as a syntax highlighting option, which when selected was working just fine. As I installed that package yesterday I thought it may be the culprit, but after uninstalling it the issue persisted. After re-installing the AngularJS package the "HTML (Angular.js)" syntax highlighting no-longer works, and PHP is shown as the active syntax in the bottom right of the editor.

Initially restarting Sublime did not appear to resolve this issue, but a recent restart of the application appears to have (at least temporarily) resolved the issue. I'm still posting this here just in case some of this information helps address this bug, which appears to have been around for a while.
Exavior
 
Posts: 1
Joined: Wed Dec 04, 2013 1:30 am

Re: Can't set syntax to PHP

Postby vertigoback on Tue Nov 25, 2014 8:17 am

Having the same issue with PHP being marked as PHP in the list of languages, but when I release the selection it shows HTML in the bottom/right corner and the syntax is highlighted accordingly.

Is there any easy solution for that yet!?

There is also a closed, but unanswered post on stackoverflow: http://stackoverflow.com/questions/1675 ... g-problems

:arrow: Build 3065 on Mac OS 10.9
vertigoback
 
Posts: 1
Joined: Tue Nov 25, 2014 8:06 am

Re: Can't set syntax to PHP

Postby gerry on Wed Nov 26, 2014 9:19 am

The HTML syntax actually opens certain types of what are generally considered to be php files e.g. phtml, inc, tmpl, tpl. The PHP syntax i.e. source.php is a subset of the HTML syntax.

The syntaxes are based on a very old version of the Textmate PHP Bundle. In fact it's based on version from around Feb 2 2012. It's old.

The newer version of Textmate PHP Bundle makes the above file types like phtml full fledged PHP syntax language types. I've tried to figure out how best to do this with a custom PHP Grammar (shameless plug). The problem is that the HTML syntax is tied to the PHP syntax it's not just a case of adding the above file types to the syntax definition file types list. Also, it's not neccessarily just a case of converting the existing textmate bundle into a sublime text one because there are dependency issues with other packages.

Toubleshooting
-----------------

Make sure you try clearing any sublime text caches and indexes. If you're on Ubuntu check out:

Sublime Text 3: ~/.config/sublime-text-3/Cache and ~/.config/sublime-text-3/Index

I don't know about Sublime Text 2.
gerry
 
Posts: 8
Joined: Tue Nov 11, 2014 2:22 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 19 guests