From 147731d78348e5fe088821244b8165d13d6b3c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Thu, 11 Jan 2024 19:16:47 +0100 Subject: [PATCH] fix #189 --- CHANGELOG.md | 6 ++++++ src/autocomplete.ts | 2 +- src/composables/CodeEditor.ts | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0777d7a..c3c928b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.0.3 + +* dont automatically open autocomplete, press `ctrl+space` to open, fixes [#189][i189] + +[i189]: https://github.com/cars10/elasticvue/issues/189 + ## 1.0.2 * fixes issue with old versions of elasticsearch that do not provide a uuid, fixes [#182][i182] diff --git a/src/autocomplete.ts b/src/autocomplete.ts index 692b6d1c..5f325ef9 100644 --- a/src/autocomplete.ts +++ b/src/autocomplete.ts @@ -5,7 +5,7 @@ export const queryKeywords = [ 'fields', 'type', 'filter', 'boost', 'operator', 'cutoff_frequency', 'bool', 'must', 'should', 'term', 'terms', 'prefix', - 'query', 'match', 'match_phrase', 'range', 'gte', 'lte', + 'query', 'query_string', 'match', 'match_phrase', 'range', 'gte', 'lte', '_source' ] diff --git a/src/composables/CodeEditor.ts b/src/composables/CodeEditor.ts index 0eb224fd..d7ceb497 100644 --- a/src/composables/CodeEditor.ts +++ b/src/composables/CodeEditor.ts @@ -24,6 +24,8 @@ import { queryKeywords, queryValues } from '../autocomplete.ts' */ const completions = (context: any) => { const word = context.matchBefore(/\w*/) + if (!context.explicit) return null + const nodeBefore = syntaxTree(context.state).resolveInner(context.pos, -1) if (nodeBefore.name === 'Property') { return {