Allow changing default `.wikitext` file extension to something else
I always find it quite annoying when I create a new wikitext file and then, when I save it, I always have to edit the file extension to be .wiki instead of .wikitext – there’s no setting to permanently set the file extension!
I looked through the VSCode API documentation, but didn't find any settings or configurations for it. So it seems that this is not feasible, and VSCode will always get the first one in extensions as the default file extension.
Should I open an issue about this in the VSCode repository?
Maybe? I looked around in the VSCode issues page but couldn't seem to find an existing issue for this, not sure if I'm missing something.
VSCode will always get the first one in
extensionsas the default file extension.
[!TIP] Instead of $${\color{red}un \color{black}wished \space \color{red}long}$$ file extension ~~.wikitext~~, changing the order of file extensions in
package.jsondefaults the file extension to $${\color{green}shorter}$$ .wiki
In File Explorer
- Browse folder
%UserProfile%\.vscode\extensions\rowewilsonfrederiskholme.wikitext-4.0.2 - Backup
package.json
In VSCode
- Edit
package.json - Move the String
".wiki"in first position. - Add a comma after the String.
- Remove the ending ~~comma~~ in
".mw"$${\color{red},}$$ - The expected JSON should be:
"languages": [
{
"id": "wikitext",
"extensions": [
".wiki",
".wikitext",
".wt",
".mediawiki",
".mw"
],
In VSCode menu View > Extensions > Wikitext
- Click wheel ☸ Manage > 🛑 $${\color{red}Disable}$$
- Click $${\color{blue}Restart \space Extensions}$$
- Click wheel ☸ Manage > 🟢 $${\color{green}Enable}$$
- Click menu File > Save As >
<%-- [PAGE_INFO] Untitled-1 - Filename: Untitled-1.wiki
- Rename Untitled-1 keeping the file extension.
Huge thanks @AlSchemist for your comment, it solved the issue for me! @Frederisk Should I close this issue now?
Editing the source code is indeed a solution to the problem. However, it should be noted that every time the extension is updated, your changes will be overwritten. The good news is that this extension tends to be stable, so updates are not very frequent.
I tend to think that this issue has not been completely resolved, but you are free to choose to close it.