The use case that describes Autolink usage with JIRA and discussed originally on #897, is not as robust as it could be.
Current example:
"gitlens.autolinks": [
{ "prefix": "JIRA-", "url": "https://jira.company.com/issue?query=<num>" }
]
- The feature requires a prefix of
JIRA-, but in the real world, each project has a different prefix, this means you have to literally configure this setting for every VSCode project. Too much work to maintain.
- The feature only looks for a
<num> which I assume to be a numeric value, but in the real world Jira on Atlassian Cloud needs both the project ID AND the issue number together to navigate you to the issue. The URLs look something like this http://<company>.atlassian.net/browse/JIRA-123 where JIRA is the project id and 123 is the issue number. Again, this could be manually done for each repository but this could be simplified with a regular expression pattern match.
This feature request would be to expand the configuration to support regular expression pattern matching using parentheses to capture the necessary info into a group, and then use backreferences like $1 for each capture group in the URL replacement.
Proposed example:
"gitlens.autolinks": [
{ "regex": "(\b\w+[-]\d+\b)", "url": "https://<company>.atlassian.net/browse/$1" }
]
The feature would need to be able to run multiple times over a commit message, in case multiple issues are referenced, all of them need to be linked.
The feature would need to support multi-line commit messages.
Example of the pattern being used above
https://regex101.com/r/0tABhu/1
The use case that describes Autolink usage with JIRA and discussed originally on #897, is not as robust as it could be.
Current example:
JIRA-, but in the real world, each project has a different prefix, this means you have to literally configure this setting for every VSCode project. Too much work to maintain.<num>which I assume to be a numeric value, but in the real world Jira on Atlassian Cloud needs both the project ID AND the issue number together to navigate you to the issue. The URLs look something like thishttp://<company>.atlassian.net/browse/JIRA-123whereJIRAis the project id and123is the issue number. Again, this could be manually done for each repository but this could be simplified with a regular expression pattern match.This feature request would be to expand the configuration to support regular expression pattern matching using parentheses to capture the necessary info into a group, and then use backreferences like
$1for each capture group in the URL replacement.Proposed example:
The feature would need to be able to run multiple times over a commit message, in case multiple issues are referenced, all of them need to be linked.
The feature would need to support multi-line commit messages.
Example of the pattern being used above
https://regex101.com/r/0tABhu/1