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

Experimental Intellisense: Request textDocument/foldingRange failed. #289

Closed
4 tasks done
jasikpark opened this issue Jan 26, 2023 · 5 comments · Fixed by #290
Closed
4 tasks done

Experimental Intellisense: Request textDocument/foldingRange failed. #289

jasikpark opened this issue Jan 26, 2023 · 5 comments · Fixed by #290
Labels
🗄 area/interface This affects the public interface 👍 phase/yes Post is accepted and can be worked on 👶 semver/patch This is a backwards-compatible fix 🐛 type/bug This is a problem 🙆 yes/confirmed This is confirmed and ready to be worked on

Comments

@jasikpark
Copy link

Initial checklist

Affected packages and versions

v1.2.1 w/ experimental intellisense turned on

Link to runnable example

No response

Steps to reproduce

Open a markdown file named api.mdx

---
title: API Docs
hide_table_of_contents: true
---

import ApiDocMdx from '@theme/ApiDocMdx';

<ApiDocMdx id="api" />

Expected behavior

There should be no false positives / errors when opening a valid file

Actual behavior

get this error.

[Error - 12:14:46 PM] Request textDocument/foldingRange failed.
  Message: Request textDocument/foldingRange failed with message: Cannot read properties of undefined (reading 'textSpan')
  Code: -32603 

Runtime

Node v18

Package manager

npm v8

OS

macOS

Build and bundle tools

Docusaurus

@jasikpark jasikpark changed the title Experimental Intellisense: Experimental Intellisense: Request textDocument/foldingRange failed. Jan 26, 2023
@remcohaszing
Copy link
Member

Thanks for reporting! I have been able to reproduce the issue.

Does you project have a tsconfig.json file? If so, you can add frontmatter support by adding the mdxplugins section in it. For example, see our frontmatter fixture.

Configuration for remark plugins is new since version 1.2.0. I welcome any feedback on this.

Regardless of the above, this error should not pop-up. I will look into it soon.

@remcohaszing remcohaszing added 🐛 type/bug This is a problem 🗄 area/interface This affects the public interface 👶 semver/patch This is a backwards-compatible fix 🙆 yes/confirmed This is confirmed and ready to be worked on 👍 phase/yes Post is accepted and can be worked on labels Jan 26, 2023
@jasikpark
Copy link
Author

yep we're using the Typescript starter for Docusaurus in this instance

@jasikpark
Copy link
Author

i'll test that out 🫡

remcohaszing added a commit that referenced this issue Jan 27, 2023
Some cases caused a crash when requesting folding ranges related to
markdown headings. This is fixed now.

This also adds support for folding range categories.

Also tests have been added for folding ranges.

Closes #289
remcohaszing added a commit that referenced this issue Jan 27, 2023
Some cases caused a crash when requesting folding ranges related to
markdown headings. This is fixed now.

This also adds support for folding range categories.

Also tests have been added for folding ranges.

Closes #289
remcohaszing added a commit that referenced this issue Jan 27, 2023
Some cases caused a crash when requesting folding ranges related to
markdown headings. This is fixed now.

This also adds support for folding range categories.

Also tests have been added for folding ranges.

Closes #289

Signed-off-by: Remco Haszing <remcohaszing@gmail.com>
Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
@remcohaszing
Copy link
Member

This has just been released in v1.2.2 🎉

@jasikpark
Copy link
Author

wahoo 🔥 excited to try it out

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/yes Post is accepted and can be worked on 👶 semver/patch This is a backwards-compatible fix 🐛 type/bug This is a problem 🙆 yes/confirmed This is confirmed and ready to be worked on
Development

Successfully merging a pull request may close this issue.

2 participants