Forráskód Böngészése

Fixes Microsoft/monaco-editor#1278

Alex Dima 6 éve
szülő
commit
c362bfab0e
2 módosított fájl, 19 hozzáadás és 2 törlés
  1. 15 0
      src/fsharp/fsharp.test.ts
  2. 4 2
      src/fsharp/fsharp.ts

+ 15 - 0
src/fsharp/fsharp.test.ts

@@ -442,5 +442,20 @@ testTokenization('fsharp', [
 		tokens: [
 			{ startIndex: 0, type: 'number.float.fs' }
 		]
+	}],
+
+	[{
+		line: '(* This operator -> (*) should be ignored *) let i = 0',
+		tokens: [
+			{ startIndex: 0, type: 'comment.fs' },
+			{ startIndex: 44, type: '' },
+			{ startIndex: 45, type: 'keyword.let.fs' },
+			{ startIndex: 48, type: '' },
+			{ startIndex: 49, type: 'identifier.fs' },
+			{ startIndex: 50, type: '' },
+			{ startIndex: 51, type: 'delimiter.fs' },
+			{ startIndex: 52, type: '' },
+			{ startIndex: 53, type: 'number.fs' }
+		]
 	}]
 ]);

+ 4 - 2
src/fsharp/fsharp.ts

@@ -132,9 +132,11 @@ export const language = <ILanguage>{
 		],
 
 		comment: [
-			[/[^\*]+/, 'comment'],
+			[/[^*(]+/, 'comment'],
 			[/\*\)/, 'comment', '@pop'],
-			[/\*/, 'comment']
+			[/\*/, 'comment'],
+			[/\(\*\)/, 'comment'],
+			[/\(/, 'comment']
 		],
 
 		string: [