-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
add registered ProblemMatchers to tasks schema #6422
Conversation
const toDispose = new DisposableCollection(Disposable.create(() => {/* mark as not disposed */ })); | ||
this.doRegister(matcher, toDispose); | ||
const toDispose = new DisposableCollection(Disposable.create(() => { | ||
/* mark as not disposed */ |
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.
@akosyakov this is the part i am not sure about.
could you please give me more information on what /* mark as not disposed */
means here? Thank you !
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.
isDisposed
returns true
if a collection is empty. If we don't add anything on the initialization when checking it returns false
, so we push an empty disposable object to indicate that it was not disposed yet.
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.
I verified if we now get content assistance when editing the tasks.json
manually and it works correctly 👍
I also correctly get warned when attempting to provide unknown problem matchers.
return JSON.stringify(taskSchema); | ||
} | ||
|
||
private updateProblemMatcherNames(): void { |
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.
@elaihau do you mind documenting this method?
I see that we getAll
named problem matchers, reset the current list, and finally push the new list.
I just wanted to understand why it's required and in what scenario.
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.
Yep i will document this function.
This function is called in the callback of this.problemMatcherRegistry.onDidChangeProblemMatcher( )
. In other words, every time a problem matcher is registered or disposed, we want to update the task schema to ensure the users get the most up-to-date when they are manually entering the problem matcher(s).
I cannot simply do problemMatcherNames = matcherNames;
instead of resetting the length of array, as the reference of problemMatcherNames
is assigned to the task schema when theia starts.
a25ff8f
to
d71eaef
Compare
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.
Tested the changes:
- the names of registered problem matchers are displayed when I edit
tasks.json
file manually - warning is displayed when I try to use unregistered problem matcher for a configuration
@elaihau I noticed something, when executing a task (ex: |
wow nice catch ! |
From looking at VS Code, it looks like they register the builtin problem matchers with the $ included. |
- With this pull request, task schemas are updated on problem matchers being added / disposed, and users are benefited from having content assist while specifying the name(s) of problem matcher(s) in tasks.json. - resolves #6134 Signed-off-by: Liang Huang <liang.huang@ericsson.com>
d71eaef
to
0099776
Compare
Yes you are right. I updated the code to match the vs code behavior. Thank you ! |
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.
It works much better now thank you! 👍
being added / disposed, and users are benefited from having content assist while specifying the name(s) of problem matcher(s) in tasks.json.
Signed-off-by: Liang Huang liang.huang@ericsson.com
How to test
tasks.json
and define a task.Review checklist