mdx-analyzer icon indicating copy to clipboard operation
mdx-analyzer copied to clipboard

[feat] IntelliSense support

Open JounQin opened this issue 3 years ago • 12 comments

references:

  1. https://github.com/microsoft/vscode/issues/92805#issuecomment-599852139
  2. https://github.com/microsoft/vscode/blob/main/extensions/html-language-features/server/src/modes/javascriptMode.ts#L57
  3. https://code.visualstudio.com/api/language-extensions/language-server-extension-guide

JounQin avatar Mar 17 '21 03:03 JounQin

Would be so great to have this - even just partial IntelliSense like auto-imports would be a huge time saver when authoring MDX documents!

karlhorky avatar Jun 16 '21 11:06 karlhorky

As an additional data point, the MDX plugin from JetBrains: https://plugins.jetbrains.com/plugin/14944-mdx

And the original discussion about it: https://youtrack.jetbrains.com/issue/WEB-32599

karlhorky avatar Jun 16 '21 11:06 karlhorky

Just wondering?! if this goes through would it also enable typescript powered autocompletion?

kishanio avatar Aug 28 '21 13:08 kishanio

Got MDX Code Completion working in Gatsby & Monaco. Maybe this helps implementing it into the vscode plugin:

https://github.com/hashbite/gatsby-mdx-suite/blob/main/themes/docs/src/components/live-editor/autocompletion.ts

https://gatsby-mdx-suite-full.netlify.app/docs/playground/

axe312ger avatar Dec 02 '21 16:12 axe312ger

This would be an excellent addition. We love writing really rich documentation in Storybook with MDX, but the lack of code completion for components and imports is a bit of a pain.

alanshortis avatar Jan 10 '22 14:01 alanshortis

Ohh, VS Code 1.64 has IntelliSense for paths in Markdown files!

I asked in the PR as to whether it could be enabled also for MDX.

karlhorky avatar Feb 04 '22 18:02 karlhorky

Hey folks!

I guess we can do something like volar(vue language service) and svelte language service. To integrate mdx with ts server.

Luckly the syntax of mdx is simple. I'll start some work in this few days.

Kingwl avatar Mar 02 '22 02:03 Kingwl

This would be incredible for the MDX developer experience!

bencmbrook avatar Mar 02 '22 04:03 bencmbrook

Typescript/intellisense support would make MDX one of the most powerful authoring tools on the planet. Prove me wrong!

Without it, it makes MDX very difficult to adopt. This is not a thin line, but rather a giant chasm in the modern development workflow. Let's do it!

theenoahmason avatar May 06 '22 16:05 theenoahmason

Please add intellisense feature to the extension! :sob: :sob:

ghost avatar Jul 04 '22 12:07 ghost

Wonder if the new Markdown Language Service and Markdown Language Server that the VS Code team just open sourced as part of 1.70 would be helpful with the implementation:

This iteration, we extracted much of VS Code's tooling for writing Markdown into a library and language server. This includes our tooling for path completions, document outlines, and diagnostics.

  • Source: https://code.visualstudio.com/updates/v1_70#_markdown-language-server
  • Blog post: https://code.visualstudio.com/blogs/2022/08/16/markdown-language-server

Maybe this code is also partly behind the Markdown path IntelliSense feature in 1.64:

The built-in Markdown extension now includes path IntelliSense for links and images.

karlhorky avatar Aug 06 '22 12:08 karlhorky

Starting October I’m going to have significantly more time to spend on OSS. Intellisense for MDX is one of the first things I’m interested to work on. Of course this requires some research at first to figure out what intellisense for MDX means (Hover effects, autocomplete, document outline, etc), and how to get a basic implementation up and running.

Ideally this is built as a language server, so the same language features can be provided in VSCode / Vim / NeoVim / Emacs / Your favourite editor. Also in my experience language servers are simpler to work with when consuming ESM and relatively straight-forward to test.

remcohaszing avatar Aug 07 '22 11:08 remcohaszing

@remcohaszing any news about this? It could be really useful.

braianj avatar Oct 25 '22 15:10 braianj

Yes, I avoided cross referencing this issue to keep it a bit under the radar, but IMO #226 is ready to be reviewed and released as an experimental feature.

remcohaszing avatar Oct 25 '22 15:10 remcohaszing