Gitlens是vscode中的一個(gè)插件,它提供了很多有用的功能,例如copy remote file url

圖片.png
之前一直用的好好的,復(fù)制出來的鏈接也能用(之前用的是Github),可是今天在用這個(gè)功能的時(shí)候開始“報(bào)錯(cuò)”: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倉(cāng)庫(kù),但是別的倉(cāng)庫(kù)你也可以自己配置。
下面的就是我配置的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}"
}
}]