mirror of
https://github.com/salexdv/bsl_console.git
synced 2024-11-28 08:48:48 +02:00
Тест подсказки методов и полей внешних источников
This commit is contained in:
parent
7d1cbc4409
commit
5336a97e9d
@ -1909,8 +1909,7 @@ class bslHelper {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of methods owned by object
|
||||
* and fills the suggestions by it
|
||||
* Gets the list of methods owned by external data source
|
||||
*
|
||||
* @param {array} suggestions the list of suggestions
|
||||
* @param {object} obj object from BSL-JSON dictionary
|
||||
@ -1941,18 +1940,7 @@ class bslHelper {
|
||||
let ref = null;
|
||||
if (mvalue.hasOwnProperty('ref'))
|
||||
ref = mvalue.ref;
|
||||
|
||||
if (ref && ref.indexOf(':') != -1) {
|
||||
if (metadataKey && medatadaName) {
|
||||
if (ref.indexOf(':metadata') != -1)
|
||||
ref = metadataKey + '.metadata';
|
||||
else if (ref.indexOf(':obj') != -1)
|
||||
ref = metadataKey + '.' + medatadaName + '.obj';
|
||||
else
|
||||
ref = metadataKey + '.' + medatadaName + '.ref';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ref || signatures.length) {
|
||||
// If the attribute contains a ref, we need to run the command to save the position of ref
|
||||
command = {
|
||||
@ -1981,34 +1969,8 @@ class bslHelper {
|
||||
|
||||
}
|
||||
|
||||
if (methodsName == 'objMethods' && this.objectHasProperties(obj, 'items', medatadaName, 'registerRecords')) {
|
||||
|
||||
let recName = obj.items[medatadaName].registerRecords[this.nameField];
|
||||
let list = [];
|
||||
|
||||
obj.items[medatadaName].registerRecords.registers.forEach(function (regName) {
|
||||
list.push({
|
||||
name: regName.split('.')[1],
|
||||
ref: regName,
|
||||
kind: monaco.languages.CompletionItemKind.Function,
|
||||
});
|
||||
});
|
||||
|
||||
let command = { id: 'vs.editor.ICodeEditor:1:saveref', arguments: [{ "name": recName, "data": { "list": list } }] }
|
||||
|
||||
suggestions.push({
|
||||
label: recName,
|
||||
kind: monaco.languages.CompletionItemKind.Function,
|
||||
insertText: recName,
|
||||
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,
|
||||
command: command
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user