Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/services/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5902,11 +5902,13 @@ module ts {
let end = triviaScanner.getTextPos();
let width = end - start;

if (textSpanIntersectsWith(span, start, width)) {
if (!isTrivia(kind)) {
return;
}
// The moment we get something that isn't trivia, then stop processing.
if (!isTrivia(kind)) {
return;
}

// Only bother with the trivia if it at least intersects the span of interest.
if (textSpanIntersectsWith(span, start, width)) {
if (isComment(kind)) {
// Simple comment. Just add as is.
result.push({
Expand Down