We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
findPrecedingToken
1 parent 472ad9d commit f3e0cbbCopy full SHA for f3e0cbb
src/services/services.ts
@@ -113,7 +113,7 @@ namespace ts {
113
}
114
pos = textPos;
115
if (token === SyntaxKind.EndOfFileToken) {
116
- return pos;
+ break;
117
118
119
return pos;
src/services/utilities.ts
@@ -753,7 +753,7 @@ namespace ts {
753
const start = child.getStart(sourceFile, includeJsDoc);
754
const lookInPreviousChild =
755
(start >= position) || // cursor in the leading trivia
756
- nodeHasTokens(child) ||
+ !nodeHasTokens(child) ||
757
(child.kind === SyntaxKind.JsxText && start === child.end); // whitespace only JsxText
758
759
if (lookInPreviousChild) {
0 commit comments