dendron
dendron copied to clipboard
Schema template does not get populated when `namespace: true` is set
Please select the area your bug applies to. (Multiple selections are Possible. You can leave blank if you're not sure.)
- [ ] Workspace. VSCode workspace, vaults, Intellisense/autocomplete, Dendron settings
- [x] Lookup. Dendron's Lookup Command
- [ ] Views. Dendron Preview, Tree View, Side Panels in the UI
- [ ] Schema. Dendron Schemas
- [ ] Pod. Data import from / export to Dendron
- [ ] Publish. External Site Publish
- [ ] Markdown. Markdown features, such as syntax support and features
Describe the bug
When a schema is created and a level has both a template and namespace: true
is set then the notes created at this and all subsequent levels do not get populated with the template. Removing the namespace: true
correctly populates the template
To Reproduce
Steps to reproduce the behavior:
- Create a schema file as follows:
version: 1 imports: [] schemas: - id: test children: - testing title: test parent: root - id: testing pattern: "*" title: "testing" # namespace: true template: id: template.test type: note
- Create some
template.test
with literally anything in it - Create a note called
test.test1
- it should be populated with your template - Uncomment the namespace line in the schema and save
- Create a note called
test.test2
andtest.test2.test3
and see neither are populated with the template.
Expected behavior
Namespace set to true should apply the template to that and all subsequent levels in the namespace
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information)
- OS: Windows
- Versions (all that apply to bug):
- Dendron Extension: 0.107.2
- VS Code version: 1.68.1
- Dendron CLI: N/A
Additional context
Dendron Log file
I'm seeing the same behavior, where templates are only successfully applied if the schema uses the pattern: "*"
construction.
For whatever it's worth, I don't think this is recently introduced behavior, and I also think it's a bug. I remember being very confused by this when I set up my own schemas and templates a while ago, but I assumed at the time I was just misunderstanding something. The schemas I currently use with templates rely on the pattern: "*"
construction.
Thank you for the report. I can reproduce this. Taking a look!
@rlh1994 A fix should go out either with the next release or the release after that.
Note that namespace schema nodes only match with the note with an exact match, and its immediate children. It does not recursively go down to an arbitrary note depth. So not all subsequent levels under the namespace will have the schema (and the template) applied.
See: https://wiki.dendron.so/notes/c5e5adde-5459-409b-b34d-a0d75cbb1052/#namespace
making a schema node a namespace automatically brings its immediate children as part of the schema, even if they are not explicitly defined in the schema definition. it will also automatically set the pattern to {namespace}.*
This was a bug that went unnoticed for quite a long time 🙂 thanks for catching it!
@hikchoi thanks! Is there any way to go to an arbitrary depth with the template currently? Or should I submit a feature request for that?
Not currently, that would be a feature request
On Fri, Aug 12, 2022 at 5:03 AM Ryan Hill @.***> wrote:
@hikchoi https://github.com/hikchoi thanks! Is there any way to go to an arbitrary depth with the template currently? Or should I submit a feature request for that?
— Reply to this email directly, view it on GitHub https://github.com/dendronhq/dendron/issues/3381#issuecomment-1213039583, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABPIPT2MYWANE742ZBJO43VYY4Q7ANCNFSM56HW74QQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
The fix has been shipped with v109. Please give it a try again and let us know if there are outstanding concerns related to this problem.
This issue has been automatically closed because there has been no response to our request for more information from the original author. We don't have enough information to take action. Please reopen if the question from the maintainer has been answered and the issue is still valid.