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:
parent
dd7eb96fcf
commit
777ba906c5
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
pic/
|
||||
release/
|
||||
src/.vscode/
|
||||
src/src.zip
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
BIN
src/src.zip
BIN
src/src.zip
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user