fix: indexing not working if there are non-markdown files

This commit is contained in:
Daniel Bauer
2024-12-17 18:47:41 +01:00
parent 97391f4256
commit 2dae1175f8
5 changed files with 9 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
{
"id": "dataview-autocompletion",
"name": "Dataview Autocompletion",
"version": "0.8.0",
"version": "0.8.1",
"minAppVersion": "0.15.0",
"description": "Adds autocompletion to Dataview metadata fields",
"author": "Daniel Bauer",

View File

@@ -1,6 +1,6 @@
{
"name": "obsidian-dataview-autocompletion",
"version": "0.8",
"version": "0.8.1",
"description": "This is a plugin for Obsidian that provides autocompletion for Dataview metadata fields",
"main": "main.js",
"scripts": {

View File

@@ -159,6 +159,8 @@ export class DataviewSuggester extends EditorSuggest<String> {
}
const page = dataviewApi.page(file.path);
if (page === undefined) continue; // not a markdown file
const fields = Object.keys(page)
.filter((k) => k !== "file")
.map((k) => [k, page[k]]);
@@ -218,6 +220,8 @@ export class DataviewSuggester extends EditorSuggest<String> {
const updateCompositeValues = [];
const page = getAPI(this.app).page(file.path);
if (page === undefined) return; // not a markdown file
const fields = Object.keys(page)
.filter((k) => k !== "file")
.map((k) => [k, page[k]]);

View File

@@ -1,5 +1,6 @@
[
"sample-plugin",
"dataview",
"obsidian-dataview-autocompletion"
"obsidian-dataview-autocompletion",
"dataview-autocompletion"
]

View File

@@ -0,0 +1 @@
{"test": "this is a test file"}