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

Работа над подсказками для полей таблиц в запросе (доработка подсказки для полей таблиц)

This commit is contained in:
salexdv 2020-12-19 13:11:24 +03:00
parent 374fee4b30
commit 3af12adbe3

View File

@ -259,6 +259,20 @@ class bslHelper {
}
/**
* Returns last character
*
* @returns {array} array with words
*/
getLastCharacter() {
let range = new monaco.Range(this.lineNumber, this.column - 1, this.lineNumber, this.column);
let content = this.model.getValueInRange(range);
return content ? content : '';
}
/**
* Determines if string contain class constructor (New|Новый)
*
@ -1768,7 +1782,7 @@ class bslHelper {
*/
getQueryFieldsCompletition(suggestions) {
if (this.lastExpression.endsWith('.')) {
if (this.getLastCharacter() == '.') {
// Let's find start of current query
let match = this.model.findPreviousMatch('(?:выбрать|select)', this.position, true);
@ -1949,8 +1963,8 @@ class bslHelper {
* @param {CompletionItemKind} kind - monaco.languages.CompletionItemKind (class, function, constructor etc.)
*/
getQueryTablesCompletition(suggestions, kind) {
if (!this.lastExpression.endsWith('.')) {
if (this.getLastCharacter() != '.') {
// Let's find start of current query
let startMatch = this.model.findPreviousMatch('(?:выбрать|select)', this.position, true);