Skip to content
Draft
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 @@ -824,6 +824,11 @@
"default": "author",
"description": "%githubIssues.issueAvatarDisplay.description%"
},
"githubIssues.showIssueNumberInTree": {
"type": "boolean",
"default": false,
"description": "%githubIssues.showIssueNumberInTree.description%"
},
"githubPullRequests.focusedMode": {
"properties": {
"oneOf": [
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
"githubIssues.issueAvatarDisplay.description": "Controls which avatar to display in the issue list.",
"githubIssues.issueAvatarDisplay.author": "Show the avatar of the issue creator.",
"githubIssues.issueAvatarDisplay.assignee": "Show the avatar of the first assignee (show GitHub icon if no assignees).",
"githubIssues.showIssueNumberInTree.description": "Shows the issue number in the tree view.",
"githubPullRequests.focusedMode.description": "The layout to use when a pull request is checked out. Set to false to prevent layout changes.",
"githubPullRequests.focusedMode.firstDiff": "Show the first diff in the pull request. If there are no changes, show the overview.",
"githubPullRequests.focusedMode.overview": "Show the overview of the pull request.",
Expand Down
1 change: 1 addition & 0 deletions src/common/settingKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ 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 SHOW_ISSUE_NUMBER_IN_TREE = 'showIssueNumberInTree';
export const EXPERIMENTAL_CHAT = 'experimental.chat';
export const EXPERIMENTAL_USE_QUICK_CHAT = 'experimental.useQuickChat';
export const EXPERIMENTAL_NOTIFICATIONS_PAGE_SIZE = 'experimental.notificationsViewPageSize';
Expand Down
13 changes: 9 additions & 4 deletions src/issues/issuesView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as vscode from 'vscode';
import { issueBodyHasLink } from './issueLinkLookup';
import { IssueItem, QueryGroup, StateManager } from './stateManager';
import { commands, contexts } from '../common/executeCommands';
import { ISSUE_AVATAR_DISPLAY, IssueAvatarDisplay, ISSUES_SETTINGS_NAMESPACE } from '../common/settingKeys';
import { ISSUE_AVATAR_DISPLAY, IssueAvatarDisplay, ISSUES_SETTINGS_NAMESPACE, SHOW_ISSUE_NUMBER_IN_TREE } from '../common/settingKeys';
import { DataUri } from '../common/uri';
import { groupBy } from '../common/utils';
import { FolderRepositoryManager, ReposManagerState } from '../github/folderRepositoryManager';
Expand Down Expand Up @@ -65,7 +65,8 @@ export class IssuesTreeData
// Listen for changes to the avatar display setting
context.subscriptions.push(
vscode.workspace.onDidChangeConfiguration(change => {
if (change.affectsConfiguration(`${ISSUES_SETTINGS_NAMESPACE}.${ISSUE_AVATAR_DISPLAY}`)) {
if (change.affectsConfiguration(`${ISSUES_SETTINGS_NAMESPACE}.${ISSUE_AVATAR_DISPLAY}`)
|| change.affectsConfiguration(`${ISSUES_SETTINGS_NAMESPACE}.${SHOW_ISSUE_NUMBER_IN_TREE}`)) {
this._onDidChangeTreeData.fire();
}
}),
Expand All @@ -87,7 +88,11 @@ export class IssuesTreeData
}

private async getIssueTreeItem(element: IssueItem): Promise<vscode.TreeItem> {
const treeItem = new vscode.TreeItem(element.title, vscode.TreeItemCollapsibleState.None);
const showIssueNumber = vscode.workspace
.getConfiguration(ISSUES_SETTINGS_NAMESPACE, null)
.get<boolean>(SHOW_ISSUE_NUMBER_IN_TREE, false);
const numberPrefix = showIssueNumber ? `#${element.number}: ` : '';
const treeItem = new vscode.TreeItem(`${numberPrefix}${element.title}`, vscode.TreeItemCollapsibleState.None);

const avatarDisplaySetting = vscode.workspace
.getConfiguration(ISSUES_SETTINGS_NAMESPACE, null)
Expand Down Expand Up @@ -133,7 +138,7 @@ export class IssuesTreeData
// Escape any $(...) syntax to avoid rendering issue titles as icons.
const escapedTitle = element.title.replace(/\$\([a-zA-Z0-9~-]+\)/g, '\\$&');
const label: vscode.TreeItemLabel2 = {
label: new vscode.MarkdownString(`$(check) ${escapedTitle}`, true)
label: new vscode.MarkdownString(`$(check) ${numberPrefix}${escapedTitle}`, true)
};
treeItem.label = label as vscode.TreeItemLabel;
treeItem.contextValue = 'currentissue';
Expand Down