Skip to content

fix: Do not suggest 'Create file' code action for broken heading references#320

Merged
artempyanykh merged 1 commit into
mainfrom
309-fixing-link-to-non-existing-heading-xyz-in-document-abc-deletes-content-of-abc-file
Jul 6, 2024
Merged

fix: Do not suggest 'Create file' code action for broken heading references#320
artempyanykh merged 1 commit into
mainfrom
309-fixing-link-to-non-existing-heading-xyz-in-document-abc-deletes-content-of-abc-file

Conversation

@artempyanykh

Copy link
Copy Markdown
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
@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