Skip to content

Commit

Permalink
chore: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
bhsd-harry committed Nov 29, 2024
1 parent 0f5b958 commit 65ead83
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 96 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ const [json, ts] = config.overrides;

module.exports = {
...config,
extends: [
...config.extends,
'plugin:markdown/recommended-legacy',
],
rules: {
...config.rules,
'n/no-missing-import': [
Expand All @@ -13,6 +17,7 @@ module.exports = {
allowModules: ['vscode'],
},
],
'n/no-missing-require': 0,
'jsdoc/require-jsdoc': 0,
},
overrides: [
Expand Down
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
node_modules/
dist/
/.vscode/settings.json
# /.vscodeignore
/.eslintcache*
/.eslintcache
/page.wiki
/personal_access_token
package-lock.json
yarn.lock

# Packaged files
*.vsix
# logs
**/*.log
42 changes: 1 addition & 41 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,49 +1,9 @@
**/*.wiki
personal_access_token

# Workspace config
.vs/
.vscode/
.github/
.git/

# Test
.vscode-test/
.vscode-test-web/
**/test/

# Source code
# out/
**/src/
# scripts/

# Modules
# node_modules/

# YAML files
# snippets/*.yaml
# syntaxes/*.yaml
# language-configuration.yaml

# Compiled config
*/src/
**/tsconfig.json
**/tslint.json
**/.eslintrc.*
.eslintcache*
# webpack.config.js
.yarnrc
# yarn.lock
# package-lock.json

# Uncompiled files
**/*.map
**/*.ts

# Git Ignore file
.gitignore

# Packaged extensions
**/*.vsix

# Log file
**/*.log
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

57 changes: 27 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
# WikiParser Language Server

[![VSCode Marketplace: WikiParser Language Server](https://vsmarketplacebadges.dev/version-short/bhsd.vscode-extension-wikiparser.webp?color=blueviolet&logo=visual-studio-code&style=?style=for-the-badge)](https://marketplace.visualstudio.com/items?itemName=Bhsd.vscode-extension-wikiparser)
[![CodeQL](https://github.com/bhsd-harry/vscode-extension-wikiparser/actions/workflows/codeql.yml/badge.svg)](https://github.com/bhsd-harry/vscode-extension-wikiparser/actions/workflows/codeql.yml)

This is a language server extension for Visual Studio Code that provides language supports for the [Wikitext](https://www.mediawiki.org/wiki/Wikitext) language.

## Installation

You can install this extension from the [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=Bhsd.vscode-extension-wikiparser).

## Usage

This extension does not actively call any code. The server exists as an asset at the location: `server/dist/server.js`. You can call this asset from any extension, for example:

```typescript
let client: BaseLanguageClient | undefined = undefined;

async function startWikiParse() : Promise<void> {
const serverPath: string | undefined = vscode.extensions.getExtension('Bhsd.vscode-extension-wikiparser')?.extensionPath;
if (serverPath === undefined) {
return;
}
const serverMain: string = path.join(serverPath, 'server', 'dist', 'server.js');
const serverOptions: ServerOptions = {
run: {
module: serverMain,
},
debug: {
module: serverMain,
args: ['--debug'],
},
};
const clientOptions: LanguageClientOptions = {
documentSelector: [
{ scheme: 'file', language: 'wikitext' },
{ scheme: 'untitled', language: 'wikitext' },
],
};
client = new NodeLanguageClient('WikiParser Language Server', serverOptions, clientOptions);
await client.start();
}
This extension does not activate automatically. The server exists as an asset at the location: `server/dist/server.js`. You can call this asset from any extension, for example:

```js
const path = require('path'),
{extensions} = require('vscode'),
{LanguageClient} = require('vscode-languageclient/node');

const {extensionPath} = extensions.getExtension('Bhsd.vscode-extension-wikiparser');
new LanguageClient(
'WikiParser Language Server',
{
run: {module: path.join(extensionPath, 'server', 'dist', 'server.js')},
},
{
documentSelector: [
{scheme: 'file', language: 'wikitext'},
{scheme: 'untitled', language: 'wikitext'},
],
},
).start();
```

## Features
Expand All @@ -47,4 +45,3 @@ async function startWikiParse() : Promise<void> {
- Outline view
- Hover information
- Help with parser function signatures
- More to come!
39 changes: 22 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vscode-extension-wikiparser",
"version": "1.0.0",
"version": "1.0.1",
"description": "Language server extension for MediaWiki Wikitext that supports linting, autocomplete, and more.",
"displayName": "WikiParser Language Server",
"categories": [
Expand Down Expand Up @@ -47,34 +47,39 @@
"build": "tsc --project server/tsconfig.json",
"lint:ts": "tsc --noEmit --project server/tsconfig.json && eslint --cache .",
"lint:json": "v8r -s server/src/data/schema/info.json server/src/data/*.json",
"lint": "npm run lint:ts && npm run lint:json",
"package": "vsce package"
"lint": "npm run lint:ts && npm run lint:json"
},
"dependencies": {
"@bhsd/common": "^0.4.4",
"@bhsd/common": "^0.4.5",
"color-rgba": "^3.0.0",
"vscode-languageserver": "^9.0.1",
"vscode-languageserver-textdocument": "^1.0.12",
"wikilint": "^2.13.5"
"wikilint": "^2.13.6"
},
"devDependencies": {
"@stylistic/eslint-plugin": "^2.10.1",
"@stylistic/eslint-plugin": "^2.3.0",
"@stylistic/stylelint-plugin": "^2.0.0",
"@types/color-rgba": "^2.1.3",
"@types/node": "^22.9.0",
"@types/vscode": "^1.95.0",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@vscode/vsce": "^3.2.1",
"eslint": "^8.0.0",
"esbuild": "^0.21.4",
"eslint": "^8.56.0",
"eslint-plugin-es-x": "^8.0.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-jsdoc": "^50.5.0",
"eslint-plugin-jsdoc": "^48.5.2",
"eslint-plugin-json-es": "^1.6.0",
"eslint-plugin-n": "^17.13.2",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-regexp": "^2.7.0",
"eslint-plugin-unicorn": "^56.0.0",
"typescript": "^5.6.0",
"v8r": "^4.2.0"
"eslint-plugin-markdown": "^4.0.1",
"eslint-plugin-n": "^17.9.0",
"eslint-plugin-promise": "^6.2.0",
"eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-unicorn": "^54.0.0",
"http-server": "^14.1.0",
"stylelint": "^16.6.1",
"stylelint-config-recommended": "^14.0.0",
"typescript": "^5.5.3",
"v8r": "^3.0.0"
},
"resolutions": {
"eslint/**/strip-ansi": "6.0.1"
Expand Down

0 comments on commit 65ead83

Please sign in to comment.