Add remark-language-server package#924
Add remark-language-server package#924remcohaszing wants to merge 2 commits intoremarkjs:mainfrom remcohaszing:remark-language-server
Conversation
This provides language server support for remark based on unifiedjs/unified-language-server#13
ChristianMurphy
left a comment
There was a problem hiding this comment.
Thanks @remcohaszing!
Murderlon
left a comment
There was a problem hiding this comment.
Nice!
I do have to say it feels a bit off to have the language server inside remarkjs/remark but on the other hand it's just a different way to use remark, like the node API, or the CLI.
|
|
||
| Usage of this package depends on your editor integration. | ||
|
|
||
| Practical examples are coming soon. |
There was a problem hiding this comment.
Yes practical examples would help a lot!
There was a problem hiding this comment.
These practical examples depend on the release of this package though, so this is a bit of a circular dependency right now.
| This package is a [language server][] which can lint and format markdown files | ||
| using remark. | ||
|
|
||
| You can choose from the 150+ plugins that already exist or make your own. |
There was a problem hiding this comment.
Perhaps a small clarification that it's just another layer but the config can be shared between the remark CLI and editor integration.
| You can choose from the 150+ plugins that already exist or make your own. | |
| The language server can take in your [remark][] configuration file so you can use the settings and all the plugins as you're used to. |
There was a problem hiding this comment.
I actually copied the readme from remark-cli and modified it. The original line comes from there, so I’m not sure if it should be removed here.
There was a problem hiding this comment.
Maybe remove this? The previous and next sentence seem to explain “What is this”. This line seems to be about plugins, which aren’t introduced or explained in surrounding prose.
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
|
You mentioned it but didn’t really provide arguments: what’s the reason it should go in this repo? |
| { | ||
| "name": "remark-language-server", | ||
| "version": "1.0.0", | ||
| "description": "A language server for markdown using remark", |
There was a problem hiding this comment.
| "description": "A language server for markdown using remark", | |
| "description": "Language server for markdown using remark", |
| "repository": "https://github.com/remarkjs/remark/tree/main/packages/remark-language-server", | ||
| "bugs": "https://github.com/remarkjs/remark-language-serve/issues", | ||
| "bin": "remark-language-server.js", | ||
| "author": "Remco Haszing <remcohaszing@gmail.com>", |
There was a problem hiding this comment.
Are you the copyright holder? Is this one of the packages (or does it include work of) originally other folks?
| "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", | ||
| "test": "tsc && npm run format" |
There was a problem hiding this comment.
Other packages in this monorepo have different scripts I believe, probably match those?
| "dependencies": { | ||
| "unified-language-server": "^1.0.0" | ||
| } | ||
| } |
There was a problem hiding this comment.
Sorting of fields should match other packages
| This package is a [language server][] which can lint and format markdown files | ||
| using remark. | ||
|
|
||
| You can choose from the 150+ plugins that already exist or make your own. |
There was a problem hiding this comment.
Maybe remove this? The previous and next sentence seem to explain “What is this”. This line seems to be about plugins, which aren’t introduced or explained in surrounding prose.
|
|
||
| ## License | ||
|
|
||
| [MIT][license] © [Titus Wormer][author] |
There was a problem hiding this comment.
author should match package.json#author
| #!/usr/bin/env node | ||
| import {createUnifiedLanguageServer} from 'unified-language-server' | ||
|
|
||
| process.title = 'remark-language-server' |
There was a problem hiding this comment.
TIL! Is this common? Language-server-specific?
| "skipLibCheck": true, | ||
| "strict": true, | ||
| "target": "ES2020" | ||
| } |
There was a problem hiding this comment.
Should use the main config, e.g.: https://github.com/remarkjs/remark/blob/main/packages/remark-parse/tsconfig.json
Mainly because I wanted to publish this code somewhere and I’m not sure if I have permission to create projects within the remark organization. I’m not sure if this belongs in the remark core project or in a separate project. It’s fine with me if this ends up in a separate repo. |
|
I think a separate project makes the most sense? One of us can also create an empty project for you, if needed |
|
Closing in favor of remarkjs/remark-language-server#1 |
Initial checklist
Description of changes
This provides language server support for remark based on unifiedjs/unified-language-server#13
Initially I was going to create this as a separate project, but maybe it belongs in the remark core project. Regardless, I think it belongs in the remark organization and at least now it’s no longer just a local project on my machine. :)