Skip to content

Commit

Permalink
proper name for register function: registerFileDecorationProvider, mi…
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken authored and chenjigeng committed Nov 22, 2020
1 parent d6a1fce commit ea8948a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions extensions/git/src/decorationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class GitIgnoreDecorationProvider implements FileDecorationProvider {
model.onDidCloseRepository
));

this.disposables.push(window.registerDecorationProvider(this));
this.disposables.push(window.registerFileDecorationProvider(this));
}

async provideFileDecoration(uri: Uri): Promise<FileDecoration | undefined> {
Expand Down Expand Up @@ -100,7 +100,7 @@ class GitDecorationProvider implements FileDecorationProvider {

constructor(private repository: Repository) {
this.disposables.push(
window.registerDecorationProvider(this),
window.registerFileDecorationProvider(this),
repository.onDidRunGitStatus(this.onDidRunGitStatus, this)
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ declare module 'vscode' {
}

export namespace window {
export function registerDecorationProvider(provider: FileDecorationProvider): Disposable;
export function registerFileDecorationProvider(provider: FileDecorationProvider): Disposable;
}

//#endregion
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/api/common/extHost.api.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
registerCustomEditorProvider: (viewType: string, provider: vscode.CustomTextEditorProvider | vscode.CustomReadonlyEditorProvider, options: { webviewOptions?: vscode.WebviewPanelOptions, supportsMultipleEditorsPerDocument?: boolean } = {}) => {
return extHostCustomEditors.registerCustomEditorProvider(extension, viewType, provider, options);
},
registerDecorationProvider(provider: vscode.FileDecorationProvider) {
registerFileDecorationProvider(provider: vscode.FileDecorationProvider) {
checkProposedApiEnabled(extension);
return extHostDecorations.registerDecorationProvider(provider, extension.identifier);
return extHostDecorations.registerFileDecorationProvider(provider, extension.identifier);
},
registerUriHandler(handler: vscode.UriHandler) {
return extHostUrls.registerUriHandler(extension.identifier, handler);
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/api/common/extHostDecorations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class ExtHostDecorations implements ExtHostDecorationsShape {
this._proxy = extHostRpc.getProxy(MainContext.MainThreadDecorations);
}

registerDecorationProvider(provider: vscode.FileDecorationProvider, extensionId: ExtensionIdentifier): vscode.Disposable {
registerFileDecorationProvider(provider: vscode.FileDecorationProvider, extensionId: ExtensionIdentifier): vscode.Disposable {
const handle = ExtHostDecorations._handlePool++;
this._provider.set(handle, { provider, extensionId });
this._proxy.$registerDecorationProvider(handle, extensionId.value);
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/test/browser/api/extHostDecorations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ suite('ExtHostDecorations', function () {
let calledB = false;

// never returns
extHostDecorations.registerDecorationProvider({
extHostDecorations.registerFileDecorationProvider({

provideFileDecoration() {
calledA = true;
Expand All @@ -55,7 +55,7 @@ suite('ExtHostDecorations', function () {
}, nullExtensionDescription.identifier);

// always returns
extHostDecorations.registerDecorationProvider({
extHostDecorations.registerFileDecorationProvider({

provideFileDecoration() {
calledB = true;
Expand Down

0 comments on commit ea8948a

Please sign in to comment.