jplattel / obsidian-query-language

An Obsidian plugin allowing you to query your notes
176 stars 6 forks source link

Code Review #10

Closed lishid closed 3 years ago

lishid commented 3 years ago

https://github.com/jplattel/obsidian-query-language/blob/e2d9ca5d4e1d4f640c4517a2360e59c222d8cdd1/src/main.ts#L88 Please don't use cachedData. This is an internal API that is sometimes null or undefined.

jplattel commented 3 years ago

Yes, I'm migrating to getAllMarkdownFiles in the next version, will update this issue when I'm done working on it :)

jplattel commented 3 years ago

Hey @lishid , I've removed the cachedData reference in the latest commits!

Just one more thing, I'm currently using ctx.sourcePath at https://github.com/jplattel/obsidian-query-language/blob/main/src/renderer.ts#L57 to determine the current file the renderer is processing. Since this attribute is not public, is there any other way to determine the path of the current note?

lishid commented 3 years ago

You can keep that there, we'll probably expose it one day since I can't think of anything better.

jplattel commented 3 years ago

Thanks! Closing this issues as it's solved in 2.0.0! :)