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

Changing a file name does not update backlinks #305

Closed
antistic opened this issue Oct 29, 2020 · 16 comments
Closed

Changing a file name does not update backlinks #305

antistic opened this issue Oct 29, 2020 · 16 comments
Assignees
Labels
foam-core Related to API, core model or feature
Milestone

Comments

@antistic
Copy link

Consider a file

# File 1

Link to [[File 2]]

If you rename file-2.md, there is no prompt to update backlinks in file 1. This is something Obsidian supports, and VSCode supports this for other relative links like javascript imports.

I looked to see if there was VSCode support for this, but they labelled it as an extension candidate, and even if they did add it I don't know if that would work for WikiLinks.

@riccardoferretti riccardoferretti added this to the 0.6.0 milestone Oct 29, 2020
@riccardoferretti
Copy link
Collaborator

thx @ant-i-c-s, support for refactoring is on the roadmap, will be coming soon

@riccardoferretti riccardoferretti added the foam-core Related to API, core model or feature label Nov 9, 2020
@riccardoferretti riccardoferretti modified the milestones: 0.7.0, 0.8.0 Nov 21, 2020
@ErikPlachta
Copy link

What I'm finding is that it wont even let you change backlinks manually. It updates with the old file name.
-Am I right that the only option ATM is delete and create a new file or have a broken backlink?

@riccardoferretti
Copy link
Collaborator

@ErikPlachta the second problem should have been addressed by #349, do you have this issue with Foam 0.6.0?

@ErikPlachta
Copy link

@riccardoferretti - I'm embarrassed to say I don't know how to check. 😳 I just started playing with Foam yesterday and learning how it works.

Thinking I'm going to export my notes, burn it down, and build it back up vs wasting time.

@ysl2
Copy link

ysl2 commented Nov 24, 2020

I was wondering if it would also be possible to automatically update backlinks when moving files?

@riccardoferretti
Copy link
Collaborator

riccardoferretti commented Nov 24, 2020

@ErikPlachta check in your extension tab and see the version number next to the Foam extension:

image

@ysl970629 it will most definitely be possible 👍

@ErikPlachta
Copy link

Confirmed on 0.6.0

@riccardoferretti
Copy link
Collaborator

you mean the bug is still there in 0.6.0?

@ErikPlachta
Copy link

@riccardoferretti said, "you mean the bug is still there in 0.6.0?"

Yes, that is correct. I'm going to read through the documentation tonight and see if I'm breaking a rule somewhere I don't realize it.

For context, here is a photo of code next to preview view.

Red line on right to point out the garbage info from broken back-links for file names I've changed after foam auto-created them.

image

@ysl2
Copy link

ysl2 commented Nov 26, 2020

A plugin can update the regular markdown links[](), I know it maybe not relative to this issue... I just remind you there is a plugin which can update [](), and I think if it could helps you a bit :-) @riccardoferretti

https://marketplace.visualstudio.com/items?itemName=mathiassoeholm.markdown-link-updater

@riccardoferretti
Copy link
Collaborator

thx @ErikPlachta @ysl970629
a major piece of work on linking is happening soon, this will be part of it

@ErikPlachta
Copy link

ErikPlachta commented Nov 26, 2020

No problem, love it and will keep using it.

I made a clean clone and disabled all extension except for required and verified issue still happening.

Should I make a bug report or anything else I can do to help?

@riccardoferretti
Copy link
Collaborator

thanks @ErikPlachta this issue will track the file renaming, which actually is totally decoupled from the improvements on the linking side - it will just be more precise once we the linking gets more robust

@riccardoferretti riccardoferretti modified the milestones: 0.8.0, 0.9.0 Jan 15, 2021
@riccardoferretti riccardoferretti modified the milestones: 0.9.0, 1.0.0 Feb 27, 2021
@ainar
Copy link

ainar commented May 18, 2021

Do you have any information on how you plan to implement the refactoring, just to know where we can help?

@riccardoferretti
Copy link
Collaborator

the approach I am thinking of atm is along the following flow:

  1. a file is renamed
  2. the watcher notified the FoamWorkspace
  3. the workspace/graph looks for connections to the existing file from other files
  4. the wikilinks are updated and the files saved

there are still a few open questions (e.g. how to handle files that are currently opened in a tab witihin VS Code)

@riccardoferretti
Copy link
Collaborator

closing as duplicate of #809 - moving the conversation there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
foam-core Related to API, core model or feature
Projects
None yet
Development

No branches or pull requests

5 participants