File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -2144,9 +2144,16 @@ module ts {
2144
2144
}
2145
2145
2146
2146
// TODO: this is a hack for now, we need a proper walking mechanism to verify that we have the correct node
2147
- var mappedNode = getTouchingToken ( sourceFile , TypeScript . end ( node ) - 1 ) ;
2148
- if ( isPunctuation ( mappedNode . kind ) ) {
2149
- mappedNode = mappedNode . parent ;
2147
+ var precedingToken = findTokenOnLeftOfPosition ( sourceFile , TypeScript . end ( node ) ) ;
2148
+ var mappedNode : Node ;
2149
+ if ( ! precedingToken ) {
2150
+ mappedNode = sourceFile ;
2151
+ }
2152
+ else if ( isPunctuation ( precedingToken . kind ) ) {
2153
+ mappedNode = precedingToken . parent ;
2154
+ }
2155
+ else {
2156
+ mappedNode = precedingToken ;
2150
2157
}
2151
2158
2152
2159
Debug . assert ( mappedNode , "Could not map a Fidelity node to an AST node" ) ;
You can’t perform that action at this time.
0 commit comments