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

Allow completion for title in create note from template #1310

Open
dstengle opened this issue Dec 4, 2023 · 3 comments
Open

Allow completion for title in create note from template #1310

dstengle opened this issue Dec 4, 2023 · 3 comments

Comments

@dstengle
Copy link

dstengle commented Dec 4, 2023

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

I use templates that create a note with the date appended to the title in a specific daily directory. For instance I have a 1:1 meeting template where I use the name of the person as a title (and a wikilink inside the note).

Since there is no completion in the create note, I have to remember or copy the name of the person I am meeting with and this is a bit frustrating since I could get different spellings if I'm not careful. This is important because my template creates a wikilink based on name and I can easily cross-reference all of my meetings with someone.

The completion might not normally make sense, but in my case since I append the date the resulting filename will be unique.

Describe the solution you'd like

As a user, I would like the create from template command to allow completion of wikilinks in the title popup.

Describe alternatives you've considered

I've considered calling the command from a macro, but it doesn't appear to take arguments.

Screenshots or Videos

No response

@riccardoferretti
Copy link
Collaborator

I don't believe VS Code supports autocompletion in the input box.

My preferred approach to solving your issue is passing arguments to the command. Also, the create-note command does take arguments - see here

Otherwise have individual templates for each person.

You could also (maybe) use a combination of FOAM_TITLE (which you will be prompted to provide) with FOAM_DATE_* variables to achieve what you want.

@dstengle
Copy link
Author

I do use the Date already to make a new title from the one passed in to keep them all unique and easy to reference. Basically when I hover over someone's name, I get a dated list of all of the notes where I've mentioned them.

I'll take a look at the command docs. Maybe I could make my own command that takes a link to a person and creates a note from template and overwrites the link with the one for the specific note.

What about drop-down completion like the template selection itself, just like the list of templates or the general command drop-down?

@riccardoferretti
Copy link
Collaborator

Yes that would be possible and actually the textbox would kinda mimic an autocomplete, thanks for pointing that out.

This would require some enhancements in the way variables are passed to the template, both to support custom variables (which I have been thinking of doing for some time) and, more critically, to define that a variable need be resolved amongst a list of values (in order to trigger the quickPick.

So, there is a design question to answer (how is such a thing exposed to the user) and the implementation itself.
If someone is interested in giving it a go I can provide some pointers/guidance.

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

No branches or pull requests

2 participants