Description
suggestCommand computes const analysisPreview = options.showDiff ? getPreview() : undefined; and never reads it again — the value is dead. It also re-triggers getPreview() (which throws if the preview wasn't built) for no effect, adding confusion to the --show-diff path.
Location
src/commands/suggest.ts line 242
Code
const analysisPreview = options.showDiff ? getPreview() : undefined;
(grep for analysisPreview shows it is only assigned, never used.)
Suggested fix
Delete the line. If a preview was meant to be passed through to the streaming/generation calls (e.g. to avoid recomputing truncation), wire it up as precomputedTruncation — the generateSuggestions/generateSuggestionsStream signatures already accept a precomputedTruncation parameter that callers never pass.
Impact
Dead code and a latent trap: calling getPreview() here throws if preview is undefined, so any future reordering of the --show-diff block can crash the command.
Description
suggestCommandcomputesconst analysisPreview = options.showDiff ? getPreview() : undefined;and never reads it again — the value is dead. It also re-triggersgetPreview()(which throws if the preview wasn't built) for no effect, adding confusion to the--show-diffpath.Location
src/commands/suggest.tsline 242Code
(grep for
analysisPreviewshows it is only assigned, never used.)Suggested fix
Delete the line. If a preview was meant to be passed through to the streaming/generation calls (e.g. to avoid recomputing truncation), wire it up as
precomputedTruncation— thegenerateSuggestions/generateSuggestionsStreamsignatures already accept aprecomputedTruncationparameter that callers never pass.Impact
Dead code and a latent trap: calling
getPreview()here throws ifpreviewis undefined, so any future reordering of the--show-diffblock can crash the command.