1
0
mirror of https://github.com/salexdv/bsl_console.git synced 2025-02-07 13:31:37 +02:00

Custom suggestions for in "Query" and "DCS" modes

This commit is contained in:
tormozit 2021-05-10 19:37:08 +03:00
parent dd7eb96fcf
commit 777ba906c5
4 changed files with 55 additions and 36 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
pic/
release/
src/.vscode/
src/src.zip

View File

@ -3245,7 +3245,14 @@ class bslHelper {
getQueryCompletition() {
let suggestions = [];
// +++
if (customSuggestions.length) {
suggestions = customSuggestions.slice();
customSuggestions = [];
}
else
// ---
{
if (!this.requireQueryValue()) {
if (!this.requireQueryRef()) {
@ -3280,7 +3287,7 @@ class bslHelper {
this.getQueryValuesCompletition(suggestions, bslQuery.values, monaco.languages.CompletionItemKind.Enum);
}
}
if (suggestions.length)
return { suggestions: suggestions }
else
@ -3296,7 +3303,14 @@ class bslHelper {
getDCSCompletition() {
let suggestions = [];
// +++
if (customSuggestions.length) {
suggestions = customSuggestions.slice();
customSuggestions = [];
}
else
// ---
{
if (!this.requireQueryValue()) {
if (this.lastOperator != '"') {
@ -3314,7 +3328,7 @@ class bslHelper {
this.getQueryValuesCompletition(suggestions, bslQuery.values, monaco.languages.CompletionItemKind.Enum);
}
}
if (suggestions.length)
return { suggestions: suggestions }
else

View File

@ -496,6 +496,10 @@ define([], function () {
completionProvider: {
triggerCharacters: ['.', '(', '&'],
provideCompletionItems: function (model, position, context, token) {
let widget = document.querySelector('.suggest-widget');
widget.style.display = '';
widget.style.visibility = '';
let bsl = new bslHelper(model, position);
let completition = bsl.getQueryCompletition(query_language);
if (generateBeforeShowSuggestEvent) {

Binary file not shown.