mirror of
https://github.com/salexdv/bsl_console.git
synced 2024-11-24 08:33:29 +02:00
Функция для подсказок имен табличных частей #266
This commit is contained in:
parent
0a2785318b
commit
1f8fbd5d65
@ -1541,6 +1541,30 @@ class bslHelper {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of tabulars owned by object
|
||||
* (Catalog, Document, etc) and fills the suggestions by it
|
||||
*
|
||||
* @param {array} suggestions the list of suggestions
|
||||
* @param {object} tabulars object with tabulars description
|
||||
*/
|
||||
fillSuggestionsForItemTabulars(suggestions, tabulars) {
|
||||
|
||||
for (const [key, value] of Object.entries(tabulars)) {
|
||||
|
||||
let command = { id: 'vs.editor.ICodeEditor:1:saveref', arguments: [{'name': key, "data": { "ref": 'universalObjects.ТабличнаяЧасть', "sig": null } }]};
|
||||
|
||||
suggestions.push({
|
||||
label: key,
|
||||
kind: monaco.languages.CompletionItemKind.Unit,
|
||||
insertText: key,
|
||||
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,
|
||||
command: command
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of properties (attributes) owned by object
|
||||
@ -1558,6 +1582,10 @@ class bslHelper {
|
||||
|
||||
if (obj.hasOwnProperty('resources'))
|
||||
objects.push(obj.resources);
|
||||
|
||||
if (obj.hasOwnProperty('tabulars')) {
|
||||
this.fillSuggestionsForItemTabulars(suggestions, obj.tabulars)
|
||||
}
|
||||
|
||||
for (let idx = 0; idx < objects.length; idx++) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user