1
0
mirror of https://github.com/salexdv/bsl_console.git synced 2024-11-28 08:48:48 +02:00

Подсказка методов таблиц внешнего источника с учетом типа данных таблицы

This commit is contained in:
salexdv 2022-05-03 09:26:53 +03:00
parent 5d391bed28
commit e554505f36

View File

@ -1914,8 +1914,9 @@ class bslHelper {
* @param {array} suggestions the list of suggestions
* @param {object} obj object from BSL-JSON dictionary
* @param {sting} methodsName the name of node (objMethods, refMethods)
* @param {sting} dataType the type of table (ObjectData, NonobjectData)
*/
getExternalDataSourcesMethods(suggestions, obj, methodsName, metadataKey, medatadaName) {
getExternalDataSourcesMethods(suggestions, obj, methodsName, dataType) {
if (obj.hasOwnProperty(methodsName)) {
@ -1923,6 +1924,8 @@ class bslHelper {
for (const [mkey, mvalue] of Object.entries(obj[methodsName])) {
if (!dataType || !mvalue.hasOwnProperty('tableDataType') || mvalue.tableDataType == dataType) {
let command = null;
let postfix = '';
let post_action = null;
@ -1973,6 +1976,8 @@ class bslHelper {
}
}
/**
* Gets the list of tables and cubes owned by external data source
*
@ -2009,11 +2014,15 @@ class bslHelper {
if (item_node) {
for (const [ikey, ivalue] of Object.entries(item_node.items)) {
if (item_name) {
this.getExternalDataSourcesMethods(suggestions, bslMetadata.externalDataSources, methods_name, metadataName, metadataItem);
if (ikey.toLowerCase() == item_name.toLowerCase()) {
let data_type = ivalue.hasOwnProperty('tableDataType') ? ivalue.tableDataType : '';
this.getExternalDataSourcesMethods(suggestions, bslMetadata.externalDataSources, methods_name, data_type);
}
}
else {
for (const [ikey, ivalue] of Object.entries(item_node.items)) {
suggestions.push({
label: ikey,
kind: monaco.languages.CompletionItemKind.Unit,