Ver Fonte

update the simplreRefName rule to fix freezing the page. microsoft/monaco-editor#2484

Choe Changwon há 4 anos atrás
pai
commit
57a88a08c2

+ 6 - 0
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: '#####',

+ 3 - 4
src/restructuredtext/restructuredtext.ts

@@ -54,10 +54,9 @@ export const language = <languages.IMonarchLanguage>{
 	],
 
 	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: /(?:[ -:/'"<([{])/,