Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
fuma-nama committed Jan 30, 2024
1 parent 50ff0ca commit 8643903
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/core/src/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ function getProgram(options: Options['options'] = {}): ts.Program {
},
});

console.log(program.getConfigFileParsingDiagnostics());

Check failure on line 68 in packages/core/src/typescript.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement

cache.set(key, program);

return program;
Expand Down Expand Up @@ -108,6 +110,31 @@ export function generateDocumentation(options: Options): DocEntry[] {
symbol,
};

const allDiagnostics = ts.getPreEmitDiagnostics(program);

allDiagnostics.forEach((diagnostic) => {
if (diagnostic.file && diagnostic.start) {
const { line, character } = ts.getLineAndCharacterOfPosition(
diagnostic.file,
diagnostic.start,
);
const message = ts.flattenDiagnosticMessageText(
diagnostic.messageText,
'\n',
);

console.log(

Check failure on line 126 in packages/core/src/typescript.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
`${diagnostic.file.fileName} (${line + 1},${
character + 1
}): ${message}`,
);
} else {
console.log(

Check failure on line 132 in packages/core/src/typescript.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'),
);
}
});

return type.getProperties().map(getDocEntry.bind(entryContext));
}

Expand Down

0 comments on commit 8643903

Please sign in to comment.