Gitlens是vscode中的一個插件,它提供了很多有用的功能,例如copy remote file url
圖片.png
之前一直用的好好的霹俺,復(fù)制出來的鏈接也能用(之前用的是Github)谐宙,可是今天在用這個功能的時候開始“報(bào)錯”:no auto-detected or configured remote providers found
圖片.png
去人家的官網(wǎng)看了看,人家是這么說的:
GitLens provides rich integrations with many remote providers, including GitHub, GitHub Enterprise, GitLab, Bitbucket, Bitbucket Server, Azure DevOps. You can also define custom remote providers or remote providers with custom domains as well.
大概就是筝尾,人家內(nèi)部支持了這些git倉庫捡需,但是別的倉庫你也可以自己配置。
下面的就是我配置的gitee
"gitlens.remotes": [{
"domain": "gitee.com",
"type": "Custom",
"name": "My Company",
"protocol": "https",
"urls": {
"repository": "https://gitee.com/${repo}",
"branches": "https://gitee.com/${repo}/branches",
"branch": "https://gitee.com/${repo}/commits/${branch}",
"commit": "https://gitee.com/${repo}/commit/${id}",
"file": "https://gitee.com/${repo}?path=${file}${line}",
"fileInBranch": "https://gitee.com/${repo}/blob/${branch}/${file}${line}",
"fileInCommit": "https://gitee.com/${repo}/blob/${id}/${file}${line}",
"fileLine": "#L${line}",
"fileRange": "#L${start}-L${end}"
}
}]