Help:Visual Studio Code

Visual Studio Code (VSC) is a free code editor made by Microsoft for Windows, iOS, and Linux. The Wikitext extension provides functional support for the wikitext language with MediaWiki wikis.


 * Note: This guide is based on Visual Studio Code version 1.58.2 and Wikitext version 3.3.0, but should work on most stable versions.

Installation
For all installation methods, Visual Studio Code is required.
 * 1) Download and install Visual Studio Code: https://code.visualstudio.com/

Default Extension Installation

 * 1) Open the extensions panel. This can be accessed as follows:
 * 2) * Menu bar: View &rarr; Extensions
 * 3) * Activity bar: The 5th item (looks like 4 squares arranged in a 2x2 grid, and the top right square is detached) [[File:Vs-code-extensions-icon.png]]
 * 4) * Keyboard shortcuts: ++ (Windows).
 * 5) Search for Wikitext in the Marketplace, and select this item in the results.
 * 6) Once the extension page loads in VSC, click "Install".

Alternative Extension Installation

 * 1) Navigate to https://marketplace.visualstudio.com/items?itemName=RoweWilsonFrederiskHolme.wikitext
 * 2) Click "Install". This will prompt to allow the site to open the vscode link, if you haven't set it to always allow.
 * 3) Click "Choose Application", select "Visual Studio Code", and click "Open Link".
 * 4) Once the extension page loads in VSC, click "Install".

Bot Password
Before configuration, make sure a bot password with your desired editing rights is generated.
 * 1) Go to Special:BotPasswords and create a new bot password.
 * 2) Choose the grants that permit what an application can do with the bot password. For posting edits, at least "Edit existing pages" should be enabled.
 * 3) After submitting, write down the bot name and password.

Extension Settings

 * 1) Open the settings panel.
 * 2) * Menu bar: File &rarr; Preferences &rarr; Settings.
 * 3) * Activity bar: Gear icon at bottom &rarr; Settings.
 * 4) * Keyboard shortcut: + (Windows).
 * 5) Search for "Wikitext" in the settings, or expand the "Extensions" and select "Wikitext".

Please refer to Special:Version of your wiki and the generated bot password on Special:BotPasswords to find the information for the following fields.
 * Important: The BOT_NAME that you choose when generating a bot password must be provided in either the "Wikitext: Password" field or the "Wikitext: User name" field, but not both. With the table above, both fields should follow the same method, either "Method 1" or "Method 2".

Usage
All commands require the Command Palette (++ on Windows).


 * 1) In the Command Palette, type   and select "Wikitext: Login with your account". Do this when you change wikis, or when you're not logged in and wish to make changes.
 * 2) In the Command Palette, type   and select "Wikitext: Pull page to edit". Enter the full page name in the next field. Opens the page in a new tab.
 * 3) In the Command Palette, type   and select "Wikitext: Get preview". This will open a new tab with page preview. Recommended to do prior to posting.
 * 4) In the Command Palette, type   and select "Wikitext: Post your edit to the website". Also enter edit summary.
 * 5) In the Command Palette, type   and select "Wikitext: Logout, if you are already logged in". Use when you're done editing for the session.

invalidjson: No valid JSON response
Likely caused by incorrect details for the API path or article path. For example, the API path left as default.

Could not login: Failed
Likely to be caused by incorrect credentials. Make sure the username and password is either:
 * 1)   and  ; or
 * 2)   and.

You are not logged in. Please log in and try again.
Likely caused by trying to posting changes to a wiki prior to logging in. The login token may also have expired. Changing wikis will discard the current login token.