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

Fix LSP Crash in Code Fences #493

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

dandeandean
Copy link

@dandeandean dandeandean commented Jan 19, 2025

Description

This PR fixes the crash described in #461.
As of right now, the behavior that previously causes the crash can cause the LSP diagnostics to switch running diagnostics inside fenced areas (instead of outside see: test-zone.md).
While this is still undefined behavior, it is better than crashing the LSP client.
It seems to me that the logic behind when to check the links may need a major refactor in order to fix this bug, so in the mean time, we can add this as a quick fix.

Testing:

I tested this on the following files:
test-note.md
test-zone.md
empty.md

The Diagnostics switch

On Open

image

After Triggering the Bug

image

@dandeandean
Copy link
Author

@tjex @Rahlir I am still investigating the root cause of this issue. In the mean time could you take a look at this? I think it may be worth closing this out so there's no crash. Let me know

@tjex
Copy link
Member

tjex commented Jan 23, 2025

Great, thanks for this!! There's been a lot of activity here all of sudden, and I'm a little down on free time at the moment. So just a heads up that I may take a bit to get around to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants