mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
Git - remove the usages of any (#270179)
* Git - remove the usages of `any` * Remove debug message
This commit is contained in:
7
.vscode/searches/no-any-casts.code-search
vendored
7
.vscode/searches/no-any-casts.code-search
vendored
@@ -79,13 +79,6 @@ vscode • extensions/css-language-features/server/src/cssServer.ts:
|
||||
74: // eslint-disable-next-line local/code-no-any-casts
|
||||
171: // eslint-disable-next-line local/code-no-any-casts
|
||||
|
||||
vscode • extensions/git/src/commands.ts:
|
||||
5369: // eslint-disable-next-line local/code-no-any-casts
|
||||
|
||||
vscode • extensions/git/src/util.ts:
|
||||
46: // eslint-disable-next-line local/code-no-any-casts
|
||||
118: // eslint-disable-next-line local/code-no-any-casts
|
||||
|
||||
vscode • extensions/git-base/src/api/api1.ts:
|
||||
17: // eslint-disable-next-line local/code-no-any-casts
|
||||
38: // eslint-disable-next-line local/code-no-any-casts
|
||||
|
||||
@@ -5366,8 +5366,7 @@ export class CommandCenter {
|
||||
};
|
||||
|
||||
// patch this object, so people can call methods directly
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
(this as any)[key] = result;
|
||||
(this as Record<string, unknown>)[key] = result;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as path from 'path';
|
||||
import { Repository, GitResourceGroup } from './repository';
|
||||
import { Model } from './model';
|
||||
import { debounce } from './decorators';
|
||||
import { filterEvent, dispose, anyEvent, fireEvent, PromiseSource, combinedDisposable, runAndSubscribeEvent } from './util';
|
||||
import { filterEvent, dispose, anyEvent, PromiseSource, combinedDisposable, runAndSubscribeEvent } from './util';
|
||||
import { Change, GitErrorCodes, Status } from './api/git';
|
||||
|
||||
function equalSourceControlHistoryItemRefs(ref1?: SourceControlHistoryItemRef, ref2?: SourceControlHistoryItemRef): boolean {
|
||||
@@ -25,17 +25,19 @@ class GitIgnoreDecorationProvider implements FileDecorationProvider {
|
||||
|
||||
private static Decoration: FileDecoration = { color: new ThemeColor('gitDecoration.ignoredResourceForeground') };
|
||||
|
||||
readonly onDidChangeFileDecorations: Event<Uri[]>;
|
||||
private readonly _onDidChangeDecorations = new EventEmitter<undefined | Uri | Uri[]>();
|
||||
readonly onDidChangeFileDecorations: Event<undefined | Uri | Uri[]> = this._onDidChangeDecorations.event;
|
||||
|
||||
private queue = new Map<string, { repository: Repository; queue: Map<string, PromiseSource<FileDecoration | undefined>> }>();
|
||||
private disposables: Disposable[] = [];
|
||||
|
||||
constructor(private model: Model) {
|
||||
this.onDidChangeFileDecorations = fireEvent(anyEvent<any>(
|
||||
const onDidChangeRepository = anyEvent<any>(
|
||||
filterEvent(workspace.onDidSaveTextDocument, e => /\.gitignore$|\.git\/info\/exclude$/.test(e.uri.path)),
|
||||
model.onDidOpenRepository,
|
||||
model.onDidCloseRepository
|
||||
));
|
||||
|
||||
);
|
||||
this.disposables.push(onDidChangeRepository(() => this._onDidChangeDecorations.fire(undefined)));
|
||||
this.disposables.push(window.registerFileDecorationProvider(this));
|
||||
}
|
||||
|
||||
|
||||
@@ -42,11 +42,6 @@ export function combinedDisposable(disposables: IDisposable[]): IDisposable {
|
||||
|
||||
export const EmptyDisposable = toDisposable(() => null);
|
||||
|
||||
export function fireEvent<T>(event: Event<T>): Event<T> {
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
return (listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]) => event(_ => (listener as any).call(thisArgs), null, disposables);
|
||||
}
|
||||
|
||||
export function mapEvent<I, O>(event: Event<I>, map: (i: I) => O): Event<O> {
|
||||
return (listener: (e: O) => any, thisArgs?: any, disposables?: Disposable[]) => event(i => listener.call(thisArgs, map(i)), null, disposables);
|
||||
}
|
||||
@@ -115,8 +110,8 @@ export function once(fn: (...args: any[]) => any): (...args: any[]) => any {
|
||||
|
||||
export function assign<T>(destination: T, ...sources: any[]): T {
|
||||
for (const source of sources) {
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
Object.keys(source).forEach(key => (destination as any)[key] = source[key]);
|
||||
Object.keys(source).forEach(key =>
|
||||
(destination as Record<string, unknown>)[key] = source[key]);
|
||||
}
|
||||
|
||||
return destination;
|
||||
|
||||
Reference in New Issue
Block a user