enable @typescript-eslint/member-delimiter-style, https://github.com/microsoft/vscode/issues/140391

This commit is contained in:
Johannes Rieken
2022-02-02 14:34:41 +01:00
parent 5abc4e0071
commit 4a130c40ed
954 changed files with 3017 additions and 3016 deletions

View File

@@ -36,7 +36,7 @@ export interface StatusPipeArgs {
export interface ExtensionManagementPipeArgs {
type: 'extensionManagement';
list?: { showVersions?: boolean, category?: string; };
list?: { showVersions?: boolean; category?: string };
install?: string[];
uninstall?: string[];
force?: boolean;

View File

@@ -183,7 +183,7 @@ class DebugTerminalCollection {
*/
private static minUseDelay = 1000;
private _terminalInstances = new Map<vscode.Terminal, { lastUsedAt: number, config: string }>();
private _terminalInstances = new Map<vscode.Terminal, { lastUsedAt: number; config: string }>();
public async checkout(config: string, name: string) {
const entries = [...this._terminalInstances.entries()];

View File

@@ -24,7 +24,7 @@ class NodeModuleRequireInterceptor extends RequireInterceptor {
const that = this;
const node_module = <any>require.__$__nodeRequire('module');
const originalLoad = node_module._load;
node_module._load = function load(request: string, parent: { filename: string; }, isMain: boolean) {
node_module._load = function load(request: string, parent: { filename: string }, isMain: boolean) {
request = applyAlternatives(request);
if (!that._factories.has(request)) {
return originalLoad.apply(this, arguments);

View File

@@ -95,7 +95,7 @@ export class ExtHostTask extends ExtHostTaskBase {
}
}
protected provideTasksInternal(validTypes: { [key: string]: boolean; }, taskIdPromises: Promise<void>[], handler: HandlerData, value: vscode.Task[] | null | undefined): { tasks: tasks.TaskDTO[], extension: IExtensionDescription } {
protected provideTasksInternal(validTypes: { [key: string]: boolean }, taskIdPromises: Promise<void>[], handler: HandlerData, value: vscode.Task[] | null | undefined): { tasks: tasks.TaskDTO[]; extension: IExtensionDescription } {
const taskDTOs: tasks.TaskDTO[] = [];
if (value) {
for (let task of value) {
@@ -152,7 +152,7 @@ export class ExtHostTask extends ExtHostTaskBase {
};
}
public async $resolveVariables(uriComponents: UriComponents, toResolve: { process?: { name: string; cwd?: string; path?: string }, variables: string[] }): Promise<{ process?: string, variables: { [key: string]: string; } }> {
public async $resolveVariables(uriComponents: UriComponents, toResolve: { process?: { name: string; cwd?: string; path?: string }; variables: string[] }): Promise<{ process?: string; variables: { [key: string]: string } }> {
const uri: URI = URI.revive(uriComponents);
const result = {
process: <unknown>undefined as string,

View File

@@ -28,8 +28,8 @@ class ExtensionTunnel implements vscode.Tunnel {
onDidDispose: Event<void> = this._onDispose.event;
constructor(
public readonly remoteAddress: { port: number, host: string },
public readonly localAddress: { port: number, host: string } | string,
public readonly remoteAddress: { port: number; host: string },
public readonly localAddress: { port: number; host: string } | string,
private readonly _dispose: () => Promise<void>) { }
dispose(): Promise<void> {
@@ -38,9 +38,9 @@ class ExtensionTunnel implements vscode.Tunnel {
}
}
export function getSockets(stdout: string): Record<string, { pid: number; socket: number; }> {
export function getSockets(stdout: string): Record<string, { pid: number; socket: number }> {
const lines = stdout.trim().split('\n');
const mapped: { pid: number, socket: number }[] = [];
const mapped: { pid: number; socket: number }[] = [];
lines.forEach(line => {
const match = /\/proc\/(\d+)\/fd\/\d+ -> socket:\[(\d+)\]/.exec(line)!;
if (match && match.length >= 3) {
@@ -57,7 +57,7 @@ export function getSockets(stdout: string): Record<string, { pid: number; socket
return socketMap;
}
export function loadListeningPorts(...stdouts: string[]): { socket: number, ip: string, port: number }[] {
export function loadListeningPorts(...stdouts: string[]): { socket: number; ip: string; port: number }[] {
const table = ([] as Record<string, string>[]).concat(...stdouts.map(loadConnectionTable));
return [
...new Map(
@@ -113,7 +113,7 @@ function knownExcludeCmdline(command: string): boolean {
export function getRootProcesses(stdout: string) {
const lines = stdout.trim().split('\n');
const mapped: { pid: number, cmd: string, ppid: number }[] = [];
const mapped: { pid: number; cmd: string; ppid: number }[] = [];
lines.forEach(line => {
const match = /^\d+\s+\D+\s+root\s+(\d+)\s+(\d+).+\d+\:\d+\:\d+\s+(.+)$/.exec(line)!;
if (match && match.length >= 4) {
@@ -127,7 +127,7 @@ export function getRootProcesses(stdout: string) {
return mapped;
}
export async function findPorts(connections: { socket: number, ip: string, port: number }[], socketMap: Record<string, { pid: number, socket: number }>, processes: { pid: number, cwd: string, cmd: string }[]): Promise<CandidatePort[]> {
export async function findPorts(connections: { socket: number; ip: string; port: number }[], socketMap: Record<string, { pid: number; socket: number }>, processes: { pid: number; cwd: string; cmd: string }[]): Promise<CandidatePort[]> {
const processMap = processes.reduce((m, process) => {
m[process.pid] = process;
return m;
@@ -144,7 +144,7 @@ export async function findPorts(connections: { socket: number, ip: string, port:
return ports;
}
export function tryFindRootPorts(connections: { socket: number, ip: string, port: number }[], rootProcessesStdout: string, previousPorts: Map<number, CandidatePort & { ppid: number }>): Map<number, CandidatePort & { ppid: number }> {
export function tryFindRootPorts(connections: { socket: number; ip: string; port: number }[], rootProcessesStdout: string, previousPorts: Map<number, CandidatePort & { ppid: number }>): Map<number, CandidatePort & { ppid: number }> {
const ports: Map<number, CandidatePort & { ppid: number }> = new Map();
const rootProcesses = getRootProcesses(rootProcessesStdout);
@@ -159,7 +159,7 @@ export function tryFindRootPorts(connections: { socket: number, ip: string, port
let bestMatch = rootProcessMatch;
// There are often several processes that "look" like they could match the port.
// The one we want is usually the child of the other. Find the most child process.
let mostChild: { pid: number, cmd: string, ppid: number } | undefined;
let mostChild: { pid: number; cmd: string; ppid: number } | undefined;
do {
mostChild = rootProcesses.find(value => value.ppid === bestMatch.pid);
if (mostChild) {
@@ -180,14 +180,14 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe
private readonly _proxy: MainThreadTunnelServiceShape;
private _forwardPortProvider: ((tunnelOptions: TunnelOptions, tunnelCreationOptions: TunnelCreationOptions) => Thenable<vscode.Tunnel> | undefined) | undefined;
private _showCandidatePort: (host: string, port: number, detail: string) => Thenable<boolean> = () => { return Promise.resolve(true); };
private _extensionTunnels: Map<string, Map<number, { tunnel: vscode.Tunnel, disposeListener: IDisposable }>> = new Map();
private _extensionTunnels: Map<string, Map<number, { tunnel: vscode.Tunnel; disposeListener: IDisposable }>> = new Map();
private _onDidChangeTunnels: Emitter<void> = new Emitter<void>();
onDidChangeTunnels: vscode.Event<void> = this._onDidChangeTunnels.event;
private _candidateFindingEnabled: boolean = false;
private _foundRootPorts: Map<number, CandidatePort & { ppid: number }> = new Map();
private _providerHandleCounter: number = 0;
private _portAttributesProviders: Map<number, { provider: vscode.PortAttributesProvider, selector: PortAttributesProviderSelector }> = new Map();
private _portAttributesProviders: Map<number, { provider: vscode.PortAttributesProvider; selector: PortAttributesProviderSelector }> = new Map();
constructor(
@IExtHostRpcService extHostRpc: IExtHostRpcService,
@@ -268,7 +268,7 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe
this._candidateFindingEnabled = enable;
// Regularly scan to see if the candidate ports have changed.
let movingAverage = new MovingAverage();
let oldPorts: { host: string, port: number, detail?: string }[] | undefined = undefined;
let oldPorts: { host: string; port: number; detail?: string }[] | undefined = undefined;
while (this._candidateFindingEnabled) {
const startTime = new Date().getTime();
const newPorts = (await this.findCandidatePorts()).filter(candidate => (isLocalhost(candidate.host) || isAllInterfaces(candidate.host)));
@@ -328,7 +328,7 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe
});
}
async $closeTunnel(remote: { host: string, port: number }, silent?: boolean): Promise<void> {
async $closeTunnel(remote: { host: string; port: number }, silent?: boolean): Promise<void> {
if (this._extensionTunnels.has(remote.host)) {
const hostMap = this._extensionTunnels.get(remote.host)!;
if (hostMap.has(remote.port)) {
@@ -389,7 +389,7 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe
} catch (e) {
// File reading error. No additional handling needed.
}
const connections: { socket: number, ip: string, port: number }[] = loadListeningPorts(tcp, tcp6);
const connections: { socket: number; ip: string; port: number }[] = loadListeningPorts(tcp, tcp6);
const procSockets: string = await (new Promise(resolve => {
exec('ls -l /proc/[0-9]*/fd/[0-9]* | grep socket:', (error, stdout, stderr) => {
@@ -400,7 +400,7 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe
const procChildren = await pfs.Promises.readdir('/proc');
const processes: {
pid: number, cwd: string, cmd: string
pid: number; cwd: string; cmd: string;
}[] = [];
for (let childName of procChildren) {
try {
@@ -417,7 +417,7 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe
}
}
const unFoundConnections: { socket: number, ip: string, port: number }[] = [];
const unFoundConnections: { socket: number; ip: string; port: number }[] = [];
const filteredConnections = connections.filter((connection => {
const foundConnection = socketMap[connection.socket];
if (!foundConnection) {

View File

@@ -49,17 +49,17 @@ export function connectProxyResolver(
getLogLevel: () => extHostLogService.getLevel(),
proxyResolveTelemetry: event => {
type ResolveProxyClassification = {
count: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
duration: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
errorCount: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
cacheCount: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
cacheSize: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
cacheRolls: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
envCount: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
settingsCount: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
localhostCount: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
envNoProxyCount: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
results: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth' };
count: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true };
duration: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true };
errorCount: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true };
cacheCount: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true };
cacheSize: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true };
cacheRolls: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true };
envCount: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true };
settingsCount: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true };
localhostCount: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true };
envNoProxyCount: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true };
results: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth' };
};
mainThreadTelemetry.$publicLog2<ProxyResolveEvent, ResolveProxyClassification>('resolveProxy', event);
},
@@ -107,13 +107,13 @@ function createPatchedModules(configProvider: ExtHostConfigProvider, resolveProx
};
}
const modulesCache = new Map<IExtensionDescription | undefined, { http?: typeof http, https?: typeof https }>();
const modulesCache = new Map<IExtensionDescription | undefined, { http?: typeof http; https?: typeof https }>();
function configureModuleLoading(extensionService: ExtHostExtensionService, lookup: ReturnType<typeof createPatchedModules>): Promise<void> {
return extensionService.getExtensionPathIndex()
.then(extensionPaths => {
const node_module = <any>require.__$__nodeRequire('module');
const original = node_module._load;
node_module._load = function load(request: string, parent: { filename: string; }, isMain: boolean) {
node_module._load = function load(request: string, parent: { filename: string }, isMain: boolean) {
if (request === 'tls') {
return lookup.tls;
}