foam icon indicating copy to clipboard operation
foam copied to clipboard

markdown.experimental.updateLinksOnFileMove.enabled

Open mrienstra opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.

The markdown.experimental.updateLinksOnFileMove.enabled setting was released in the August 2022 version (1.71) of Visual Studio Code.

With this new experimental setting enabled, VS Code will automatically update links and images in Markdown when files are moved or renamed in the VS Code Explorer:

This new behavior can be enabled using the markdown.experimental.updateLinksOnFileMove.enabled setting. You can control the types of files affected using markdown.experimental.updateLinksOnFileMove.externalFileGlobs.

I haven't tested it yet, but I can imagine this new setting might already clash with Foam's links.sync.enable, though I'd imagine very few people will be affected if so.

Still, it seems wise to keep an eye on updateLinksOnFileMove, in the near future it may no longer be "experimental" (though I have no idea how long that process generally takes).

Describe the solution you'd like

When (if) it becomes a full-fledged setting, some possibilities:

  1. Inform users that they shouldn't enable it, if it clashes with Foam.
  2. Detect when it is enabled (alongside Foam's links.sync.enable), and: A) Warn the user and / or B) Disable links.sync.enable
  3. Alter Foam to rely on VS Code's updateLinksOnFileMove -- maybe it'll be a better implementation in some way, and doing so would simplify Foam, meaning fewer possible sources of bugs / devs can focus efforts on other features.

mrienstra avatar Sep 11 '22 03:09 mrienstra

Yes, probably in Foam we should change the setting to having more options:

  • enable
  • disable
  • enable for wikilinks only

Then the user can decide whether to have the renaming performed by VS Code or Foam

riccardoferretti avatar Sep 11 '22 08:09 riccardoferretti