提交 0ff45fcd 编写于 作者: J Joao Moreno

git: use different uris for quick diff

上级 7f0f3103
......@@ -32,7 +32,8 @@ export class GitContentProvider {
constructor(private model: Model) {
this.disposables.push(
model.onDidChangeRepository(this.eventuallyFireChangeEvents, this),
workspace.registerTextDocumentContentProvider('git', this)
workspace.registerTextDocumentContentProvider('git', this),
workspace.registerTextDocumentContentProvider('git-original', this)
);
setInterval(() => this.cleanup(), FIVE_MINUTES);
......@@ -52,6 +53,10 @@ export class GitContentProvider {
}
async provideTextDocumentContent(uri: Uri): Promise<string> {
if (uri.scheme === 'git-original') {
uri = new Uri().with({ scheme: 'git', path: uri.query });
}
let ref = uri.query;
if (ref === '~') {
......
......@@ -62,7 +62,9 @@ export class GitSCMProvider implements SCMProvider {
return;
}
return uri.with({ scheme: 'git' });
// As a mitigation for extensions like ESLint showing warnings and errors
// for git URIs, let's change the file extension of these uris to .git.
return new Uri().with({ scheme: 'git-original', query: uri.path, path: uri.path + '.git' });
}
dispose(): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册