Update messages/descriptions with how to fix the alert

This commit is contained in:
Robert
2024-03-13 17:24:09 +00:00
parent 4346cc6e98
commit 84df4b64d8
2 changed files with 7 additions and 4 deletions

View File

@@ -3,8 +3,10 @@
* @kind problem
* @problem.severity warning
* @id vscode-codeql/progress-not-cancellable
* @description If we call `withProgress` with `cancellable: false` then the
* @description If we call `withProgress` without `cancellable: true` then the
* token that is given to us should be ignored because it won't ever be cancelled.
* This makes the code more confusing as it tries to account for cases that can't
* happen. The fix is to either not use the token or make the progress bar cancellable.
*/
import javascript
@@ -12,4 +14,4 @@ import ProgressBar
from ProgressBar t
where not t.isCancellable() and t.usesToken()
select t, "The token should not be used when the progress bar is not cancelable"
select t, "The token should not be used when the progress bar is not cancelable. Either stop using the token or mark the progress bar as cancellable."

View File

@@ -6,7 +6,8 @@
* @description If we call `withProgress` with `cancellable: true` but then
* ignore the token that is given to us, it will lead to a poor user experience
* because the progress bar will appear to be canceled but it will not actually
* affect the background process.
* affect the background process. Either check the token and respect when it
* has been cancelled, or mark the progress bar as not cancellable.
*/
import javascript
@@ -14,4 +15,4 @@ import ProgressBar
from ProgressBar t
where t.isCancellable() and not t.usesToken()
select t, "This progress bar is $@ but the token is not used", t.getCancellableProperty(), "cancellable"
select t, "This progress bar is $@ but the token is not used. Either use the token or mark the progress bar as not cancellable.", t.getCancellableProperty(), "cancellable"