Change the git extension to use shared tsconfig
This commit is contained in:
parent
52d3961c2b
commit
6d11792abf
|
@ -9,7 +9,7 @@ import { Model } from '../model';
|
|||
import { GitExtension, Repository, API } from './git';
|
||||
import { ApiRepository, ApiImpl } from './api1';
|
||||
|
||||
export function deprecated(target: any, key: string, descriptor: any): void {
|
||||
export function deprecated(_target: any, key: string, descriptor: any): void {
|
||||
if (typeof descriptor.value !== 'function') {
|
||||
throw new Error('not supported');
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ interface Command {
|
|||
const Commands: Command[] = [];
|
||||
|
||||
function command(commandId: string, options: CommandOptions = {}): Function {
|
||||
return (target: any, key: string, descriptor: any) => {
|
||||
return (_target: any, key: string, descriptor: any) => {
|
||||
if (!(typeof descriptor.value === 'function')) {
|
||||
throw new Error('not supported');
|
||||
}
|
||||
|
@ -146,11 +146,11 @@ async function categorizeResourceByResolution(resources: Resource[]): Promise<{
|
|||
const possibleUnresolved = merge.filter(isBothAddedOrModified);
|
||||
const promises = possibleUnresolved.map(s => grep(s.resourceUri.fsPath, /^<{7}|^={7}|^>{7}/));
|
||||
const unresolvedBothModified = await Promise.all<boolean>(promises);
|
||||
const resolved = possibleUnresolved.filter((s, i) => !unresolvedBothModified[i]);
|
||||
const resolved = possibleUnresolved.filter((_s, i) => !unresolvedBothModified[i]);
|
||||
const deletionConflicts = merge.filter(s => isAnyDeleted(s));
|
||||
const unresolved = [
|
||||
...merge.filter(s => !isBothAddedOrModified(s) && !isAnyDeleted(s)),
|
||||
...possibleUnresolved.filter((s, i) => unresolvedBothModified[i])
|
||||
...possibleUnresolved.filter((_s, i) => unresolvedBothModified[i])
|
||||
];
|
||||
|
||||
return { merge, resolved, unresolved, deletionConflicts };
|
||||
|
@ -304,6 +304,7 @@ export class CommandCenter {
|
|||
case Status.DELETED_BY_THEM:
|
||||
return this.getURI(resource.resourceUri, '');
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private async getRightResource(resource: Resource): Promise<Uri | undefined> {
|
||||
|
@ -346,6 +347,7 @@ export class CommandCenter {
|
|||
case Status.BOTH_MODIFIED:
|
||||
return resource.resourceUri;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private getTitle(resource: Resource): string {
|
||||
|
@ -2052,6 +2054,7 @@ export class CommandCenter {
|
|||
return repository.workingTreeGroup.resourceStates.filter(r => r.resourceUri.toString() === uriString)[0]
|
||||
|| repository.indexGroup.resourceStates.filter(r => r.resourceUri.toString() === uriString)[0];
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private runByRepository<T>(resource: Uri, fn: (repository: Repository, resource: Uri) => Promise<T>): Promise<T[]>;
|
||||
|
|
|
@ -56,6 +56,7 @@ class GitIgnoreDecorationProvider implements DecorationProvider {
|
|||
color: new ThemeColor('gitDecoration.ignoredResourceForeground')
|
||||
};
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { done } from './util';
|
||||
|
||||
function decorate(decorator: (fn: Function, key: string) => Function): Function {
|
||||
return (target: any, key: string, descriptor: any) => {
|
||||
return (_target: any, key: string, descriptor: any) => {
|
||||
let fnKey: string | null = null;
|
||||
let fn: Function | null = null;
|
||||
|
||||
|
|
|
@ -846,7 +846,7 @@ export class Repository implements Disposable {
|
|||
});
|
||||
}
|
||||
|
||||
async branch(name: string, checkout: boolean, ref?: string): Promise<void> {
|
||||
async branch(name: string, _checkout: boolean, _ref?: string): Promise<void> {
|
||||
await this.run(Operation.Branch, () => this.repository.branch(name, true));
|
||||
}
|
||||
|
||||
|
@ -1292,6 +1292,7 @@ export class Repository implements Disposable {
|
|||
case 'M': workingTree.push(new Resource(ResourceGroupType.WorkingTree, uri, Status.MODIFIED, useIcons, renameUri)); break;
|
||||
case 'D': workingTree.push(new Resource(ResourceGroupType.WorkingTree, uri, Status.DELETED, useIcons, renameUri)); break;
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
|
||||
// set resource groups
|
||||
|
@ -1342,7 +1343,7 @@ export class Repository implements Disposable {
|
|||
}
|
||||
}
|
||||
|
||||
private onFSChange(uri: Uri): void {
|
||||
private onFSChange(_uri: Uri): void {
|
||||
const config = workspace.getConfiguration('git');
|
||||
const autorefresh = config.get<boolean>('autorefresh');
|
||||
|
||||
|
|
|
@ -1,19 +1,13 @@
|
|||
{
|
||||
"extends": "../shared.tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"lib": [
|
||||
"es2016"
|
||||
],
|
||||
"module": "commonjs",
|
||||
"outDir": "./out",
|
||||
"experimentalDecorators": true,
|
||||
"typeRoots": [
|
||||
"./node_modules/@types"
|
||||
],
|
||||
"strict": true,
|
||||
"experimentalDecorators": true,
|
||||
"noUnusedLocals": true
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue