Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support remark syntax plugins in @mdx-js/language-server #266

Closed
4 tasks done
remcohaszing opened this issue Jan 13, 2023 · 0 comments · Fixed by #272
Closed
4 tasks done

Support remark syntax plugins in @mdx-js/language-server #266

remcohaszing opened this issue Jan 13, 2023 · 0 comments · Fixed by #272
Labels
🗄 area/interface This affects the public interface 👋 phase/new Post is being triaged automatically 🦋 type/enhancement This is great to have

Comments

@remcohaszing
Copy link
Member

remcohaszing commented Jan 13, 2023

Initial checklist

Problem

The language service was written with support for remark/micromark syntax plugins in mind, but not the language server. We need to think of a way for users to define which remark plugins to use.

Solution

The language server uses TypeScript, which loads tsconfig.json. We could extend tsconfig.json with an mdx property. For example ts-node does this too.

We can then use load-plugin to load the plugins.

{
  "compilerOptions": {
    "module": "node16",
    "strict": true,
    // etc…
  },
  "mdx": {
    "plugins": [
      "remark-frontmatter",
      "remark-gfm"
    ]
  }
}

Alternatives

We could also use LSP workspace configuration.

Alternatively we could investigate a more common MDX configuration file and look into creating an MDX CLI. I.e. remark-cli doesn’t support MDX out of the box. (unifiedjs/unified-engine#56)

@remcohaszing remcohaszing added 🦋 type/enhancement This is great to have 🗄 area/interface This affects the public interface 👋 phase/new Post is being triaged automatically labels Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface 👋 phase/new Post is being triaged automatically 🦋 type/enhancement This is great to have
Development

Successfully merging a pull request may close this issue.

1 participant