* Creates a map of comment directives along with the diagnostics immediately preceded by one of them. * Comments that match to any of those diagnostics are marked as used.
(sourceFile, commentDirectives, flatDiagnostics)
| 117667 | * Comments that match to any of those diagnostics are marked as used. |
| 117668 | */ |
| 117669 | function getDiagnosticsWithPrecedingDirectives(sourceFile, commentDirectives, flatDiagnostics) { |
| 117670 | // Diagnostics are only reported if there is no comment directive preceding them |
| 117671 | // This will modify the directives map by marking "used" ones with a corresponding diagnostic |
| 117672 | var directives = ts.createCommentDirectivesMap(sourceFile, commentDirectives); |
| 117673 | var diagnostics = flatDiagnostics.filter(function (diagnostic) { return markPrecedingCommentDirectiveLine(diagnostic, directives) === -1; }); |
| 117674 | return { diagnostics: diagnostics, directives: directives }; |
| 117675 | } |
| 117676 | function getSuggestionDiagnostics(sourceFile, cancellationToken) { |
| 117677 | return runWithCancellationToken(function () { |
| 117678 | return getTypeChecker().getSuggestionDiagnostics(sourceFile, cancellationToken); |
no test coverage detected