mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-09 09:24:12 -05:00
git: use different uris for quick diff
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user