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: Do not suggest 'Create file' code action for broken heading references #320

Conversation

artempyanykh
Copy link
Owner

Previously, the code would assume lack of references meant the file doesn't exist. However, for references such as [[file#head]] this would also trigger when there's no head heading in an existing file file.

When someone used this code action it wiped out the existing file.

Now we extract the doc part and check that the doc exists.

…rences

Previously, the code would assume lack of references meant the file doesn't exist. However, for references such as [[file#head]] this would also trigger when there's no `head` heading in an existing file `file`.

When someone used this code action it wiped out the existing file.

Now we extract the doc part and check that the doc exists.
@artempyanykh artempyanykh merged commit 66a79f0 into main Jul 6, 2024
3 checks passed
@artempyanykh artempyanykh deleted the 309-fixing-link-to-non-existing-heading-xyz-in-document-abc-deletes-content-of-abc-file branch July 6, 2024 20:14
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.

Fixing "Link to non-existing heading 'xyz' in document 'abc'" deletes content of 'abc' File.
1 participant