We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
getSyntacticDocumentHighlights
1 parent c7f65e8 commit 7b929e0Copy full SHA for 7b929e0
1 file changed
src/services/documentHighlights.ts
@@ -30,11 +30,7 @@ namespace ts.DocumentHighlights {
30
31
function getSyntacticDocumentHighlights(node: Node, sourceFile: SourceFile): DocumentHighlights[] {
32
const highlightSpans = getHighlightSpans(node, sourceFile);
33
- if (!highlightSpans || highlightSpans.length === 0) {
34
- return undefined;
35
- }
36
-
37
- return [{ fileName: sourceFile.fileName, highlightSpans }];
+ return highlightSpans && [{ fileName: sourceFile.fileName, highlightSpans }];
38
}
39
40
function getHighlightSpans(node: Node, sourceFile: SourceFile): HighlightSpan[] | undefined {
0 commit comments