-
Notifications
You must be signed in to change notification settings - Fork 645
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alanlal Looks like this is your first PR contribution to this project, Thanks & Welcome!
Going through it I realized that with this change we lose out a fix we had provided a few months ago where we avoid clearing the code coverage when the changes that are made are inside a comment.
This is because the file change event provides us with actual content that was changed, but the file save event doesnt provide any such information.
Can you look at how we can make use of the file change event information to guide the decision of whether or not to clear the code coverage on file save?
Hi @ramya-rao-a, I'm having trouble finding a solution to this. Could you help me figure out the areas that I should check out? I looked at the vscode api docs ; but I couldn't find a file save event listener that takes arguments that contains file change information. |
This also preserves an earlier fix to keep coverage when the modifications are only due to comment edits. Supersedes microsoft#2586
This also preserves an earlier fix to keep coverage when the modifications are only due to comment edits. Supersedes microsoft#2586
This also preserves an earlier fix to keep coverage when the modifications are only due to comment edits. Supersedes microsoft#2586
This also preserves an earlier fix to keep coverage when the modifications are only due to comment edits. Supersedes microsoft#2586
@@ -336,7 +336,7 @@ export function activate(ctx: vscode.ExtensionContext): void { | |||
ctx.subscriptions.push(lintDiagnosticCollection); | |||
vetDiagnosticCollection = vscode.languages.createDiagnosticCollection('go-vet'); | |||
ctx.subscriptions.push(vetDiagnosticCollection); | |||
vscode.workspace.onDidChangeTextDocument(removeCodeCoverageOnFileChange, null, ctx.subscriptions); | |||
vscode.workspace.onDidSaveTextDocument(removeCodeCoverageOnFileSave, null, ctx.subscriptions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this line go into the function addOnSaveTextDocumentListeners
@alanlal Looks like there is no good way to get the changes done to a document when it is saved. |
Closing this PR as there hasnt been any updates to it since last June |
@ramya-rao-a I thought someone had raised a PR for the same. If it's not so let me give this a shot. However, why are we closing this issue, it is not fixed right? |
@alwindoss, The issue is not being closed, only the PR is being closed. The issue #2551 is still open and I will follow up on the alternate PR #2853 that builds on your work and addresses the comments I had made. |
PR for #2551
Update
goMain.ts
Added a new function to
goCover.ts
,removeCodeCoverageOnFileSave
to handle File Save for clearing code coverage.