Skip to content

Commit

Permalink
Update to unified-language-server 4 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
remcohaszing committed Sep 25, 2023
1 parent f142e19 commit 1af91a0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions index.js
Expand Up @@ -5,6 +5,7 @@ import {createUnifiedLanguageServer} from 'unified-language-server'
process.title = 'remark-language-server'

createUnifiedLanguageServer({
configurationSection: 'remark',
ignoreName: '.remarkignore',
packageField: 'remarkConfig',
pluginPrefix: 'remark',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -29,7 +29,7 @@
"index.js"
],
"dependencies": {
"unified-language-server": "^3.0.0"
"unified-language-server": "^4.0.0"
},
"devDependencies": {
"prettier": "^3.0.0",
Expand Down
23 changes: 22 additions & 1 deletion readme.md
Expand Up @@ -14,6 +14,8 @@ A language server to lint and format markdown files with **[remark][]**.
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [Configuration file](#configuration-file)
* [Settings](#settings)
* [Examples](#examples)
* [Emacs](#emacs)
* [Neovim](#neovim)
Expand Down Expand Up @@ -51,6 +53,8 @@ Because this is based on
[`unified-languageserver-node`][unified-languageserver-node], the same features
are supported.

### Configuration file

`remark-language-server` uses the same configuration files as
[`remark-cli`][remark-cli].
These files are:
Expand All @@ -68,6 +72,13 @@ 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 language server supports the following settings:

* `remark.requireConfig` (`boolean`, default: `false`) — If true, only perform
actions if a [configuration file][configuration-file] is found.

## Examples

### Emacs
Expand All @@ -82,7 +93,11 @@ client.
This means you can add remark language server in one line:

```lua
require'lspconfig'.remark_ls.setup{}
require'lspconfig'.remark_ls.setup {
settings = {
requireConfig = true
}
}
```

`nvim-lspconfig` has
Expand All @@ -100,6 +115,10 @@ if (executable('remark-language-server'))
\ 'name': 'remark',
\ 'cmd': {server_info->['remark-language-server', '--stdio']},
\ 'allowlist': ['markdown'],
\ 'config': lsp_settings#get('remark-language-server', 'config', lsp_settings#server_config('remark-language-server')),
\ 'workspace_config': lsp_settings#get('remark-language-server', 'workspace_config', {
\ 'requireConfig': v:true,
\ }),
\ })
endif
```
Expand Down Expand Up @@ -140,6 +159,8 @@ abide by its terms.

[build]: https://github.com/remarkjs/remark-language-server/actions

[configuration-file]: #configuration-file

[downloads-badge]: https://img.shields.io/npm/dm/remark-language-server.svg

[downloads]: https://www.npmjs.com/package/remark-language-server
Expand Down

0 comments on commit 1af91a0

Please sign in to comment.