From 57a88a08c2c8906a3a6d832c588ae896411255db Mon Sep 17 00:00:00 2001 From: Choe Changwon Date: Mon, 14 Jun 2021 01:06:51 +0900 Subject: [PATCH] update the simplreRefName rule to fix freezing the page. microsoft/monaco-editor#2484 --- src/restructuredtext/restructuredtext.test.ts | 6 ++++++ src/restructuredtext/restructuredtext.ts | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/restructuredtext/restructuredtext.test.ts b/src/restructuredtext/restructuredtext.test.ts index f833ed66..dae5bd0b 100644 --- a/src/restructuredtext/restructuredtext.test.ts +++ b/src/restructuredtext/restructuredtext.test.ts @@ -6,6 +6,12 @@ import { testTokenization } from '../test/testRunner'; testTokenization('restructuredtext', [ + [ + { + line: 'some property = Text::ProxyLibrary::ProxyInterfaceTest::DeleteProxyInterface();', + tokens: [{ startIndex: 0, type: '' }] + } + ], [ { line: '#####', diff --git a/src/restructuredtext/restructuredtext.ts b/src/restructuredtext/restructuredtext.ts index 6b5e4344..0f7eee15 100644 --- a/src/restructuredtext/restructuredtext.ts +++ b/src/restructuredtext/restructuredtext.ts @@ -54,10 +54,9 @@ export const language = { ], alphanumerics: /[A-Za-z0-9]/, - alphanumericsplus: /[A-Za-z0-9-_+:.]/, - simpleRefNameWithoutBq: /(?:@alphanumerics@alphanumericsplus*@alphanumerics)+|(?:@alphanumerics+)/, - simpleRefName: /(?:`@simpleRefNameWithoutBq`|@simpleRefNameWithoutBq)/, - phrase: /@simpleRefName(?:\s@simpleRefName)*/, + simpleRefNameWithoutBq: /(?:@alphanumerics[-_+:.]*@alphanumerics)+|(?:@alphanumerics+)/, + simpleRefName: /(?:`@phrase`|@simpleRefNameWithoutBq)/, + phrase: /@simpleRefNameWithoutBq(?:\s@simpleRefNameWithoutBq)*/, citationName: /[A-Za-z][A-Za-z0-9-_.]*/, blockLiteralStart: /(?:[!"#$%&'()*+,-./:;<=>?@\[\]^_`{|}~]|[\s])/, precedingChars: /(?:[ -:/'"<([{])/,