Visual Studio Code
Visual Studio Code is a free cross-platform IDE built on open source with a diverse plugin ecosystem that can be used for MediaWiki Development. It was designed by Microsoft.
You can download it for free https://code.visualstudio.com/
Notable features
editThis one might annoy you https://code.visualstudio.com/docs/getstarted/userinterface#_preview-mode
Recommended Plugins
editLicence required (after 1 month trial). Contact Addshore.
Notes
- Simple refactorings are done through the "rename symbol" option not "refactor"
- Very receptive to issues being filed, and fixes often in 1 day. (issue tracker)
Debug support for PHP with XDebug.
If you're using Windows, WSL2, or docker containers you might find this blog post useful.
The plugin comes with default configuration that will work in many cases.
Issues with path mappings
editIf you have problems with VSCode detecting the mappings between your files and the debug sessions you may need to set some path Mappings in the launch.json
"pathMappings": {
<remote-mediawiki-path>: "${workspaceRoot}"
}
Avoid breaking on uncaught exceptions, warnings etc.
editBy default the plugin will break on "uncaught exceptions and errors / warnings / notices".
This may not be desirable and can be turned off.
- Using the sidebar, select the "Run" panel.
- At the bottom of the panel expand the "Breakpoints" section (collapsed by default).
- Untick the "Everything" option.
Provides links to Phabricator objects.
"phabricator-links.url": "https://phabricator.wikimedia.org"
Settings
editfiles.autoSave
editAnnoyed by forgetting to save files and wondering why you can't see your changes? Check out this setting.
"files.autoSave": "onFocusChange"
search.useIgnoreFiles
editMediaWiki includes a .gitignore file that the IDE will use to ignore files and directories during search. In MediaWiki this includes the skins and extensions directories. In order to search files in these directories you will need to set the search.useIgnoreFiles to false in your project specific configuration or higher. A default of true may be useful in other projects, so the recommended location is in project configuration.
"search.useIgnoreFiles": false
editor.wordSeparators
editIn order to allow selection of PHP variables (including the $) by double clicking on them you need to alter your editor.wordSeparators [1]
You can do this for individual languages in your settings.json file [2]
"[php]": {
"editor.wordSeparators": "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?"
}
explorer.autoReveal
editBy default, opening a new file will jump to that location in the sidebar. This can be annoying in large projects. The bellow will stop that jumping around!
"explorer.autoReveal": "focusNoScroll"
Plugins to avoid
edit- Render line endings: Has performance problems
- Render whitespace at end of lines: Has performance problems