mirror of
https://github.com/dnlbauer/obsidian-dataview-autocompletion.git
synced 2026-09-10 22:25:29 +00:00
fix: indexing not working if there are non-markdown files
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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]]);
|
||||
|
||||
3
test-vault/.obsidian/community-plugins.json
vendored
3
test-vault/.obsidian/community-plugins.json
vendored
@@ -1,5 +1,6 @@
|
||||
[
|
||||
"sample-plugin",
|
||||
"dataview",
|
||||
"obsidian-dataview-autocompletion"
|
||||
"obsidian-dataview-autocompletion",
|
||||
"dataview-autocompletion"
|
||||
]
|
||||
1
test-vault/not-a-markdown-file.json
Normal file
1
test-vault/not-a-markdown-file.json
Normal file
@@ -0,0 +1 @@
|
||||
{"test": "this is a test file"}
|
||||
Reference in New Issue
Block a user