From c59b23371afd496bb41e2efe1939d54162301d37 Mon Sep 17 00:00:00 2001 From: salexdv Date: Tue, 25 Jan 2022 07:53:01 +0300 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=BC=D0=B5=D0=BD=D0=B0=20findMatc?= =?UTF-8?q?hes=20->=20regexp=20(Finder)?= 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 981532e..6f46e2b 100644 --- a/src/bsl_helper.js +++ b/src/bsl_helper.js @@ -4742,7 +4742,7 @@ class bslHelper { let helper = null; - let match = this.model.findPreviousMatch('(', this.position, false); + let match = Finder.findPreviousMatch(this.model, '\\(', this.position); if (match) { @@ -4977,7 +4977,7 @@ class bslHelper { line_number++; - const matches = model.findMatches('параметры:', new monaco.Range(line_number, 1, funcLineNumber, 1), true, false); + const matches = Finder.findMatches(model, 'параметры:', new monaco.Range(line_number, 1, funcLineNumber, 1)); if (matches && matches.length) { let range = new monaco.Range(line_number, 1, matches[0].range.startLineNumber, matches[0].range.startColumn); @@ -5030,7 +5030,8 @@ class bslHelper { 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 match = model.findMatches(pattern, new monaco.Range(line_number, 1, funcLineNumber, 1), true, false, null, true); + let range = new monaco.Range(line_number, 1, funcLineNumber, 1); + let match = Finder.findMatches(model, pattern, range); let param_description = ''; if (match && match.length) { @@ -5064,7 +5065,7 @@ class bslHelper { const model = monaco.editor.createModel(moduleText); const pattern = '(?:процедура|функция|procedure|function)\\s+([a-zA-Z0-9\u0410-\u044F_]+)\\(([a-zA-Z0-9\u0410-\u044F_,\\s\\n="]*)\\)\\s+(?:экспорт|export)'; - const matches = model.findMatches(pattern, true, true, false, null, true); + const matches = Finder.findMatches(model, pattern); if (matches && matches.length) {