Skip to content

Commit

Permalink
- fix for #32
Browse files Browse the repository at this point in the history
  • Loading branch information
ezolenko committed Dec 3, 2018
1 parent df89e70 commit c400b95
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dist/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion dist/rollup-plugin-typescript2.cjs.js
Expand Up @@ -21606,7 +21606,14 @@ function typescript(options) {
cache().walkTree((id) => {
if (!filter(id))
return;
const diagnostics = lodash_10(convertDiagnostic("syntax", service.getSyntacticDiagnostics(id)), convertDiagnostic("semantic", service.getSemanticDiagnostics(id)));
const snapshot = servicesHost.getScriptSnapshot(id);
if (!snapshot)
return;
const diagnostics = lodash_10(cache().getSyntacticDiagnostics(id, snapshot, () => {
return service.getSyntacticDiagnostics(id);
}), cache().getSemanticDiagnostics(id, snapshot, () => {
return service.getSemanticDiagnostics(id);
}));
printDiagnostics(context, diagnostics, parsedConfig.options.pretty === true);
});
}
Expand Down
2 changes: 1 addition & 1 deletion dist/rollup-plugin-typescript2.cjs.js.map

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion dist/rollup-plugin-typescript2.es.js
Expand Up @@ -21602,7 +21602,14 @@ function typescript(options) {
cache().walkTree((id) => {
if (!filter(id))
return;
const diagnostics = lodash_10(convertDiagnostic("syntax", service.getSyntacticDiagnostics(id)), convertDiagnostic("semantic", service.getSemanticDiagnostics(id)));
const snapshot = servicesHost.getScriptSnapshot(id);
if (!snapshot)
return;
const diagnostics = lodash_10(cache().getSyntacticDiagnostics(id, snapshot, () => {
return service.getSyntacticDiagnostics(id);
}), cache().getSemanticDiagnostics(id, snapshot, () => {
return service.getSemanticDiagnostics(id);
}));
printDiagnostics(context, diagnostics, parsedConfig.options.pretty === true);
});
}
Expand Down
2 changes: 1 addition & 1 deletion dist/rollup-plugin-typescript2.es.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions src/index.ts
Expand Up @@ -278,9 +278,19 @@ export default function typescript(options?: Partial<IOptions>)
if (!filter(id))
return;

const snapshot = servicesHost.getScriptSnapshot(id);
if (!snapshot)
return;

const diagnostics = _.concat(
convertDiagnostic("syntax", service.getSyntacticDiagnostics(id)),
convertDiagnostic("semantic", service.getSemanticDiagnostics(id)),
cache().getSyntacticDiagnostics(id, snapshot, () =>
{
return service.getSyntacticDiagnostics(id);
}),
cache().getSemanticDiagnostics(id, snapshot, () =>
{
return service.getSemanticDiagnostics(id);
}),
);

printDiagnostics(context, diagnostics, parsedConfig.options.pretty === true);
Expand Down

0 comments on commit c400b95

Please sign in to comment.