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-31 08:47:03 +03:00
parent f4c7678135
commit 181ddf5ed7

View File

@ -5386,32 +5386,29 @@ class bslHelper {
/**
* Finds signatures provided for global functions
*
* @param {SignatureHelpContext} context signature help context
* @param {object} data objects from BSL-JSON dictionary
*
* @returns {SignatureHelp} helper with signatures
*/
getCommonSigHelp(data) {
getCommonSigHelp(context, data) {
let helper = null;
let funcName = this.getFuncName();
let funcName = context.methodName.toLowerCase();
if (funcName) {
for (const [key, value] of Object.entries(data)) {
for (const [key, value] of Object.entries(data)) {
if (value[this.nameField].toLowerCase() == funcName) {
if (value[this.nameField].toLowerCase() == funcName) {
let signatures = this.getMethodsSignature(value);
let signatures = this.getMethodsSignature(value);
if (signatures.length) {
helper = {
activeParameter: this.getSignatureActiveParameter(),
activeSignature: 0,
signatures: signatures,
}
if (signatures.length) {
helper = {
activeParameter: context.activeParameter,
activeSignature: 0,
signatures: signatures,
}
}
}
@ -5615,10 +5612,10 @@ class bslHelper {
helper = this.getClassSigHelp(context, bslGlobals.classes);
if (!helper)
helper = this.getCommonSigHelp(bslGlobals.globalfunctions);
helper = this.getCommonSigHelp(context, bslGlobals.globalfunctions);
if (!helper)
helper = this.getCommonSigHelp(bslGlobals.customFunctions);
helper = this.getCommonSigHelp(context, bslGlobals.customFunctions);
}