File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,11 @@ module ts.formatting {
120
120
121
121
function findOutermostParent ( position : number , expectedTokenKind : SyntaxKind , sourceFile : SourceFile ) : Node {
122
122
var precedingToken = findPrecedingToken ( position , sourceFile ) ;
123
+
124
+ // when it is claimed that trigger character was typed at given position
125
+ // we verify that there is a token with a matching kind whose end is equal to position (because the character was just typed).
126
+ // If this condition is not hold - then trigger character was typed in some other context,
127
+ // i.e.in comment and thus should not trigger autoformatting
123
128
if ( ! precedingToken ||
124
129
precedingToken . kind !== expectedTokenKind ||
125
130
position !== precedingToken . getEnd ( ) ) {
You can’t perform that action at this time.
0 commit comments