From dc0958a5bb8a6f90359d6d41735cd305a65e60aa Mon Sep 17 00:00:00 2001 From: salexdv Date: Sat, 27 Aug 2022 09:44:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BF=D0=B0=D1=80=D1=81=D0=B8=D0=BD=D0=B3=D0=B0?= =?UTF-8?q?=20=D0=BE=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BF?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bsl_helper.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bsl_helper.js b/src/bsl_helper.js index a7b36fe..029b3ba 100644 --- a/src/bsl_helper.js +++ b/src/bsl_helper.js @@ -6079,20 +6079,21 @@ class bslHelper { line_number++; - let params = parametersStr.split(','); + const params = parametersStr.split(','); + const range = new monaco.Range(line_number, 1, funcLineNumber, 1); + const func_model = monaco.editor.createModel(model.getValueInRange(range)); params.forEach(function (param) { let param_full_name = param.split('=')[0].trim(); let param_name = param_full_name.replace(/знач\s+/gi, ''); let pattern = '\/\/ параметры:[\\s\\SS\\n\\t]*?' + param_name + '([\\s\\SS\\n\\t]*?)(?:\/\/\\s{1,4}[a-zA-Z0-9\u0410-\u044F_])'; - let range = new monaco.Range(line_number, 1, funcLineNumber, 1); - let match = Finder.findMatches(model, pattern, range); + let match = Finder.findMatches(func_model, pattern); let param_description = ''; if (match && !match.length) { pattern = '\/\/ параметры:[\\s\\SS\\n\\t]*?' + param_name + '([\\s\\SS\\n\\t]*?)(?:\/\/\\s*$)'; - match = Finder.findMatches(model, pattern, range); + match = Finder.findMatches(func_model, pattern); } if (match && match.length) {