diff --git a/src/fsharp/fsharp.test.ts b/src/fsharp/fsharp.test.ts index 2fe82857..c542c833 100644 --- a/src/fsharp/fsharp.test.ts +++ b/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' } + ] }] ]); diff --git a/src/fsharp/fsharp.ts b/src/fsharp/fsharp.ts index 42fce872..7e08d720 100644 --- a/src/fsharp/fsharp.ts +++ b/src/fsharp/fsharp.ts @@ -132,9 +132,11 @@ export const language = { ], comment: [ - [/[^\*]+/, 'comment'], + [/[^*(]+/, 'comment'], [/\*\)/, 'comment', '@pop'], - [/\*/, 'comment'] + [/\*/, 'comment'], + [/\(\*\)/, 'comment'], + [/\(/, 'comment'] ], string: [