Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have a command that clears all problems that are from tasks. #77214

Open
alexr00 opened this issue Jul 11, 2019 · 14 comments
Open

Have a command that clears all problems that are from tasks. #77214

alexr00 opened this issue Jul 11, 2019 · 14 comments
Assignees
Labels
feature-request Request for new features or functionality polish Cleanup and polish issue tasks Task system issues
Milestone

Comments

@alexr00
Copy link
Member

alexr00 commented Jul 11, 2019

When a user makes a change to a task and re-runs it, they could end up accumulating problems since the modified task counts as a new task.

One idea is to clear all problems when the task config changes: #76108
But that seems too aggressive and we'd be removing problems without telling the user why.

Instead, having a command to clear the task problems is clearer.

@alexr00 alexr00 added feature-request Request for new features or functionality tasks Task system issues labels Jul 11, 2019
@alexr00 alexr00 added this to the Backlog milestone Jul 11, 2019
@alexr00 alexr00 self-assigned this Jul 11, 2019
@alexr00 alexr00 added the polish Cleanup and polish issue label Jul 11, 2019
@egamma
Copy link
Member

egamma commented Jul 29, 2019

@alexr00 pls see also the discussion here #50448

@justingrant
Copy link
Contributor

@alexr00 - it would be great if this command could accept an optional task name parameter, so that users could clear problems from one specific task without clearing problems from all tasks. In complex projects with many different tasks that contribute problems, it's painful to have to re-run every task just to clear out bad problems from one task. Another reason for this is when you quit a background task, there's no way to clear its problems.

@alexr00
Copy link
Member Author

alexr00 commented Oct 17, 2019

When you quit a background task it's errors should be cleaned up.

Passing some parameter to specify which problems to clear seems reasonable.

@alexr00
Copy link
Member Author

alexr00 commented Oct 25, 2019

@sandy081 there is not a great way to clear only markers from tasks right now since a marker from a task can have the same owner as a marker from someone else. Since the marker remove method takes an owner and a resource this isn't possible.

What do you think of having a sub-owner for markers or some other property that can be passed into remove to filter which markers are removed?

@alexr00 alexr00 modified the milestones: October 2019, On Deck Oct 25, 2019
@sandy081
Copy link
Member

Are you going through the public or internal API?

@alexr00
Copy link
Member Author

alexr00 commented Nov 13, 2019

@sandy081 internal API.

@sandy081
Copy link
Member

May be we can change current owner to source and introduce new owner property.

@jrieken Let me know if you have other suggestions?

@jrieken
Copy link
Member

jrieken commented Nov 13, 2019

This isn't sooo easy because markers are double-indexed by owner and by resource. So, this will definitely a slow and error-prune approach. @alexr00 Why is it that tasks re-use owners?

@alexr00
Copy link
Member Author

alexr00 commented Nov 13, 2019

@jrieken it is done so that you don't get duplicate errors from a language server. For example, the typescript language server shows you errors for files you have open. If you have a build task it will create markers for all errors, including the ones that the typescript language server already uses. To prevent this, we use the same owner.

@jrieken
Copy link
Member

jrieken commented Nov 14, 2019

Yeah, that makes sense. It just won't be super easy to implement because of the way the marker service works today.

@NSExceptional
Copy link
Contributor

Really hope this gets picked up, +1

@alexr00 alexr00 assigned meganrogge and unassigned alexr00 Jun 30, 2022
@DavidBiesack
Copy link

Rather than stale problems from a task that I've run, stale problems show up most often for me with the Spectral or yamllint extensions that do not always clean up problems, such as the problem

[{
	"resource": ".../path.../openapi.yaml",
	"owner": "spectral",
	"code": "invalid-ref",
	"severity": 8,
	"message": "'#/components/responses/401' does not exist",
	"source": "spectral",
	"startLineNumber": 684,
	"startColumn": 17,
	"endLineNumber": 684,
	"endColumn": 45
}]

I fix the problems, but the extension does not properly remove the old items. I've reported this via the extension.

But until the extensions are fixed,
(and I've seen this problem with other extensions) I'd like to be able to clear these problems from the view.
without having to restart VS Code or close/reopen the VS Code window

@starball5
Copy link

Related on Stack Overflow: VS Code Problems tab: Clear items coming from tasks with problemMatcher.

Somewhat related: #66982, #73186.

@heartacker

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality polish Cleanup and polish issue tasks Task system issues
Projects
None yet
Development

No branches or pull requests

10 participants