From ebb42d0558f464d326114c6bda7f649eed495037 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 21 Aug 2018 11:15:02 -0700 Subject: [PATCH] Handle function expressions to consume line ending of single line comment since we rely on lookback of function completion (}) Fixes #455 after making change in comments to not consume line endings --- TypeScript.YAML-tmLanguage | 1 + TypeScript.tmLanguage | 4 ++++ TypeScriptReact.tmLanguage | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/TypeScript.YAML-tmLanguage b/TypeScript.YAML-tmLanguage index 746de037..5b2f85c2 100644 --- a/TypeScript.YAML-tmLanguage +++ b/TypeScript.YAML-tmLanguage @@ -655,6 +655,7 @@ repository: end: (?<=\}) patterns: - include: '#function-name' + - include: '#single-line-comment-consuming-line-ending' - include: '#function-body' function-name: diff --git a/TypeScript.tmLanguage b/TypeScript.tmLanguage index c955f867..4f409cb9 100644 --- a/TypeScript.tmLanguage +++ b/TypeScript.tmLanguage @@ -2078,6 +2078,10 @@ include #function-name + + include + #single-line-comment-consuming-line-ending + include #function-body diff --git a/TypeScriptReact.tmLanguage b/TypeScriptReact.tmLanguage index 7e9c33b2..37dc87c0 100644 --- a/TypeScriptReact.tmLanguage +++ b/TypeScriptReact.tmLanguage @@ -2082,6 +2082,10 @@ include #function-name + + include + #single-line-comment-consuming-line-ending + include #function-body