diff --git a/kythe/typescript/indexer.ts b/kythe/typescript/indexer.ts index 7a425646b3..fa120f6494 100644 --- a/kythe/typescript/indexer.ts +++ b/kythe/typescript/indexer.ts @@ -2755,6 +2755,9 @@ export function index(compilationUnit: CompilationUnit, options: IndexingOptions try { plugin.index(indexingContext); } catch (err) { + if (indexingContext.options.failAnalysisOnPluginError) { + throw err; + } console.error(`Plugin ${plugin.name} errored:`, err); } } diff --git a/kythe/typescript/plugin_api.ts b/kythe/typescript/plugin_api.ts index ef34712ad1..f40fc77965 100644 --- a/kythe/typescript/plugin_api.ts +++ b/kythe/typescript/plugin_api.ts @@ -81,18 +81,17 @@ export interface IndexingOptions { */ readFile?: (path: string) => Buffer; - /** - * When enabled emits 0-0 spans at the beginning of each file that represent - * current module. By default 0-1 spans are emitted. Also this flag changes it - * to emit `defines/implicit` edges instead of `defines/binding`. - */ - emitZeroWidthSpansForModuleNodes?: boolean; - /** * When enabled, ref/call source anchors span identifiers instead of full * call expressions when possible. */ emitRefCallOverIdentifier?: boolean; + + /** + * When enabled any error thrown from any plugin gets propagated to the caller. + * Currently errors from plugins are logged without interrupting analysis. + */ + failAnalysisOnPluginError?: boolean; }