blakedietz/vscode-nested-tags

Bug: Cannot destructure property `displayName` of 'undefined' or 'null'.

Opened this issue · 3 comments

When typing a lot of tags out, I seem to be getting this error for the currently released project at v1.0.1.

Cannot destructure property `displayName` of 'undefined' or 'null'.

I was noticing that incorrect entries were being left in the tree from watching typing of tags in relatively large documents ~500 lines. I'm thinking that I'll just need to debounce on file change to reduce the chance of the wrong tags being put into the tree.

The source of this is caused by tags that have a . in them.

<!--@nested-tags:some.md-->

Breaks the plugin.

I found another case can also cause this problem:
using a real tab instead of spaces before the tag keword.
For example:

---
title: Hello nested tags
tags:
	- topic  # a real tab instead of spaces
	- here/is/a/nested/example   # a real tab instead of spaces
---

Debugging is non-trivial. It will be great if the extension can complain something it can not handle...