Add QuickDiffProvider

[?]
Dec 30, 2020, 3:14 AM
OXW4KMVURSBSSHOFK4DADOGVBRCURJ6EFFU6BBZE6IQC7BUBR5IQC

Dependencies

  • [2] ODRMVURU Implement first iteration of file diffing
  • [3] EJYTCVNQ Add stderr to error message when pijul CLI command fails
  • [4] ZGMIJNFV Create pijul.ts for executing commands using the Pijul CLI
  • [5] YUVLBWV3 Populate resource groups for unrecorded and untracked changes
  • [6] H6KYVQ2Q Add a class to represent resources
  • [*] B4SKYP3Y Add repository model and add steps to initialize it
  • [*] 6ONRFFRG First pass of file decorations

Change contents

  • edit in src/repository.ts at line 94
    [2.101]
    [9.241]
    this.sourceControl.quickDiffProvider = this.repository;
  • replacement in src/pijul.ts at line 5
    [3.692][2.102:205]()
    import { CancellationToken, TextDocument, TextDocumentContentProvider, Uri, workspace } from 'vscode';
    [3.692]
    [3.5832]
    import { CancellationToken, QuickDiffProvider, TextDocument, TextDocumentContentProvider, Uri, workspace } from 'vscode';
  • replacement in src/pijul.ts at line 135
    [3.4343][2.206:271]()
    export class Repository implements TextDocumentContentProvider {
    [3.4343]
    [3.4369]
    export class Repository implements TextDocumentContentProvider, QuickDiffProvider {
  • edit in src/pijul.ts at line 150
    [3.834]
    [2.272]
    * Implementation of QuickDiffProvider, sets the scheme of a given URI to 'pijul' so that VS Code can access the last recorded copy of a file
    * @param uri The URI of the real file which VS Code is trying to quick diff
    * @param _token An unused cancellation token
    */
    async provideOriginalResource (uri: Uri, _token: CancellationToken): Promise<Uri> {
    return uri.with({ scheme: 'pijul' });
    }
    /**