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

count property of SourceControl does not behave as documented #117765

Closed
gjsjohnmurray opened this issue Feb 26, 2021 · 7 comments · Fixed by #132242
Closed

count property of SourceControl does not behave as documented #117765

gjsjohnmurray opened this issue Feb 26, 2021 · 7 comments · Fixed by #132242
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders scm General SCM compound issues verified Verification succeeded
Milestone

Comments

@gjsjohnmurray
Copy link
Contributor

Issue Type: Bug

https://code.visualstudio.com/api/references/vscode-api#SourceControl says of the optional count property:

Equals to the total number of resource state of this source control, if undefined.

I'm finding that this doesn't happen. To reproduce:

  1. Set "scm.providerCountBadge": "visible"
  2. Clone https://github.com/microsoft/vscode-extension-samples
  3. Open the source-control-sample folder, build it (npm install) and run it (F5)
  4. Switch to SCM view and see that the (0) badge appears on the provider line (JSFiddle #demo)
  5. Change one of the demo documents, save the change, and confirm that the (1) badge appears on the Changes group and on the provider.
  6. Close the Extension Development Host window.
  7. In the extension sample source, openfiddleSourceControl.ts and comment out this line:
 this.jsFiddleScm.count = this.changedResources.resourceStates.length;
  1. Run the test again. 🐛 the provider line count remains zero even when a change is made to a demo file.

This is not a 1.54 regression; it also exists in 1.53

VS Code version: Code - Insiders 1.54.0-insider (3290f9a, 2021-02-26T05:13:29.656Z)
OS version: Windows_NT x64 10.0.19042

@eamodio eamodio added bug Issue identified by VS Code Team member as probable bug scm General SCM compound issues labels Mar 9, 2021
@eamodio
Copy link
Contributor

eamodio commented Mar 9, 2021

I think we should probably just update the docs here to say that the SCM control determines the count. @joaomoreno thoughts?

@eamodio eamodio added this to the Backlog milestone Mar 9, 2021
@joaomoreno
Copy link
Member

@eamodio 👍

@gjsjohnmurray
Copy link
Contributor Author

So how about using this wording in vscode.d.ts?

The UI-visible count of resource states of this source control.

If undefined, this source control will:

  • display its UI-visible count as zero
  • contribute the count of its resource states to the UI-visible aggregated count for all source controls

Would you like a PR from me?

@gjsjohnmurray
Copy link
Contributor Author

@lszomoru I think this is a quick win in the current issue grooming iteration because I have already submitted a PR to fix it in documentation. Please consider merging it.

@lszomoru
Copy link
Member

@gjsjohnmurray, thanks for the nudge. Merged!

@mjbvz mjbvz added the author-verification-requested Issues potentially verifiable by issue author label Oct 27, 2021
@gjsjohnmurray
Copy link
Contributor Author

/verified

Confirmed change present in main. Won't appear in online doc at https://code.visualstudio.com/api/references/vscode-api#SourceControl until 1.62 ships.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders scm General SCM compound issues verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@joaomoreno @eamodio @lszomoru @gjsjohnmurray @mjbvz and others