vscode-markdown-notes icon indicating copy to clipboard operation
vscode-markdown-notes copied to clipboard

Follow link if the link text is in the first part of the filename

Open lucabol opened this issue 5 years ago • 1 comments

I want to use a system similar to The Archive where the note filename is in the format ID Title.md and the links are in the format [[ID]]. In other words, the filename contains the title while the link doesn't.

My naive intuition is that the code that follows a link can look for all the files that start with the link name (ID) and return the shortest named one. I think this is backward compatible as everything else would work as now.

lucabol avatar Nov 07 '20 19:11 lucabol

I am not opposed to adding this as a separate command, but I don't think we should override Go To Definition because the fuzzy resolve logic prolly will conflict with the useful feature provided by Create New Note On Missing Go To Definition.

I think maybe you could just implement a new command / interface and then allow people to bind a custom keyboard shortcut to it -- take a look at the implementation of vscodeMarkdownNotes.notesForWikiLink which is a sort of fuzzy resolver for notes.

You might call this new command vscodeMarkdownNotes.headMatchForWikiLink (and possibly add a new config, ``vscodeMarkdownNotes.headMatchForWikiLinkMinCharsToMatchto only return a result if the firstn` characters match).

kortina avatar Nov 11 '20 02:11 kortina