Skip to content

Add remark-language-server package#924

Closed
remcohaszing wants to merge 2 commits intoremarkjs:mainfrom
remcohaszing:remark-language-server
Closed

Add remark-language-server package#924
remcohaszing wants to merge 2 commits intoremarkjs:mainfrom
remcohaszing:remark-language-server

Conversation

@remcohaszing
Copy link
Copy Markdown
Member

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)
  • If applicable, I’ve added docs and tests

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. :)

This provides language server support for remark based on
unifiedjs/unified-language-server#13
@remcohaszing remcohaszing requested a review from wooorm December 15, 2021 13:01
@github-actions github-actions bot added the 👋 phase/new Post is being triaged automatically label Dec 15, 2021
@github-actions github-actions bot added 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Dec 15, 2021
Copy link
Copy Markdown
Member

@ChristianMurphy ChristianMurphy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @remcohaszing!

Copy link
Copy Markdown
Member

@Murderlon Murderlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes practical examples would help a lot!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a small clarification that it's just another layer but the config can be shared between the remark CLI and editor integration.

Suggested change
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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@wooorm
Copy link
Copy Markdown
Member

wooorm commented Dec 16, 2021

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",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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>",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you the copyright holder? Is this one of the packages (or does it include work of) originally other folks?

Comment on lines +16 to +17
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"test": "tsc && npm run format"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other packages in this monorepo have different scripts I believe, probably match those?

"dependencies": {
"unified-language-server": "^1.0.0"
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

author should match package.json#author

#!/usr/bin/env node
import {createUnifiedLanguageServer} from 'unified-language-server'

process.title = 'remark-language-server'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL! Is this common? Language-server-specific?

"skipLibCheck": true,
"strict": true,
"target": "ES2020"
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@remcohaszing
Copy link
Copy Markdown
Member Author

You mentioned it but didn’t really provide arguments: what’s the reason it should go in this repo?

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.

@wooorm
Copy link
Copy Markdown
Member

wooorm commented Dec 21, 2021

I think a separate project makes the most sense?

One of us can also create an empty project for you, if needed

@remcohaszing
Copy link
Copy Markdown
Member Author

Closing in favor of remarkjs/remark-language-server#1

@github-actions

This comment has been minimized.

@wooorm wooorm added 👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on labels Dec 23, 2021
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Dec 23, 2021
@github-actions

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on

Development

Successfully merging this pull request may close these issues.

4 participants