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 @@ -746,6 +746,11 @@
"default": "${issueTitle}\nFixes ${issueNumberLabel}",
"markdownDescription": "%githubIssues.issueCompletionFormatScm.markdownDescription%"
},
"githubIssues.issueCompletionFormatEditor": {
"type": "string",
"default": "${issueNumberLabel}",
"markdownDescription": "%githubIssues.issueCompletionFormatEditor.markdownDescription%"
},
"githubIssues.workingIssueFormatScm": {
"type": "string",
"default": "${issueTitle} \nFixes ${issueNumberLabel}",
Expand Down
6 changes: 6 additions & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@
"Do not translate what's inside of the ${...}. It is an internal syntax for the extension."
]
},
"githubIssues.issueCompletionFormatEditor.markdownDescription": {
"message": "Sets the format of issue completions in the editor. \n- `${user}` will be replaced with the currently logged in username \n- `${issueNumber}` will be replaced with the current issue number \n- `${issueNumberLabel}` will be replaced with a label formatted as #number or owner/repository#number, depending on whether the issue is in the current repository \n- `${issueTitle}` will be replaced with the issue title",
Comment on lines +160 to +161
"comment": [
"Do not translate what's inside of the ${...}. It is an internal syntax for the extension."
]
},
"githubIssues.workingIssueFormatScm.markdownDescription": {
"message": "Sets the format of the commit message that is set in the SCM inputbox when you **Start Working on an Issue**. Defaults to `${issueTitle} \nFixes ${issueNumberLabel}`",
"comment": [
Expand Down
1 change: 1 addition & 0 deletions src/common/settingKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ 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 ISSUE_COMPLETION_FORMAT_EDITOR = 'issueCompletionFormatEditor';
export const CREATE_ISSUE_TRIGGERS = 'createIssueTriggers';
export const DEFAULT = 'default';
export const IGNORE_MILESTONES = 'ignoreMilestones';
Expand Down
13 changes: 9 additions & 4 deletions src/issues/issueCompletionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import * as vscode from 'vscode';
import {
IGNORE_COMPLETION_TRIGGER,
ISSUE_COMPLETION_FORMAT_EDITOR,
ISSUE_COMPLETION_FORMAT_SCM,
ISSUES_SETTINGS_NAMESPACE,
} from '../common/settingKeys';
Expand Down Expand Up @@ -208,11 +209,15 @@ export class IssueCompletionProvider implements vscode.CompletionItemProvider {
if (document.languageId === 'markdown') {
item.insertText = `[${getIssueNumberLabel(issue, repo)}](${issue.html_url})`;
} else {
const configuration = vscode.workspace
let completionFormatSetting = ISSUE_COMPLETION_FORMAT_EDITOR;
if (document.uri.path.match(/git\/scm\d\/input/)) {
completionFormatSetting = ISSUE_COMPLETION_FORMAT_SCM;
}
const completionFormat = vscode.workspace
.getConfiguration(ISSUES_SETTINGS_NAMESPACE)
.get(ISSUE_COMPLETION_FORMAT_SCM);
if (document.uri.path.match(/git\/scm\d\/input/) && typeof configuration === 'string') {
item.insertText = variableSubstitution(configuration, issue, repo);
.get(completionFormatSetting);
if (typeof completionFormat === 'string') {
item.insertText = variableSubstitution(completionFormat, issue, repo);
} else {
item.insertText = `${getIssueNumberLabel(issue, repo)}`;
}
Expand Down