Fandom Developers Wiki
Advertisement

This script/stylesheet is for PERSONAL use only!

You are free to install this script/stylesheet for yourself, but it is not allowed to be used wiki-wide (e.g., in MediaWiki:ImportJS, MediaWiki:Common.js, MediaWiki:Common.css, MediaWiki:Fandomdesktop.js, MediaWiki:Fandomdesktop.css, or MediaWiki:FandomMobile.css), as it would violate Fandom's Terms of Use.
(See the customization policy)

Open With VSC does exactly what it sounds like: It adds an edit button (next to the existing one) that opens the page in Visual Studio Code, letting you view and edit the page. However, due to limitations within the extension (outside my control) pushing pages can only be done to the configured default wiki.

Installation

Integration

This dev script integrates with the Wikitext extension for Visual Studio Code. The extension and Visual Studio Code are required for this script to work.

For more information, a setup guide, and general help about the extension, visit the Gamepedia help article.

Warning!

Always make sure that the extension is configured properly with the wiki, API paths, and bot tokens before attempting a push as that may result in the page being pushed to a different wiki.

Compatibility

  • The script is compatible with most other scripts that change the edit header options as long as the edit button itself is not changed.
  • The script will activate on all pages where editing is possible.

Configuration

The following configuration is completely optional, default values are shown here. If you want to change some settings, copy over that part and change the settings to your linking.

window.dev = window.dev || {};              // Create Window.dev if it doesn't exist already
window.dev.openvsc = {
   "web": "WEB",                            // Original (web) edit button's text
   "web-dropdown": "Web edit",              // Original (web) edit button's text when in a dropdown
   "vsc": "VSC",                            // Open With VSC button's text
   "vsc-dropdown": "Open with VSC",         // Open With VSC button's text when in a dropdown
   "VE": false,                             // Activate when Visual Editor is set in Special:Preferences (true or false value)
   "web-ve": "WEB-VE",                      // Original (web) edit button's text in VE mode
   "vsc-ve": "VSC-SE",                      // Open With VSC button's text in VE mode
}

Example configs

Enable VE mode

window.dev = window.dev || {};              // Create Window.dev if it doesn't exist already
window.dev.openvsc = {
   "VE": true,                              // Activate when Visual Editor is set in Special:Preferences (true or false value)
}

Custom text

window.dev = window.dev || {};              // Create Window.dev if it doesn't exist already
window.dev.openvsc = {
   "web": "Web edit",                       // Original (web) edit button's text
   "vsc": "VSC edit",                       // Open With VSC button's text
}
Text above can be found here (edit)
Advertisement