Skip to content

Commit 041ff20

Browse files
committed
checkpatchProvider: Fix files with only one warning
Files which have only one warning are not updated after fixing it. This fixes it by always cleaning the file diagnostics before doing a new one... Signed-off-by: Nuno Sa <noname.nuno@gmail.com>
1 parent 5bed5a9 commit 041ff20

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/checkpatchProvider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ export default class CheckpatchProvider implements vscode.CodeActionProvider {
128128

129129
let childProcess = cp.spawn(this.linterConfig.path, args, { shell: true });
130130
if (childProcess.pid) {
131+
// clean old diagostics. Prevents files with only one warning from being updated
132+
this.diagnosticCollection.delete(textDocument.uri);
131133
childProcess.stdout.on('data', (data: Buffer) => log += data);
132134
childProcess.stdout.on('end', () => this.parseCheckpatchLog(log, ''));
133135
} else {

0 commit comments

Comments
 (0)