Skip to content

Commit 38206fd

Browse files
authored
Updated wiki example to match TypeScript 4.2.3
All examples tested with version 4.2.3. The correction I have made has also been tested with the current latest master branch source (microsoft/TypeScript@ec77bff).
1 parent a9cc2ef commit 38206fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Using-the-Compiler-API.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function compile(fileNames: string[], options: ts.CompilerOptions): void {
4747

4848
allDiagnostics.forEach(diagnostic => {
4949
if (diagnostic.file) {
50-
let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start!);
50+
let { line, character } = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start!);
5151
let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
5252
console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
5353
} else {

0 commit comments

Comments
 (0)