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-08-31 18:50:12 +03:00
parent 5718f65162
commit 7825d2b060

View File

@ -4646,16 +4646,19 @@ class bslHelper {
/**
* Fills array of completion for virtual tables of registers in source
* or for tabulars of metadata object
*
* @param {object} data objects from BSL-JSON dictionary
* @param {string} metadataItem name of metadata item like (ЦеныНоменклатуры/ProductPrices, СвободныеОстатки/AvailableStock)
* @param {array} suggestions array of suggestions for provideCompletionItems
*/
getQuerySourceMetadataRegTempraryTablesCompletion(data, metadataItem, suggestions) {
getQuerySourceMetadataTabularsRegTempraryTables(data, metadataItem, suggestions) {
for (const [ikey, ivalue] of Object.entries(data.items)) {
if (ikey.toLowerCase() == metadataItem.toLowerCase() && ivalue.hasOwnProperty('type')) {
if (ikey.toLowerCase() == metadataItem.toLowerCase()) {
if (ivalue.hasOwnProperty('type')) {
let tables = this.getRegisterVirtualTables(ivalue.type);
@ -4671,6 +4674,22 @@ class bslHelper {
}
}
else if (ivalue.hasOwnProperty('tabulars')) {
for (const [tkey, tvalue] of Object.entries(ivalue.tabulars)) {
suggestions.push({
label: tkey,
kind: monaco.languages.CompletionItemKind.Unit,
insertText: tkey,
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet
});
}
}
}
}
@ -4772,8 +4791,7 @@ class bslHelper {
this.getQuerySourceForExternalData(value, metadataItem, metadataFunc, suggestions, kind);
}
else if (!metadataFunc && 2 < maxLevel) {
this.getQuerySourceMetadataRegTempraryTablesCompletion(value, metadataItem, suggestions)
this.getQuerySourceMetadataTabularsRegTempraryTables(value, metadataItem, suggestions)
}
}