Skip to content

aecepoglu/unified-language-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unified-Language-Server

A language server for text.

Donated this project to UnifiedJS and it's going strong at https://github.com/unifiedjs/unified-language-server . Follow that one instead

demo gif

It supports all formats Unified.JS can understand:

And it provides:

  • prose and syntax checking
  • formatting (in progress)

Install

yarn global add unified-language-server
# OR
npm install -g unified-language-server

And configure your text editor to use:

  • unified-language-server --parser=retext-english --stdio for text
  • unified-language-server --parser=remark-parse --stdio for markdown

For NeoVim

"inside .vimrc
let g:LanguageClient_serverCommands = {
\ 'text': ['unified-language-server', '--parser=retext-english', '--stdio'],
\ 'markdown': ['unified-language-server', '--parser=remark-parse', '--stdio'],
\ }

And you're ready to go!

Configuration

The server has default configurations for remark-parse(for markdown) and remark-english(for text):

{
	"retext-english": {
		"plugins": [
			["#retext-profanities"],
			["#retext-spell", "#dictionary-en-gb"]
		],
	},
	"remark-parse": {
		"plugins": [
			["#remark-preset-lint-markdown-style-guide"]
			["#remark-retext", "#parse-latin"],
			["#retext-profanities"],
			["#retext-spell", "#dictionary-en-gb"]
		]
	}
}

So, for a markdown file:

  1. because we launched it with --parser=remark-parse, it finds the setting with the same name
  2. applies all the plugins:
  3. remark-preset-lint-markdown-style-guide checks for markdown usage
  4. remark-retext extracts the texts from markdown
  5. retext-profanities about usage of profanity words
  6. retext-spell does spellcheck

More detail on configuration is available at CONFIGURATION.md

Contributing

To contribute, please:

  • Report any and all issues that you have
  • In your issues make sure to mention:
    • what version of the server you are running
    • your configurations (if you have any)