![]()
#LOCAD A CLASS DEFINITION IN PHP CODE#Note that this and any other packages that rely on code sniffing and linting will be requiring command line applications installed, so be sure to visit their sites and read their directions. You'll get gutter highlights and a list up top of all of the places your code doesn't satisfy the linter. You can tweak all sorts of settings, but you're primarily either going to run it every time you save your file (good, but can get annoying), or every time you trigger it from the command palette (press super-shift-p and then type until you get "PHP Code Sniffer: Sniff this file") or keyboard shortcut ( ctrl-super-shift-s by default). ![]() There's a package named Sublime PHPCS that brings PHP_CodeSniffer, PHP's linter, PHP Mess Detector, and Scheck (?) to bear on your code. Code sniffing and PHP_CodeSniffer Sublime PHPCS Note: I originally wanted to suggest using the super modifier, so it would be just like PHPStorm however, that would override Sublime Text's "hold super and click to get multiple cursors" behavior, so I didn't. You just taught Sublime Text this: "when I hold ctrl and click button one, fire the goto_definition command." Done! ( original source) If you don't have one, go here:Ĭreate Default (Linux).sublime-mousemap in ~/.config/sublime-text-3/Packages/UserĬreate Default (OSX).sublime-mousemap in ~/Library/Application Support/Sublime Text 3/Packages/UserĬreate Default (Windows).sublime-mousemap in %appdata%\Sublime Text 3\Packages\User FYI, in Sublime Text CMD (or windows' ctrl key or whatever it is on other systems) is called "Super".įirst, create a user mousemap file. Sublime PHP Companion makes it easy to right click on functions and go to their definitions, but this shortcut brings back PHPStorm's CMD-click-to-definition. #LOCAD A CLASS DEFINITION IN PHP FULL#This isn't quite the same as full userland-code-sensitive autocompletion, but it helps a lot. Sublime PHP Companion doesn't sniff your classes and give you autocompletion, sadly, but SublimeAllAutocomplete does register the names of all symbols (functions, classes, etc.) in any files you have open in other tabs and add those to the autocomplete register. ![]() But for day-to-day work, this is a huge boost in the PHP-code-knowledge area. The package isn't perfect, and it is clearly not as bright as PHPStorm is when it comes to detecting namespaces and parsing some weird edge cases.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |