Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@
"default": false,
"description": "%githubPullRequests.hideViewedFiles.description%"
},
"githubPullRequests.fileAutoReveal": {
"type": "boolean",
"default": true,
"description": "%githubPullRequests.fileAutoReveal.description%"
},
"githubPullRequests.defaultDeletionMethod.selectLocalBranch": {
"type": "boolean",
"default": true,
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"githubPullRequests.notifications.description": "If GitHub notifications should be shown to the user.",
"githubPullRequests.fileListLayout.description": "The layout to use when displaying changed files list.",
"githubPullRequests.hideViewedFiles.description": "Hide files that have been marked as viewed in the pull request changes tree.",
"githubPullRequests.fileAutoReveal.description": "Automatically reveal open files in the pull request changes tree.",
"githubPullRequests.defaultDeletionMethod.selectLocalBranch.description": "When true, the option to delete the local branch will be selected by default when deleting a branch from a pull request.",
"githubPullRequests.defaultDeletionMethod.selectRemote.description": "When true, the option to delete the remote will be selected by default when deleting a branch from a pull request.",
"githubPullRequests.deleteBranchAfterMerge.description": "Automatically delete the branch after merging a pull request. This setting only applies when the pull request is merged through this extension.",
Expand Down
205 changes: 101 additions & 104 deletions src/common/settingKeys.ts
Original file line number Diff line number Diff line change
@@ -1,105 +1,102 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

export const PR_SETTINGS_NAMESPACE = 'githubPullRequests';
export const TERMINAL_LINK_HANDLER = 'terminalLinksHandler';
export const BRANCH_PUBLISH = 'createOnPublishBranch';
export const BRANCH_LIST_TIMEOUT = 'branchListTimeout';
export const USE_REVIEW_MODE = 'useReviewMode';
export const FILE_LIST_LAYOUT = 'fileListLayout';
export const HIDE_VIEWED_FILES = 'hideViewedFiles';
export const ASSIGN_TO = 'assignCreated';
export const PUSH_BRANCH = 'pushBranch';
export const IGNORE_PR_BRANCHES = 'ignoredPullRequestBranches';
export const IGNORE_SUBMODULES = 'ignoreSubmodules';
export const NEVER_IGNORE_DEFAULT_BRANCH = 'neverIgnoreDefaultBranch';
export const OVERRIDE_DEFAULT_BRANCH = 'overrideDefaultBranch';
export const PULL_BRANCH = 'pullBranch';
export const PULL_REQUEST_DESCRIPTION = 'pullRequestDescription';
export const NOTIFICATION_SETTING = 'notifications';
export type NotificationVariants = 'off' | 'pullRequests';
export const POST_CREATE = 'postCreate';
export const POST_DONE = 'postDone';
export const QUERIES = 'queries';
export const PULL_REQUEST_LABELS = 'labelCreated';
export const FOCUSED_MODE = 'focusedMode';
export const CREATE_DRAFT = 'createDraft';
export const QUICK_DIFF = 'quickDiff';
export const SET_AUTO_MERGE = 'setAutoMerge';
export const SHOW_PULL_REQUEST_NUMBER_IN_TREE = 'showPullRequestNumberInTree';
export const DEFAULT_MERGE_METHOD = 'defaultMergeMethod';
export const DEFAULT_DELETION_METHOD = 'defaultDeletionMethod';
export const SELECT_LOCAL_BRANCH = 'selectLocalBranch';
export const SELECT_REMOTE = 'selectRemote';
export const DELETE_BRANCH_AFTER_MERGE = 'deleteBranchAfterMerge';
export const REMOTES = 'remotes';
export const PULL_PR_BRANCH_BEFORE_CHECKOUT = 'pullPullRequestBranchBeforeCheckout';
export type PullPRBranchVariants = 'never' | 'pull' | 'pullAndMergeBase' | 'pullAndUpdateBase' | true | false;
export const UPSTREAM_REMOTE = 'upstreamRemote';
export const DEFAULT_CREATE_OPTION = 'defaultCreateOption';
export const CREATE_BASE_BRANCH = 'createDefaultBaseBranch';

export const ISSUES_SETTINGS_NAMESPACE = 'githubIssues';
export const ASSIGN_WHEN_WORKING = 'assignWhenWorking';
export const ISSUE_COMPLETIONS = 'issueCompletions';
export const USER_COMPLETIONS = 'userCompletions';
export const ENABLED = 'enabled';
export const IGNORE_USER_COMPLETION_TRIGGER = 'ignoreUserCompletionTrigger';
export const CREATE_INSERT_FORMAT = 'createInsertFormat';
export const ISSUE_BRANCH_TITLE = 'issueBranchTitle';
export const USE_BRANCH_FOR_ISSUES = 'useBranchForIssues';
export const WORKING_BASE_BRANCH = 'workingBaseBranch';
export const WORKING_ISSUE_FORMAT_SCM = 'workingIssueFormatScm';
export const IGNORE_COMPLETION_TRIGGER = 'ignoreCompletionTrigger';
export const ISSUE_COMPLETION_FORMAT_SCM = 'issueCompletionFormatScm';
export const CREATE_ISSUE_TRIGGERS = 'createIssueTriggers';
export const DEFAULT = 'default';
export const IGNORE_MILESTONES = 'ignoreMilestones';
export const ALLOW_FETCH = 'allowFetch';
export const ALWAYS_PROMPT_FOR_NEW_ISSUE_REPO = 'alwaysPromptForNewIssueRepo';
export const ISSUE_AVATAR_DISPLAY = 'issueAvatarDisplay';
export const EXPERIMENTAL_CHAT = 'experimental.chat';
export const EXPERIMENTAL_USE_QUICK_CHAT = 'experimental.useQuickChat';
export const EXPERIMENTAL_NOTIFICATIONS_PAGE_SIZE = 'experimental.notificationsViewPageSize';
export const EXPERIMENTAL_NOTIFICATIONS_SCORE = 'experimental.notificationsScore';
export const WEBVIEW_REFRESH_INTERVAL = 'webviewRefreshInterval';
export const DEV_MODE = 'devMode';

// git
export const GIT = 'git';
export const PULL_BEFORE_CHECKOUT = 'pullBeforeCheckout';
export const OPEN_DIFF_ON_CLICK = 'openDiffOnClick';
export const SHOW_INLINE_OPEN_FILE_ACTION = 'showInlineOpenFileAction';
export const AUTO_STASH = 'autoStash';
export const BRANCH_WHITESPACE_CHAR = 'branchWhitespaceChar';
export const BRANCH_RANDOM_NAME_DICTIONARY = 'branchRandomName.dictionary';

// GitHub Enterprise
export const GITHUB_ENTERPRISE = 'github-enterprise';
export const URI = 'uri';

// Editor
export const EDITOR = 'editor';
export const WORD_WRAP = 'wordWrap';

// Comments
export const COMMENTS = 'comments';
export const OPEN_VIEW = 'openView';

// Explorer
export const EXPLORER = 'explorer';
export const AUTO_REVEAL = 'autoReveal';

// Workbench
export const WORKBENCH = 'workbench';
export const COLOR_THEME = 'colorTheme';

// Coding Agent

export const CODING_AGENT = `${PR_SETTINGS_NAMESPACE}.codingAgent`;
export const CODING_AGENT_ENABLED = 'enabled';
export const CODING_AGENT_AUTO_COMMIT_AND_PUSH = 'autoCommitAndPush';
export const CODING_AGENT_PROMPT_FOR_CONFIRMATION = 'promptForConfirmation';
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

export const PR_SETTINGS_NAMESPACE = 'githubPullRequests';
export const TERMINAL_LINK_HANDLER = 'terminalLinksHandler';
export const BRANCH_PUBLISH = 'createOnPublishBranch';
export const BRANCH_LIST_TIMEOUT = 'branchListTimeout';
export const USE_REVIEW_MODE = 'useReviewMode';
export const FILE_LIST_LAYOUT = 'fileListLayout';
export const HIDE_VIEWED_FILES = 'hideViewedFiles';
export const FILE_AUTO_REVEAL = 'fileAutoReveal';
export const ASSIGN_TO = 'assignCreated';
export const PUSH_BRANCH = 'pushBranch';
export const IGNORE_PR_BRANCHES = 'ignoredPullRequestBranches';
export const IGNORE_SUBMODULES = 'ignoreSubmodules';
export const NEVER_IGNORE_DEFAULT_BRANCH = 'neverIgnoreDefaultBranch';
export const OVERRIDE_DEFAULT_BRANCH = 'overrideDefaultBranch';
export const PULL_BRANCH = 'pullBranch';
export const PULL_REQUEST_DESCRIPTION = 'pullRequestDescription';
export const NOTIFICATION_SETTING = 'notifications';
export type NotificationVariants = 'off' | 'pullRequests';
export const POST_CREATE = 'postCreate';
export const POST_DONE = 'postDone';
export const QUERIES = 'queries';
export const PULL_REQUEST_LABELS = 'labelCreated';
export const FOCUSED_MODE = 'focusedMode';
export const CREATE_DRAFT = 'createDraft';
export const QUICK_DIFF = 'quickDiff';
export const SET_AUTO_MERGE = 'setAutoMerge';
export const SHOW_PULL_REQUEST_NUMBER_IN_TREE = 'showPullRequestNumberInTree';
export const DEFAULT_MERGE_METHOD = 'defaultMergeMethod';
export const DEFAULT_DELETION_METHOD = 'defaultDeletionMethod';
export const SELECT_LOCAL_BRANCH = 'selectLocalBranch';
export const SELECT_REMOTE = 'selectRemote';
export const DELETE_BRANCH_AFTER_MERGE = 'deleteBranchAfterMerge';
export const REMOTES = 'remotes';
export const PULL_PR_BRANCH_BEFORE_CHECKOUT = 'pullPullRequestBranchBeforeCheckout';
export type PullPRBranchVariants = 'never' | 'pull' | 'pullAndMergeBase' | 'pullAndUpdateBase' | true | false;
export const UPSTREAM_REMOTE = 'upstreamRemote';
export const DEFAULT_CREATE_OPTION = 'defaultCreateOption';
export const CREATE_BASE_BRANCH = 'createDefaultBaseBranch';

export const ISSUES_SETTINGS_NAMESPACE = 'githubIssues';
export const ASSIGN_WHEN_WORKING = 'assignWhenWorking';
export const ISSUE_COMPLETIONS = 'issueCompletions';
export const USER_COMPLETIONS = 'userCompletions';
export const ENABLED = 'enabled';
export const IGNORE_USER_COMPLETION_TRIGGER = 'ignoreUserCompletionTrigger';
export const CREATE_INSERT_FORMAT = 'createInsertFormat';
export const ISSUE_BRANCH_TITLE = 'issueBranchTitle';
export const USE_BRANCH_FOR_ISSUES = 'useBranchForIssues';
export const WORKING_BASE_BRANCH = 'workingBaseBranch';
export const WORKING_ISSUE_FORMAT_SCM = 'workingIssueFormatScm';
export const IGNORE_COMPLETION_TRIGGER = 'ignoreCompletionTrigger';
export const ISSUE_COMPLETION_FORMAT_SCM = 'issueCompletionFormatScm';
export const CREATE_ISSUE_TRIGGERS = 'createIssueTriggers';
export const DEFAULT = 'default';
export const IGNORE_MILESTONES = 'ignoreMilestones';
export const ALLOW_FETCH = 'allowFetch';
export const ALWAYS_PROMPT_FOR_NEW_ISSUE_REPO = 'alwaysPromptForNewIssueRepo';
export const ISSUE_AVATAR_DISPLAY = 'issueAvatarDisplay';
export const EXPERIMENTAL_CHAT = 'experimental.chat';
export const EXPERIMENTAL_USE_QUICK_CHAT = 'experimental.useQuickChat';
export const EXPERIMENTAL_NOTIFICATIONS_PAGE_SIZE = 'experimental.notificationsViewPageSize';
export const EXPERIMENTAL_NOTIFICATIONS_SCORE = 'experimental.notificationsScore';
export const WEBVIEW_REFRESH_INTERVAL = 'webviewRefreshInterval';
export const DEV_MODE = 'devMode';

// git
export const GIT = 'git';
export const PULL_BEFORE_CHECKOUT = 'pullBeforeCheckout';
export const OPEN_DIFF_ON_CLICK = 'openDiffOnClick';
export const SHOW_INLINE_OPEN_FILE_ACTION = 'showInlineOpenFileAction';
export const AUTO_STASH = 'autoStash';
export const BRANCH_WHITESPACE_CHAR = 'branchWhitespaceChar';
export const BRANCH_RANDOM_NAME_DICTIONARY = 'branchRandomName.dictionary';

// GitHub Enterprise
export const GITHUB_ENTERPRISE = 'github-enterprise';
export const URI = 'uri';

// Editor
export const EDITOR = 'editor';
export const WORD_WRAP = 'wordWrap';

// Comments
export const COMMENTS = 'comments';
export const OPEN_VIEW = 'openView';

// Workbench
export const WORKBENCH = 'workbench';
export const COLOR_THEME = 'colorTheme';

// Coding Agent

export const CODING_AGENT = `${PR_SETTINGS_NAMESPACE}.codingAgent`;
export const CODING_AGENT_ENABLED = 'enabled';
export const CODING_AGENT_AUTO_COMMIT_AND_PUSH = 'autoCommitAndPush';
export const CODING_AGENT_PROMPT_FOR_CONFIRMATION = 'promptForConfirmation';
export const SHOW_CODE_LENS = 'codeLens';
4 changes: 2 additions & 2 deletions src/view/treeNodes/repositoryChangesNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import * as vscode from 'vscode';
import { Repository } from '../../api/api';
import Logger, { PR_TREE } from '../../common/logger';
import { AUTO_REVEAL, EXPLORER } from '../../common/settingKeys';
import { FILE_AUTO_REVEAL, PR_SETTINGS_NAMESPACE } from '../../common/settingKeys';
import { DataUri, Schemes } from '../../common/uri';
import { FolderRepositoryManager } from '../../github/folderRepositoryManager';
import { PullRequestModel } from '../../github/pullRequestModel';
Expand Down Expand Up @@ -51,7 +51,7 @@ export class RepositoryChangesNode extends TreeNode implements vscode.TreeItem {
this.getTreeItem();

this._register(vscode.window.onDidChangeActiveTextEditor(e => {
if (vscode.workspace.getConfiguration(EXPLORER).get(AUTO_REVEAL)) {
if (vscode.workspace.getConfiguration(PR_SETTINGS_NAMESPACE).get(FILE_AUTO_REVEAL)) {
const tabInput = vscode.window.tabGroups.activeTabGroup.activeTab?.input;
if (tabInput instanceof vscode.TabInputTextDiff) {
if ((tabInput.original.scheme === Schemes.Review)
Expand Down