From 00695daef4456418ea9eb63dd39938030654fe62 Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Tue, 16 Apr 2024 17:25:46 +0200 Subject: [PATCH] Update to remark-language-server 3 (#130) This also includes related dependencies to provide compatibility with unified 11. This also contains a new setting and related documentation changes. --- package.json | 16 +++++++++++++--- readme.md | 50 ++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 53 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index b2a6d85..2079fbd 100644 --- a/package.json +++ b/package.json @@ -40,9 +40,9 @@ "esbuild": "^0.20.0", "ovsx": "^0.9.0", "prettier": "^3.0.0", - "remark-cli": "^11.0.0", - "remark-language-server": "^2.0.0", - "remark-preset-wooorm": "^9.0.0", + "remark-cli": "^12.0.0", + "remark-language-server": "^3.0.0", + "remark-preset-wooorm": "^10.0.0", "typescript": "^5.0.0", "vscode-languageclient": "^9.0.0", "xo": "^0.58.0" @@ -102,6 +102,16 @@ } }, "contributes": { + "configuration": { + "title": "remark", + "properties": { + "remark.requireConfig": { + "type": "boolean", + "default": false, + "markdownDescription": "If true, only perform actions if a [configuration file](https://github.com/remarkjs/vscode-remark#configuration-file) is found." + } + } + }, "jsonValidation": [ { "fileMatch": [ diff --git a/readme.md b/readme.md index fb67f19..2b8fd3d 100644 --- a/readme.md +++ b/readme.md @@ -10,16 +10,18 @@ Visual Studio Code extension to format and lint markdown files with remark. ## Contents -* [What is this?](#what-is-this) -* [When should I use this?](#when-should-i-use-this) -* [Install](#install) -* [Use](#use) -* [Formatting](#formatting) -* [Plugins](#plugins) -* [Compatibility](#compatibility) -* [Security](#security) -* [Contribute](#contribute) -* [License](#license) +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [Configuration file](#configuration-file) +* [Settings](#settings) +* [Formatting](#formatting) +* [Plugins](#plugins) +* [Compatibility](#compatibility) +* [Security](#security) +* [Contribute](#contribute) +* [License](#license) ## What is this? @@ -72,6 +74,32 @@ Here’s an example that should produce problems you can use to verify: 1) Hello, _Jupiter_ and *Neptune*! ``` +## Configuration file + +`remark-language-server` uses the same configuration files as +[`remark-cli`][remark-cli]. +These files are: + +* `.remarkrc` +* `.remarkrc.cjs` +* `.remarkrc.js` +* `.remarkrc.json` +* `.remarkrc.mjs` +* `.remarkrc.yaml` +* `.remarkrc.yml` +* `package.json` + +Language clients should notify the language server if these files change. +They are looked up starting at the folder where the checked markdown file +exists. + +## Settings + +This extension supports the following settings: + +* `remark.requireConfig` (`boolean`, default: `false`) — If true, only perform + actions if a [configuration file][configuration-file] is found. + ## Formatting This extension can format markdown files. @@ -141,6 +169,8 @@ abide by its terms. [build]: https://github.com/remarkjs/vscode-remark/actions +[configuration-file]: #configuration-file + [downloads-badge]: https://img.shields.io/visual-studio-marketplace/d/unifiedjs.vscode-remark [chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg