Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Add the support of WikiParser Language Server #101

Merged
merged 9 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint",
// "pedro-w.tmlanguage",
"redhat.vscode-yaml",
"gamunu.vscode-yarn",
"editorconfig.editorconfig"
]
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint",
// "pedro-w.tmlanguage",
"redhat.vscode-yaml",
"gamunu.vscode-yarn",
"editorconfig.editorconfig"
]
}
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
Expand All @@ -24,11 +23,12 @@
"preLaunchTask": "npm: pretest"
},
{
"name": "Launch Extension with Other Extensions",
"name": "Launch Extension without Other Extensions",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
Expand Down Expand Up @@ -71,7 +71,7 @@
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--disable-extensions",
// "--disable-extensions",
"--extensionDevelopmentKind=web"
],
"outFiles": [
Expand Down
82 changes: 42 additions & 40 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,46 @@
*--------------------------------------------------------------------------------------------*/
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false,
"dist":false,
"**/.classpath": false,
"**/.project": false,
"**/.settings": false,
"**/.factorypath": false
},
"search.exclude": {
"**/node_modules": true,
"out": true, // set this to false to include "out" folder in search results
"dist": true,
".vscode-test": true,
".vscode-test-web": true
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"typescript.tsdk": "./node_modules/typescript/lib",
"cmake.configureOnOpen": false,
"cSpell.words": [
"bibtex",
"caltaojihun",
"eqeqeq",
"luxon",
"mimetypes",
"mwbot",
"Scribunto",
"syntaxhighlight",
"uncast",
"vsix",
"wikitable",
"wikixml",
"Xvfb"
],
"files.associations": {
"*.tmLanguage.json": "json-tmlanguage",
"*.tmLanguage.yaml": "yaml-tmlanguage"
},
"jshint.packageManager": "yarn",
"eslint.packageManager": "yarn",
"files.exclude": {
"out": false,
"dist": false,
"**/.classpath": false,
"**/.project": false,
"**/.settings": false,
"**/.factorypath": false
},
"search.exclude": {
"**/node_modules": true,
"out": true, // set this to false to include "out" folder in search results
"dist": true,
".vscode-test": true,
".vscode-test-web": true
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"typescript.tsdk": "./node_modules/typescript/lib",
"cmake.configureOnOpen": false,
"cSpell.words": [
"bibtex",
"caltaojihun",
"eqeqeq",
"luxon",
"mimetypes",
"mwbot",
"parsoid",
"Scribunto",
"syntaxhighlight",
"uncast",
"vsix",
"wikiparser",
"wikitable",
"wikixml",
"Xvfb"
],
"files.associations": {
"*.tmLanguage.json": "json-tmlanguage",
"*.tmLanguage.yaml": "yaml-tmlanguage"
},
"jshint.packageManager": "yarn",
"eslint.packageManager": "yarn",
}
124 changes: 62 additions & 62 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,66 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"label": "webpack: watch",
"detail": "convert & webpack --watch",
"isBackground": true,
"presentation": {
"echo": true,
"reveal": "never",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "package",
"label": "vsce: package",
"detail": "vsce package --yarn",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"group": "build"
},
{
"type": "npm",
"script": "test",
"label": "vscode extension: test",
"detail": "tsc & lint & run test",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"group": {
"kind": "test",
"isDefault": true
}
},
{
"type": "npm",
"script": "lint",
"label": "npm: eslint",
"problemMatcher": "$eslint-stylish",
"detail": "eslint"
}
]
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"label": "webpack: watch",
"detail": "convert & webpack --watch",
"isBackground": true,
"presentation": {
"echo": true,
"reveal": "never",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "package",
"label": "vsce: package",
"detail": "vsce package --yarn",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"group": "build"
},
{
"type": "npm",
"script": "test",
"label": "vscode extension: test",
"detail": "tsc & lint & run test",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"group": {
"kind": "test",
"isDefault": true
}
},
{
"type": "npm",
"script": "lint",
"label": "npm: eslint",
"problemMatcher": "$eslint-stylish",
"detail": "eslint"
}
]
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to the "Wikitext" extension will be documented in this file.

(The version marked with an asterisk(\*) means that the version has been adjusted internally and has not been released.)<!-- http://keepachangelog.com/ -->

## [4.0.0] - 2024-12-01

### Added

- Add the support of [WikiParser Language Server](https://github.com/bhsd-harry/vscode-extension-wikiparser).

## [3.8.3] - 2024-11-14

### Changed
Expand Down
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,24 @@ Of course, the development of this extension is short, and there may be some err

If you get help with this project, give this project a star or recommend it to others, thanks!😸

## Enhancement Tool: [Wikitext-Extension-Gadget](https://github.com/Frederisk/Wikitext-Extension-Gadget)
## Enhancement Tools

### WikiParser Language Server

- [WikiParser Language Server](https://github.com/bhsd-harry/vscode-extension-wikiparser) is a powerful tool that brings you better code folding, syntax error prompts, file outline and other features!

#### WikiParser Usage

- Install WikiParser Language Server through the extensions store (such as [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Bhsd.vscode-extension-wikiparser)) or [download the vsix file yourself](https://github.com/bhsd-harry/vscode-extension-wikiparser).
- Find `wikitext.wikiparser.enable` in settings and enable it.
- Press `F1` and execute the command `wikitext.restartLsp` or restart VSCode to apply changes.

#### WikiParser Previews

- <img alt="" src="https://github.com/user-attachments/assets/449065c2-fddc-4636-8ee1-d897afc5afe7" width="768">
- <img alt="" src="https://github.com/user-attachments/assets/5705d3b8-b77b-4142-87c9-3ff7c35c7bbe" width="768">

### Wikitext Extension Gadget

- Now you can add [Wikitext Extension Gadget](https://github.com/Frederisk/Wikitext-Extension-Gadget) as a user gadget on your wiki site. And you will get a button to open VSCode directly in your browser to edit the page!

Expand Down Expand Up @@ -78,14 +95,14 @@ Generally, make sure that your VSCode is always the latest version.
Firstly, clone this repository and change directory to the repository, then install VS Code Extension Manager and other packages:

```bash
npm install -g yarn vsce # VS Code Extension Manager
yarn install # Install devDependencies
npm install -g yarn # install yarn classic
yarn install # Install all dependencies
```

Package this project and you will get a `.vsix` file:

```bash
vsce package --yarn # Package Extension with yarn
yarn run package
```

This is it!
Expand Down
43 changes: 22 additions & 21 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,27 @@ const compat = new FlatCompat({
allConfig: js.configs.all
});

export default [{
files: ['**/*.ts'],
ignores: ["**/out", "**/dist", "**/*.d.ts", "**/webpack.config.js", '**/eslint.config.mjs'],
}, ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"), {
plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 5,
sourceType: "module"
},
export default [
// ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"),
{
files: ['**/*.ts'],
ignores: ["**/out", "**/dist", "**/*.d.ts", "**/webpack.config.js", '**/eslint.config.mjs'],
plugins: {
"@typescript-eslint": typescriptEslint,
},
languageOptions: {
parser: tsParser,
ecmaVersion: 5,
sourceType: "module"
},
rules: {
"@typescript-eslint/naming-convention": "warn",
semi: "warn",
curly: "warn",
eqeqeq: "warn",
"no-throw-literal": "warn",
"@typescript-eslint/no-explicit-any": "warn",
},

rules: {
"@typescript-eslint/naming-convention": "warn",
semi: "warn",
curly: "warn",
eqeqeq: "warn",
"no-throw-literal": "warn",
"@typescript-eslint/no-explicit-any" : "warn",
},
}];
];
Loading
Loading