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 markdown headings in document symbols #168

Closed
stefanprobst opened this issue Apr 12, 2021 · 6 comments · Fixed by #340
Closed

Support markdown headings in document symbols #168

stefanprobst opened this issue Apr 12, 2021 · 6 comments · Fixed by #340
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🦋 type/enhancement This is great to have

Comments

@stefanprobst
Copy link

stefanprobst commented Apr 12, 2021

Subject of the feature

VSCode has a outline panel, which works for markdown files, but currently not for mdx files. It would be great if it would!

Problem

Currently, the ouline pane shows a "No symbols found in document" message.

Expected behavior

Document outline should be accessible in outline pane.

Alternatives

Manually switch the language from "Markdown React" to "Markdown" to get the outline.

@stefanprobst stefanprobst added 🙉 open/needs-info This needs some more info 🦋 type/enhancement This is great to have labels Apr 12, 2021
@stefanprobst
Copy link
Author

for markdown this is handled by this DocumentSymbolProvider, but no idea how to reuse this for mdx

@JounQin JounQin added PR welcome and removed 🙉 open/needs-info This needs some more info labels Jul 6, 2022
@JounQin
Copy link
Member

JounQin commented Jul 6, 2022

mdx requires runtime info, so I think it can not be fully supported, but for previewing simple mdx as markdown, it may be good to have. But I personally don't have much experience on VSCode extension, PR welcome.

@Temez1
Copy link

Temez1 commented Nov 20, 2022

For me the code outline works in mdx. Not sure if something has changed?

@nightire
Copy link

@Temez1 Check the file type info in the status bar. If you see Markdown instead of Markdown React, then it must be something/where else to change the file type mapping.

remcohaszing added a commit that referenced this issue Jan 12, 2023
This is a first implementation of MDX IntelliSense for multiple editors. The idea is to turn this repository into a monorepo.

The following packages have been added:

- `@mdx-js/language-service` handles the actual logic needed for intellisense features. It wraps the TypeScript language service interface and handles MDX syntax.
- `@mdx-js/language-server` provides `@mdx-js/language-service` as an actual language server. This package is supposed to be consumed by projects such as NeoVim, `vim-lsp`, `sublimelsp`, and Emacs `lsp-mode`.
- `@mdx-js/language-client` is an internal package to integrates `@mdx-js/language-server` into VSCode.
- `@mdx-js/monaco` integrates `@mdx-js/language-service` into Monaco editor.
- `vscode-mdx` is the mono-repo root and provides `@mdx-js/language-server` as a VSCode plugin.

Todos after these changes:

- Go through “marketing” material, as in, examples, but also docs
- Perhaps add tools like stylint for CSS in demos?
- Lowercase `readme.md`, `license`?
- Support the `components` prop
- Host the demo (https://monaco.mdxjs.com styled consistently with MDX website? Or https://monaco-mdx.js.org analogous to https://monaco-tailwindcss.js.org / https://monaco-unified.js.org / https://monaco-yaml.js.org?)
- Publish packages
- Identify, test, and fix various corner cases
- Support definitions referencing unopened files
- #168
- Fix Windows tests
- Move extension from project root into subpackage (blocked upstream)
- Identify and implement missing TypeScript features
- Support unified micromark syntax plugins (`frontmatter`, `gfm`, etc) in the language server
- Support unified micromark syntax plugins in Monaco editor
- Consider support for remark transformer plugins (`remark-mdx-frontmatter` introduces variables)
- Consider support for rehype transformer plugins (`rehype-mdx-title` introduces a variable)
- Support loose (invalid) JavaScript syntax

Closes #165 (Intellisense is a broad concept. Please open new issues for specific missing features.)  
Closes #196 (I did use parts of this for inspiration. Thanks @Kingwl!)  
Closes #223
@remcohaszing
Copy link
Member

The initial IntelliSense added support for document symbols (used by for example the outline pane and breadcrumbs). Currently only JavaScript symbols are supported. I’ll use this issue to track support for markdown headings.

@remcohaszing remcohaszing changed the title outline pane Support markdown headings in document symbols Jan 13, 2023
@remcohaszing remcohaszing added 🗄 area/interface This affects the public interface 👍 phase/yes Post is accepted and can be worked on labels Jan 13, 2023
@wooorm wooorm added help wanted 🙏 This could use your insight or help and removed PR welcome labels Mar 1, 2023
remcohaszing added a commit that referenced this issue Aug 18, 2023
- Volar handles the mapping between TypeScript and LSP.
- Volar handles the mapping between TypeScript and Monaco editor.
- Volar manages virtual files.
- Volar imports TypeScript directly. As a result, the Monaco editor
  integration now requires `path` to be polyfilled.
- It is no longer possible to pass compiler options in the Monaco editor
  integration.
- This adds editor features for YAML based on `yaml-language-server`.
  This has been contributed upstream to Volar and is pending review.
- Markdown features are now handled by
  `vscode-markdown-languageservice`. This will be contributed upstream
  to Volar soon.
- Markdown definitions are broken due to a bug in Volar.
- This adds `remark-frontmatter` with TOML and YAML support as well as
  `remark-gfm` by default unless specified otherwise in `tsconfig.json`.
- The language server now requires `typescript.tsdk` to be passed via
  initialization options.
- This adds support for debugging virtual documents using Volar labs.

Closes #168
Closes #284
Closes #295
Closes #298
Closes #301
remcohaszing added a commit that referenced this issue Oct 23, 2023
- Volar handles the mapping between TypeScript and LSP.
- Volar handles the mapping between TypeScript and Monaco editor.
- Volar manages virtual files.
- Volar imports TypeScript directly. As a result, the Monaco editor integration now requires `path` to be polyfilled.
- `@mdx-js/monaco` is deprecated and removed.
- This adds `remark-frontmatter` with TOML and YAML support as well as `remark-gfm` by default unless specified otherwise in `tsconfig.json`.
- The language server now requires `typescript.tsdk` to be passed via initialization options.
- This adds support for debugging virtual documents using Volar labs.

Closes #168
Closes #284
Closes #295
Closes #298
Closes #301

Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
Co-authored-by: Johnson Chu <johnsoncodehk@gmail.com>
@remcohaszing
Copy link
Member

Released in vscode-mdx@1.5.0, @mdx-js/language-server@0.2.0 🎉

@wooorm wooorm added the 💪 phase/solved Post is done label Nov 9, 2023
@github-actions github-actions bot removed 👍 phase/yes Post is accepted and can be worked on help wanted 🙏 This could use your insight or help labels Nov 9, 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/solved Post is done 🦋 type/enhancement This is great to have
Development

Successfully merging a pull request may close this issue.

6 participants