Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions apps/vscode-extension/src/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,17 @@ export function registerOnDidChangeDiagnostics(context: ExtensionContext) {
)
);

// TODO: we should check if never deleting the entries is a performance issue
// probably not, since solving all diagnostics for a file should set its value to an empty collection, but we should check anyway
// see: https://github.com/yoavbls/pretty-ts-errors/issues/139
formattedDiagnosticsStore.set(uri.fsPath, items);
if (items.length === 0) {
logger.trace(
`no diagnostics for ${uri.toString(true)}, removing from store`
);
formattedDiagnosticsStore.delete(uri.fsPath);
} else {
logger.trace(
`storing ${items.length} formatted diagnostics for ${uri.toString(true)}`
);
formattedDiagnosticsStore.set(uri.fsPath, items);
}

if (items.length > 0) {
ensureHoverProviderIsRegistered(uri, context);
Expand Down
Loading