-
-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
Problem
As part of remarkjs/remark#910 I would like to make unified-language-server
based on unified-engine
, so it yields the same result as CLIs created using unified-args
.
Currently the language server is written in CJS, has a custom configuration file, and is synchronous. Unfortunately this means a lot of the existing code needs to be rewritten. Fortunately this also means a lot of code can be removed.
In order to do this right, the command line interface of the language server needs to be redesigned.
Solution
I imagine the CLI works like this:
unified-language-server \
--prefix remark \
--plugin remark-parse \
--plugin remark-stringify
--prefix
defines the prefix that’s passed tounified-engine
. I.e. the example loads.remarkrc.js
,.remarkignore
, etc.--plugin
specifies plugins to be loaded that aren’t defined in the configuration file. They will be loaded usingload-plugin
.
Also I suggest we add a pre existing command line parser, i.e. commander
Alternatives
Another possibility is to load remark
. This better matches behavior of remark-cli
. However, I’m not sure how this should be defined, because remark
uses a named export.