Sublime Forum

Builds not auto-selecting

#1

For my sins, I’ve had to do a bit of PHP work. So I looked up how to set up a PHP build and have this file:

// Sublime Text - Build System for PHP
{
  "cmd": ["php", "$file"],
  "selector": "source.php"
}

After I put this in, my PHP files don’t automatically know to use this build, but if I select Tools/Build System/PHP it works fine. However, now when I load a Ruby file, it seems to be trying to build it with the PHP build, or at least not with Ruby, until I select Ruby from the tools.

I can’t even find the Ruby.sublime-build file on my computer.

When I put Sublime back in Automatic it still doesn’t find the PHP build, though it still works when I apply it manually. It does correctly find the Ruby.

Oh, just got an idea: probably need to refresh it. I’ll restart … no, it still isn’t automatically finding php. Advise me please.

Thanks!

0 Likes

#2

That would imply that your scope selector is wrong in your build system - try using embedding.php instead, as seen when creating a new tab in ST, setting the syntax to PHP, then going to the Tools menu -> Developer -> Show Scope Name

0 Likes

#3

I think that’s working … thanks! I don’t think I know what source.php vs embedding.php really means but anyway it seems to be doing what I had hoped for. :slight_smile: Thanks again

0 Likes