mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 14:31:31 +01:00
enable @typescript-eslint/member-delimiter-style, https://github.com/microsoft/vscode/issues/140391
This commit is contained in:
@@ -38,12 +38,12 @@ interface CompletionContext {
|
||||
readonly dotAccessorContext?: DotAccessorContext;
|
||||
|
||||
readonly enableCallCompletions: boolean;
|
||||
readonly useCodeSnippetsOnMethodSuggest: boolean,
|
||||
readonly useCodeSnippetsOnMethodSuggest: boolean;
|
||||
|
||||
readonly wordRange: vscode.Range | undefined;
|
||||
readonly line: string;
|
||||
|
||||
readonly useFuzzyWordRangeLogic: boolean,
|
||||
readonly useFuzzyWordRangeLogic: boolean;
|
||||
}
|
||||
|
||||
type ResolvedCompletionItem = {
|
||||
@@ -299,7 +299,7 @@ class MyCompletionItem extends vscode.CompletionItem {
|
||||
private getCodeActions(
|
||||
detail: Proto.CompletionEntryDetails,
|
||||
filepath: string
|
||||
): { command?: vscode.Command, additionalTextEdits?: vscode.TextEdit[] } {
|
||||
): { command?: vscode.Command; additionalTextEdits?: vscode.TextEdit[] } {
|
||||
if (!detail.codeActions || !detail.codeActions.length) {
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ const fixAllErrorCodes = new Map<number, number>([
|
||||
[2345, 2339],
|
||||
]);
|
||||
|
||||
const preferredFixes = new Map<string, { readonly priority: number, readonly thereCanOnlyBeOne?: boolean }>([
|
||||
const preferredFixes = new Map<string, { readonly priority: number; readonly thereCanOnlyBeOne?: boolean }>([
|
||||
[fixNames.annotateWithTypeFromJSDoc, { priority: 2 }],
|
||||
[fixNames.constructorForDerivedNeedSuperCall, { priority: 2 }],
|
||||
[fixNames.extendsInterfaceBecomesImplements, { priority: 2 }],
|
||||
|
||||
@@ -22,7 +22,7 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
|
||||
interface DidApplyRefactoringCommand_Args {
|
||||
readonly codeAction: InlinedCodeAction
|
||||
readonly codeAction: InlinedCodeAction;
|
||||
}
|
||||
|
||||
class DidApplyRefactoringCommand implements Command {
|
||||
|
||||
@@ -132,7 +132,7 @@ export default class LanguageProvider extends Disposable {
|
||||
this.client.bufferSyncSupport.requestAllDiagnostics();
|
||||
}
|
||||
|
||||
public diagnosticsReceived(diagnosticsKind: DiagnosticKind, file: vscode.Uri, diagnostics: (vscode.Diagnostic & { reportUnnecessary: any, reportDeprecated: any })[]): void {
|
||||
public diagnosticsReceived(diagnosticsKind: DiagnosticKind, file: vscode.Uri, diagnostics: (vscode.Diagnostic & { reportUnnecessary: any; reportDeprecated: any })[]): void {
|
||||
if (diagnosticsKind !== DiagnosticKind.Syntax && !this.client.hasCapabilityForResource(file, ClientCapability.Semantic)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -23,14 +23,14 @@ export function createLazyClientHost(
|
||||
context: vscode.ExtensionContext,
|
||||
onCaseInsensitiveFileSystem: boolean,
|
||||
services: {
|
||||
pluginManager: PluginManager,
|
||||
commandManager: CommandManager,
|
||||
logDirectoryProvider: ILogDirectoryProvider,
|
||||
cancellerFactory: OngoingRequestCancellerFactory,
|
||||
versionProvider: ITypeScriptVersionProvider,
|
||||
processFactory: TsServerProcessFactory,
|
||||
activeJsTsEditorTracker: ActiveJsTsEditorTracker,
|
||||
serviceConfigurationProvider: ServiceConfigurationProvider,
|
||||
pluginManager: PluginManager;
|
||||
commandManager: CommandManager;
|
||||
logDirectoryProvider: ILogDirectoryProvider;
|
||||
cancellerFactory: OngoingRequestCancellerFactory;
|
||||
versionProvider: ITypeScriptVersionProvider;
|
||||
processFactory: TsServerProcessFactory;
|
||||
activeJsTsEditorTracker: ActiveJsTsEditorTracker;
|
||||
serviceConfigurationProvider: ServiceConfigurationProvider;
|
||||
},
|
||||
onCompletionAccepted: (item: vscode.CompletionItem) => void,
|
||||
): Lazy<TypeScriptServiceClientHost> {
|
||||
|
||||
@@ -153,7 +153,7 @@ export function onChangedDocument(documentUri: vscode.Uri, disposables: vscode.D
|
||||
|
||||
export async function retryUntilDocumentChanges(
|
||||
documentUri: vscode.Uri,
|
||||
options: { retries: number, timeout: number },
|
||||
options: { retries: number; timeout: number },
|
||||
disposables: vscode.Disposable[],
|
||||
exec: () => Thenable<unknown>,
|
||||
) {
|
||||
|
||||
@@ -118,7 +118,7 @@ function createResponse(command: string): Proto.Response {
|
||||
};
|
||||
}
|
||||
|
||||
function createEventualResponder<T>(): { promise: Promise<T>, resolve: (x: T) => void } {
|
||||
function createEventualResponder<T>(): { promise: Promise<T>; resolve: (x: T) => void } {
|
||||
let resolve: (value: T) => void;
|
||||
const promise = new Promise<T>(r => { resolve = r; });
|
||||
return { promise, resolve: resolve! };
|
||||
|
||||
@@ -41,7 +41,7 @@ export interface ITypeScriptServer {
|
||||
* @return A list of all execute requests. If there are multiple entries, the first item is the primary
|
||||
* request while the rest are secondary ones.
|
||||
*/
|
||||
executeImpl(command: keyof TypeScriptRequests, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean, executionTarget?: ExecutionTarget }): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined>;
|
||||
executeImpl(command: keyof TypeScriptRequests, args: any, executeInfo: { isAsync: boolean; token?: vscode.CancellationToken; expectsResult: boolean; lowPriority?: boolean; executionTarget?: ExecutionTarget }): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined>;
|
||||
|
||||
dispose(): void;
|
||||
}
|
||||
@@ -207,7 +207,7 @@ export class ProcessBasedTsServer extends Disposable implements ITypeScriptServe
|
||||
}
|
||||
}
|
||||
|
||||
public executeImpl(command: keyof TypeScriptRequests, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean, executionTarget?: ExecutionTarget }): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined> {
|
||||
public executeImpl(command: keyof TypeScriptRequests, args: any, executeInfo: { isAsync: boolean; token?: vscode.CancellationToken; expectsResult: boolean; lowPriority?: boolean; executionTarget?: ExecutionTarget }): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined> {
|
||||
const request = this._requestQueue.createRequest(command, args);
|
||||
const requestInfo: RequestItem = {
|
||||
request,
|
||||
@@ -410,7 +410,7 @@ export class GetErrRoutingTsServer extends Disposable implements ITypeScriptServ
|
||||
private readonly router: RequestRouter;
|
||||
|
||||
public constructor(
|
||||
servers: { getErr: ITypeScriptServer, primary: ITypeScriptServer },
|
||||
servers: { getErr: ITypeScriptServer; primary: ITypeScriptServer },
|
||||
delegate: TsServerDelegate,
|
||||
) {
|
||||
super();
|
||||
@@ -463,7 +463,7 @@ export class GetErrRoutingTsServer extends Disposable implements ITypeScriptServ
|
||||
this.mainServer.kill();
|
||||
}
|
||||
|
||||
public executeImpl(command: keyof TypeScriptRequests, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean, executionTarget?: ExecutionTarget }): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined> {
|
||||
public executeImpl(command: keyof TypeScriptRequests, args: any, executeInfo: { isAsync: boolean; token?: vscode.CancellationToken; expectsResult: boolean; lowPriority?: boolean; executionTarget?: ExecutionTarget }): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined> {
|
||||
return this.router.execute(command, args, executeInfo);
|
||||
}
|
||||
}
|
||||
@@ -519,7 +519,7 @@ export class SyntaxRoutingTsServer extends Disposable implements ITypeScriptServ
|
||||
private _projectLoading = true;
|
||||
|
||||
public constructor(
|
||||
servers: { syntax: ITypeScriptServer, semantic: ITypeScriptServer },
|
||||
servers: { syntax: ITypeScriptServer; semantic: ITypeScriptServer },
|
||||
delegate: TsServerDelegate,
|
||||
enableDynamicRouting: boolean,
|
||||
) {
|
||||
@@ -603,7 +603,7 @@ export class SyntaxRoutingTsServer extends Disposable implements ITypeScriptServ
|
||||
this.semanticServer.kill();
|
||||
}
|
||||
|
||||
public executeImpl(command: keyof TypeScriptRequests, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean, executionTarget?: ExecutionTarget }): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined> {
|
||||
public executeImpl(command: keyof TypeScriptRequests, args: any, executeInfo: { isAsync: boolean; token?: vscode.CancellationToken; expectsResult: boolean; lowPriority?: boolean; executionTarget?: ExecutionTarget }): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined> {
|
||||
return this.router.execute(command, args, executeInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ export class TypeScriptServerSpawner {
|
||||
apiVersion: API,
|
||||
pluginManager: PluginManager,
|
||||
cancellationPipeName: string | undefined,
|
||||
): { args: string[], tsServerLogFile: string | undefined, tsServerTraceDirectory: string | undefined } {
|
||||
): { args: string[]; tsServerLogFile: string | undefined; tsServerTraceDirectory: string | undefined } {
|
||||
const args: string[] = [];
|
||||
let tsServerLogFile: string | undefined;
|
||||
let tsServerTraceDirectory: string | undefined;
|
||||
|
||||
@@ -64,14 +64,14 @@ export default class TypeScriptServiceClientHost extends Disposable {
|
||||
context: vscode.ExtensionContext,
|
||||
onCaseInsensitiveFileSystem: boolean,
|
||||
services: {
|
||||
pluginManager: PluginManager,
|
||||
commandManager: CommandManager,
|
||||
logDirectoryProvider: ILogDirectoryProvider,
|
||||
cancellerFactory: OngoingRequestCancellerFactory,
|
||||
versionProvider: ITypeScriptVersionProvider,
|
||||
processFactory: TsServerProcessFactory,
|
||||
activeJsTsEditorTracker: ActiveJsTsEditorTracker,
|
||||
serviceConfigurationProvider: ServiceConfigurationProvider,
|
||||
pluginManager: PluginManager;
|
||||
commandManager: CommandManager;
|
||||
logDirectoryProvider: ILogDirectoryProvider;
|
||||
cancellerFactory: OngoingRequestCancellerFactory;
|
||||
versionProvider: ITypeScriptVersionProvider;
|
||||
processFactory: TsServerProcessFactory;
|
||||
activeJsTsEditorTracker: ActiveJsTsEditorTracker;
|
||||
serviceConfigurationProvider: ServiceConfigurationProvider;
|
||||
},
|
||||
onCompletionAccepted: (item: vscode.CompletionItem) => void,
|
||||
) {
|
||||
@@ -268,11 +268,11 @@ export default class TypeScriptServiceClientHost extends Disposable {
|
||||
private createMarkerDatas(
|
||||
diagnostics: Proto.Diagnostic[],
|
||||
source: string
|
||||
): (vscode.Diagnostic & { reportUnnecessary: any, reportDeprecated: any })[] {
|
||||
): (vscode.Diagnostic & { reportUnnecessary: any; reportDeprecated: any })[] {
|
||||
return diagnostics.map(tsDiag => this.tsDiagnosticToVsDiagnostic(tsDiag, source));
|
||||
}
|
||||
|
||||
private tsDiagnosticToVsDiagnostic(diagnostic: Proto.Diagnostic, source: string): vscode.Diagnostic & { reportUnnecessary: any, reportDeprecated: any } {
|
||||
private tsDiagnosticToVsDiagnostic(diagnostic: Proto.Diagnostic, source: string): vscode.Diagnostic & { reportUnnecessary: any; reportDeprecated: any } {
|
||||
const { start, end, text } = diagnostic;
|
||||
const range = new vscode.Range(typeConverters.Position.fromLocation(start), typeConverters.Position.fromLocation(end));
|
||||
const converted = new vscode.Diagnostic(range, text, this.getDiagnosticSeverity(diagnostic));
|
||||
@@ -299,7 +299,7 @@ export default class TypeScriptServiceClientHost extends Disposable {
|
||||
}
|
||||
converted.tags = tags.length ? tags : undefined;
|
||||
|
||||
const resultConverted = converted as vscode.Diagnostic & { reportUnnecessary: any, reportDeprecated: any };
|
||||
const resultConverted = converted as vscode.Diagnostic & { reportUnnecessary: any; reportDeprecated: any };
|
||||
resultConverted.reportUnnecessary = diagnostic.reportsUnnecessary;
|
||||
resultConverted.reportDeprecated = diagnostic.reportsDeprecated;
|
||||
return resultConverted;
|
||||
|
||||
@@ -150,7 +150,7 @@ export interface ITypeScriptServiceClient {
|
||||
* @return The normalized path or `undefined` if the document is not open on the server.
|
||||
*/
|
||||
toOpenedFilePath(document: vscode.TextDocument, options?: {
|
||||
suppressAlertOnFailure?: boolean
|
||||
suppressAlertOnFailure?: boolean;
|
||||
}): string | undefined;
|
||||
|
||||
/**
|
||||
@@ -160,7 +160,7 @@ export interface ITypeScriptServiceClient {
|
||||
|
||||
getWorkspaceRootForResource(resource: vscode.Uri): string | undefined;
|
||||
|
||||
readonly onTsServerStarted: vscode.Event<{ version: TypeScriptVersion, usedApiVersion: API }>;
|
||||
readonly onTsServerStarted: vscode.Event<{ version: TypeScriptVersion; usedApiVersion: API }>;
|
||||
readonly onProjectLanguageServiceStateChanged: vscode.Event<Proto.ProjectLanguageServiceStateEventBody>;
|
||||
readonly onDidBeginInstallTypings: vscode.Event<Proto.BeginInstallTypesEventBody>;
|
||||
readonly onDidEndInstallTypings: vscode.Event<Proto.EndInstallTypesEventBody>;
|
||||
|
||||
@@ -99,7 +99,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
||||
|
||||
private readonly workspaceState: vscode.Memento;
|
||||
|
||||
private _onReady?: { promise: Promise<void>; resolve: () => void; reject: () => void; };
|
||||
private _onReady?: { promise: Promise<void>; resolve: () => void; reject: () => void };
|
||||
private _configuration: TypeScriptServiceConfiguration;
|
||||
private pluginPathsProvider: TypeScriptPluginPathsProvider;
|
||||
private readonly _versionManager: TypeScriptVersionManager;
|
||||
@@ -130,12 +130,12 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
||||
private readonly context: vscode.ExtensionContext,
|
||||
onCaseInsenitiveFileSystem: boolean,
|
||||
services: {
|
||||
pluginManager: PluginManager,
|
||||
logDirectoryProvider: ILogDirectoryProvider,
|
||||
cancellerFactory: OngoingRequestCancellerFactory,
|
||||
versionProvider: ITypeScriptVersionProvider,
|
||||
processFactory: TsServerProcessFactory,
|
||||
serviceConfigurationProvider: ServiceConfigurationProvider,
|
||||
pluginManager: PluginManager;
|
||||
logDirectoryProvider: ILogDirectoryProvider;
|
||||
cancellerFactory: OngoingRequestCancellerFactory;
|
||||
versionProvider: ITypeScriptVersionProvider;
|
||||
processFactory: TsServerProcessFactory;
|
||||
serviceConfigurationProvider: ServiceConfigurationProvider;
|
||||
},
|
||||
allModeIds: readonly string[]
|
||||
) {
|
||||
@@ -290,7 +290,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
||||
this.serverState = this.startService(true);
|
||||
}
|
||||
|
||||
private readonly _onTsServerStarted = this._register(new vscode.EventEmitter<{ version: TypeScriptVersion, usedApiVersion: API }>());
|
||||
private readonly _onTsServerStarted = this._register(new vscode.EventEmitter<{ version: TypeScriptVersion; usedApiVersion: API }>());
|
||||
public readonly onTsServerStarted = this._onTsServerStarted.event;
|
||||
|
||||
private readonly _onDiagnosticsReceived = this._register(new vscode.EventEmitter<TsDiagnostics>());
|
||||
@@ -830,7 +830,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
||||
})[0]!;
|
||||
}
|
||||
|
||||
private executeImpl(command: keyof TypeScriptRequests, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean, requireSemantic?: boolean }): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined> {
|
||||
private executeImpl(command: keyof TypeScriptRequests, args: any, executeInfo: { isAsync: boolean; token?: vscode.CancellationToken; expectsResult: boolean; lowPriority?: boolean; requireSemantic?: boolean }): Array<Promise<ServerResponse.Response<Proto.Response>> | undefined> {
|
||||
this.bufferSyncSupport.beforeCommand(command);
|
||||
const runningServerState = this.service();
|
||||
return runningServerState.server.executeImpl(command, args, executeInfo);
|
||||
@@ -996,7 +996,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
||||
function getReportIssueArgsForError(
|
||||
error: TypeScriptServerError,
|
||||
logPath: string | undefined,
|
||||
): { extensionId: string, issueTitle: string, issueBody: string } | undefined {
|
||||
): { extensionId: string; issueTitle: string; issueBody: string } | undefined {
|
||||
if (!error.serverStack || !error.serverMessage) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -1063,7 +1063,7 @@ function getDignosticsKind(event: Proto.Event) {
|
||||
|
||||
class ServerInitializingIndicator extends Disposable {
|
||||
|
||||
private _task?: { project: string | undefined, resolve: () => void };
|
||||
private _task?: { project: string | undefined; resolve: () => void };
|
||||
|
||||
public reset(): void {
|
||||
if (this._task) {
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface LanguageDescription {
|
||||
readonly languageIds: readonly string[];
|
||||
readonly configFilePattern?: RegExp;
|
||||
readonly isExternal?: boolean;
|
||||
readonly standardFileExtensions: readonly string[],
|
||||
readonly standardFileExtensions: readonly string[];
|
||||
}
|
||||
|
||||
export const standardLanguageDescriptions: LanguageDescription[] = [
|
||||
|
||||
@@ -12,7 +12,7 @@ export interface TypeScriptServerPlugin {
|
||||
readonly name: string;
|
||||
readonly enableForWorkspaceTypeScriptVersions: boolean;
|
||||
readonly languages: ReadonlyArray<string>;
|
||||
readonly configNamespace?: string
|
||||
readonly configNamespace?: string;
|
||||
}
|
||||
|
||||
namespace TypeScriptServerPlugin {
|
||||
@@ -54,7 +54,7 @@ export class PluginManager extends Disposable {
|
||||
private readonly _onDidUpdatePlugins = this._register(new vscode.EventEmitter<this>());
|
||||
public readonly onDidChangePlugins = this._onDidUpdatePlugins.event;
|
||||
|
||||
private readonly _onDidUpdateConfig = this._register(new vscode.EventEmitter<{ pluginId: string, config: {} }>());
|
||||
private readonly _onDidUpdateConfig = this._register(new vscode.EventEmitter<{ pluginId: string; config: {} }>());
|
||||
public readonly onDidUpdateConfig = this._onDidUpdateConfig.event;
|
||||
|
||||
public setConfiguration(pluginId: string, config: {}) {
|
||||
|
||||
@@ -130,7 +130,7 @@ function convertLinkTags(
|
||||
|
||||
const out: string[] = [];
|
||||
|
||||
let currentLink: { name?: string, target?: Proto.FileSpan, text?: string, readonly linkcode: boolean } | undefined;
|
||||
let currentLink: { name?: string; target?: Proto.FileSpan; text?: string; readonly linkcode: boolean } | undefined;
|
||||
for (const part of parts) {
|
||||
switch (part.kind) {
|
||||
case 'link':
|
||||
|
||||
@@ -21,12 +21,12 @@ export class ResourceMap<T> {
|
||||
return resource.toString(true);
|
||||
};
|
||||
|
||||
private readonly _map = new Map<string, { readonly resource: vscode.Uri, value: T }>();
|
||||
private readonly _map = new Map<string, { readonly resource: vscode.Uri; value: T }>();
|
||||
|
||||
constructor(
|
||||
protected readonly _normalizePath: (resource: vscode.Uri) => string | undefined = ResourceMap.defaultPathNormalizer,
|
||||
protected readonly config: {
|
||||
readonly onCaseInsensitiveFileSystem: boolean,
|
||||
readonly onCaseInsensitiveFileSystem: boolean;
|
||||
},
|
||||
) { }
|
||||
|
||||
@@ -76,7 +76,7 @@ export class ResourceMap<T> {
|
||||
return Array.from(this._map.values(), x => x.value);
|
||||
}
|
||||
|
||||
public get entries(): Iterable<{ resource: vscode.Uri, value: T }> {
|
||||
public get entries(): Iterable<{ resource: vscode.Uri; value: T }> {
|
||||
return this._map.values();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ import type * as Proto from '../protocol';
|
||||
import * as PConst from '../protocol.const';
|
||||
|
||||
export function snippetForFunctionCall(
|
||||
item: { insertText?: string | vscode.SnippetString; label: string; },
|
||||
item: { insertText?: string | vscode.SnippetString; label: string },
|
||||
displayParts: ReadonlyArray<Proto.SymbolDisplayPart>
|
||||
): { snippet: vscode.SnippetString, parameterCount: number } {
|
||||
): { snippet: vscode.SnippetString; parameterCount: number } {
|
||||
if (item.insertText && typeof item.insertText !== 'string') {
|
||||
return { snippet: item.insertText, parameterCount: 0 };
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Trace {
|
||||
}
|
||||
|
||||
interface RequestExecutionMetadata {
|
||||
readonly queuingStartTime: number
|
||||
readonly queuingStartTime: number;
|
||||
}
|
||||
|
||||
export default class Tracer {
|
||||
|
||||
Reference in New Issue
Block a user