Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Take 1.11.0 of vscode.proposed.d.ts #155

Merged
merged 1 commit into from
Mar 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/tfvc/tfvcscmprovider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"use strict";

import { Logger } from "../helpers/logger";
import { commands, scm, Uri, Disposable, SCMProvider, SCMResource, SCMResourceGroup, Event, EventEmitter, ProviderResult, workspace } from "vscode";
import { TfvcCommandNames } from "../helpers/constants";
import { CancellationToken, commands, scm, Uri, Disposable, SCMProvider, SCMResource, SCMResourceGroup, Event, EventEmitter, ProviderResult, workspace } from "vscode";
import { CommitHoverProvider } from "./scm/commithoverprovider";
import { Model } from "./scm/model";
import { Status } from "./scm/status";
Expand Down Expand Up @@ -241,6 +242,11 @@ export class TfvcSCMProvider implements SCMProvider {
return uri.with({ scheme: TfvcSCMProvider.scmScheme });
}

acceptChanges(token: CancellationToken): ProviderResult<void> {
console.log("acceptChanges", token);
return commands.executeCommand<void>(TfvcCommandNames.Checkin);
}

dispose(): void {
TfvcSCMProvider.instance = undefined;
this.cleanup();
Expand Down
11 changes: 11 additions & 0 deletions src/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,12 @@ export type ProviderResult<T> = T | undefined | null | Thenable<T | undefined |
readonly resources: SCMResourceGroup[];
readonly onDidChange: Event<SCMResourceGroup[]>;
readonly count?: number | undefined;
readonly state?: string;

getOriginalResource?(uri: Uri, token: CancellationToken): ProviderResult<Uri>;
open?(resource: SCMResource, token: CancellationToken): ProviderResult<void>;
drag?(resource: SCMResource, resourceGroup: SCMResourceGroup, token: CancellationToken): ProviderResult<void>;
acceptChanges?(token: CancellationToken): ProviderResult<void>;
}

export interface SCMInputBox {
Expand All @@ -156,5 +158,14 @@ export type ProviderResult<T> = T | undefined | null | Thenable<T | undefined |
export function getResourceFromURI(uri: Uri): SCMResource | SCMResourceGroup | undefined;
export function registerSCMProvider(id: string, provider: SCMProvider): Disposable;
}

export interface LineChange {
readonly originalStartLineNumber: number;
readonly originalEndLineNumber: number;
readonly modifiedStartLineNumber: number;
readonly modifiedEndLineNumber: number;
}

export function computeDiff(oneDocument: TextDocument, otherDocument: TextDocument): Thenable<LineChange[]>;
}
/* tslint:enable */