cleanup setting name and values

This commit is contained in:
Joao Moreno 2019-10-25 16:11:36 +02:00
parent d5e692e758
commit 7da96f94c1
No known key found for this signature in database
GPG key ID: 9494F5E6167A8E6B
4 changed files with 32 additions and 32 deletions

View file

@ -907,42 +907,42 @@
},
{
"command": "git.cleanAll",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.handleUntracked == withchanges",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == default",
"group": "1_modification"
},
{
"command": "git.stageAll",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.handleUntracked == withchanges",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == default",
"group": "1_modification"
},
{
"command": "git.cleanAll",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.handleUntracked == withchanges",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == default",
"group": "inline"
},
{
"command": "git.stageAll",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.handleUntracked == withchanges",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges == default",
"group": "inline"
},
{
"command": "git.cleanAllTracked",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.handleUntracked != withchanges",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != default",
"group": "1_modification"
},
{
"command": "git.stageAllTracked",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.handleUntracked != withchanges",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != default",
"group": "1_modification"
},
{
"command": "git.cleanAllTracked",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.handleUntracked != withchanges",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != default",
"group": "inline"
},
{
"command": "git.stageAllTracked",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.handleUntracked != withchanges",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.untrackedChanges != default",
"group": "inline"
},
{
@ -1598,20 +1598,20 @@
"default": "committerdate",
"description": "%config.branchSortOrder%"
},
"git.handleUntracked": {
"git.untrackedChanges": {
"type": "string",
"enum": [
"withchanges",
"default",
"separate",
"hide"
"hidden"
],
"enumDescriptions": [
"%config.handleUntracked.withchanges%",
"%config.handleUntracked.separate%",
"%config.handleUntracked.hide%"
"%config.untrackedChanges.default%",
"%config.untrackedChanges.separate%",
"%config.untrackedChanges.hidden%"
],
"default": "withchanges",
"description": "%config.handleUntracked%",
"default": "default",
"description": "%config.untrackedChanges%",
"scope": "resource"
}
}

View file

@ -135,10 +135,10 @@
"config.openDiffOnClick": "Controls whether the diff editor should be opened when clicking a change. Otherwise the regular editor will be opened.",
"config.supportCancellation": "Controls whether a notification comes up when running the Sync action, which allows the user to cancel the operation.",
"config.branchSortOrder": "Controls the sort order for branches.",
"config.handleUntracked": "Controls how untracked files are presented in the activity bar.",
"config.handleUntracked.withchanges": "Show with other unstaged changes, commit under \"Commit All\"",
"config.handleUntracked.separate": "Separate in list and badge counter, don't commit under \"Commit All\"",
"config.handleUntracked.hide": "Exclude from list and badge counter, don't commit under \"Commit All\"",
"config.untrackedChanges": "Controls how untracked changes behave.",
"config.untrackedChanges.default": "All changes, tracked and untracked, appear together and behave equally.",
"config.untrackedChanges.separate": "Untracked changes appear separately in the Source Control view. They are also excluded from several actions.",
"config.untrackedChanges.hidden": "Untracked changes are hidden and excluded from several actions.",
"colors.added": "Color for added resources.",
"colors.modified": "Color for modified resources.",
"colors.deleted": "Color for deleted resources.",

View file

@ -915,8 +915,8 @@ export class CommandCenter {
}
const config = workspace.getConfiguration('git', Uri.file(repository.root));
const handleUntracked = config.get<'withchanges' | 'separate' | 'hide'>('handleUntracked');
await repository.add([], handleUntracked === 'withchanges' ? undefined : { update: true });
const untrackedChanges = config.get<'default' | 'separate' | 'hidden'>('untrackedChanges');
await repository.add([], untrackedChanges === 'default' ? undefined : { update: true });
}
private async _stageDeletionConflict(repository: Repository, uri: Uri): Promise<void> {
@ -1421,7 +1421,7 @@ export class CommandCenter {
opts.all = 'tracked';
}
if (opts.all && config.get<'withchanges' | 'separate' | 'hide'>('handleUntracked') !== 'withchanges') {
if (opts.all && config.get<'default' | 'separate' | 'hidden'>('untrackedChanges') !== 'default') {
opts.all = 'tracked';
}

View file

@ -728,7 +728,7 @@ export class Repository implements Disposable {
const onConfigListenerForBranchSortOrder = filterEvent(workspace.onDidChangeConfiguration, e => e.affectsConfiguration('git.branchSortOrder', root));
onConfigListenerForBranchSortOrder(this.updateModelState, this, this.disposables);
const onConfigListenerForUntracked = filterEvent(workspace.onDidChangeConfiguration, e => e.affectsConfiguration('git.handleUntracked', root));
const onConfigListenerForUntracked = filterEvent(workspace.onDidChangeConfiguration, e => e.affectsConfiguration('git.untrackedChanges', root));
onConfigListenerForUntracked(this.updateModelState, this, this.disposables);
this.mergeGroup.hideWhenEmpty = true;
@ -1509,7 +1509,7 @@ export class Repository implements Disposable {
this._submodules = submodules!;
this.rebaseCommit = rebaseCommit;
const handleUntracked = scopedConfig.get<'withchanges' | 'separate' | 'hide'>('handleUntracked');
const untrackedChanges = scopedConfig.get<'default' | 'separate' | 'hidden'>('untrackedChanges');
const index: Resource[] = [];
const workingTree: Resource[] = [];
const merge: Resource[] = [];
@ -1522,13 +1522,13 @@ export class Repository implements Disposable {
: undefined;
switch (raw.x + raw.y) {
case '??': switch (handleUntracked) {
case 'withchanges': return workingTree.push(new Resource(ResourceGroupType.WorkingTree, uri, Status.UNTRACKED, useIcons));
case '??': switch (untrackedChanges) {
case 'default': return workingTree.push(new Resource(ResourceGroupType.WorkingTree, uri, Status.UNTRACKED, useIcons));
case 'separate': return untracked.push(new Resource(ResourceGroupType.Untracked, uri, Status.UNTRACKED, useIcons));
default: return undefined;
}
case '!!': switch (handleUntracked) {
case 'withchanges': return workingTree.push(new Resource(ResourceGroupType.WorkingTree, uri, Status.IGNORED, useIcons));
case '!!': switch (untrackedChanges) {
case 'default': return workingTree.push(new Resource(ResourceGroupType.WorkingTree, uri, Status.IGNORED, useIcons));
case 'separate': return untracked.push(new Resource(ResourceGroupType.Untracked, uri, Status.IGNORED, useIcons));
default: return undefined;
}
@ -1575,7 +1575,7 @@ export class Repository implements Disposable {
private setCountBadge(): void {
const config = workspace.getConfiguration('git', Uri.file(this.repository.root));
const countBadge = config.get<'all' | 'tracked' | 'off'>('countBadge');
const handleUntracked = config.get<'withchanges' | 'separate' | 'hide'>('handleUntracked');
const untrackedChanges = config.get<'default' | 'separate' | 'hidden'>('untrackedChanges');
let count =
this.mergeGroup.resourceStates.length +
@ -1585,12 +1585,12 @@ export class Repository implements Disposable {
switch (countBadge) {
case 'off': count = 0; break;
case 'tracked':
if (handleUntracked === 'withchanges') {
if (untrackedChanges === 'default') {
count -= this.workingTreeGroup.resourceStates.filter(r => r.type === Status.UNTRACKED || r.type === Status.IGNORED).length;
}
break;
case 'all':
if (handleUntracked === 'separate') {
if (untrackedChanges === 'separate') {
count += this.untrackedGroup.resourceStates.length;
}
break;