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
No known key found for this signature in database
GPG key ID: 96634B5AF12F8798
954 changed files with 3017 additions and 3016 deletions

View file

@ -45,6 +45,7 @@
"jsdoc/no-types": "warn",
"semi": "off",
"@typescript-eslint/semi": "warn",
"@typescript-eslint/member-delimiter-style": "warn",
"@typescript-eslint/naming-convention": [
"warn",
{

View file

@ -29,7 +29,7 @@ interface OSSProduct {
}
interface Product {
readonly builtInExtensions?: IBuiltInExtension[] | { 'include'?: IBuiltInExtension[], 'exclude'?: string[] };
readonly builtInExtensions?: IBuiltInExtension[] | { 'include'?: IBuiltInExtension[]; 'exclude'?: string[] };
readonly webBuiltInExtensions?: IBuiltInExtension[];
}

View file

@ -20,9 +20,9 @@ const commit = util.getVersion(root);
const credential = new ClientSecretCredential(process.env['AZURE_TENANT_ID']!, process.env['AZURE_CLIENT_ID']!, process.env['AZURE_CLIENT_SECRET']!);
interface NlsMetadata {
keys: { [module: string]: string },
messages: { [module: string]: string },
bundles: { [bundle: string]: string[] },
keys: { [module: string]: string };
messages: { [module: string]: string };
bundles: { [bundle: string]: string[] };
}
function main(): Promise<void> {

View file

@ -38,7 +38,7 @@ function main(): Promise<void> {
const vs = src('out-vscode-min'); // client source-maps only
sources.push(vs);
const productionDependencies: { name: string, path: string, version: string }[] = deps.getProductionDependencies(root);
const productionDependencies: { name: string; path: string; version: string }[] = deps.getProductionDependencies(root);
const productionDependenciesSrc = productionDependencies.map(d => path.relative(root, d.path)).map(d => `./${d}/**/*.map`);
const nodeModules = vfs.src(productionDependenciesSrc, { base: '.' })
.pipe(util.cleanNodeModules(path.join(root, 'build', '.moduleignore')));

View file

@ -16,7 +16,7 @@ declare class AsarFilesystem {
readonly header: unknown;
constructor(src: string);
insertDirectory(path: string, shouldUnpack?: boolean): unknown;
insertFile(path: string, shouldUnpack: boolean, file: { stat: { size: number; mode: number; }; }, options: {}): Promise<void>;
insertFile(path: string, shouldUnpack: boolean, file: { stat: { size: number; mode: number } }, options: {}): Promise<void>;
}
export function createAsar(folderPath: string, unpackGlobs: string[], destFilename: string): NodeJS.ReadWriteStream {
@ -38,7 +38,7 @@ export function createAsar(folderPath: string, unpackGlobs: string[], destFilena
let onFileInserted = () => { pendingInserts--; };
// Do not insert twice the same directory
const seenDir: { [key: string]: boolean; } = {};
const seenDir: { [key: string]: boolean } = {};
const insertDirectoryRecursive = (dir: string) => {
if (seenDir[dir]) {
return;
@ -65,7 +65,7 @@ export function createAsar(folderPath: string, unpackGlobs: string[], destFilena
}
};
const insertFile = (relativePath: string, stat: { size: number; mode: number; }, shouldUnpack: boolean) => {
const insertFile = (relativePath: string, stat: { size: number; mode: number }, shouldUnpack: boolean) => {
insertDirectoryForFile(relativePath);
pendingInserts++;
// Do not pass `onFileInserted` directly because it gets overwritten below.

View file

@ -31,7 +31,7 @@ export interface IExtensionDefinition {
flags: string;
};
publisherDisplayName: string;
}
};
}
const root = path.dirname(path.dirname(__dirname));

View file

@ -27,7 +27,7 @@ async function downloadExtensionDetails(extension: IExtensionDefinition): Promis
const promises = [];
for (const fileName of contentFileNames) {
promises.push(new Promise<{ fileName: string, body: Buffer | undefined | null }>(resolve => {
promises.push(new Promise<{ fileName: string; body: Buffer | undefined | null }>(resolve => {
got(`${repositoryContentBaseUrl}/${fileName}`)
.then(response => {
resolve({ fileName, body: response.rawBody });

View file

@ -75,7 +75,7 @@ export interface IConcatFile {
export interface IBundleData {
graph: IGraph;
bundles: { [moduleId: string]: string[]; };
bundles: { [moduleId: string]: string[] };
}
export interface IBundleResult {
@ -91,7 +91,7 @@ interface IPartialBundleResult {
export interface ILoaderConfig {
isBuild?: boolean;
paths?: { [path: string]: any; };
paths?: { [path: string]: any };
}
/**
@ -106,7 +106,7 @@ export function bundle(entryPoints: IEntryPoint[], config: ILoaderConfig, callba
entryPointsMap[module.name] = module;
});
const allMentionedModulesMap: { [modules: string]: boolean; } = {};
const allMentionedModulesMap: { [modules: string]: boolean } = {};
entryPoints.forEach((module: IEntryPoint) => {
allMentionedModulesMap[module.name] = true;
(module.include || []).forEach(function (includedModule) {
@ -283,7 +283,7 @@ function extractStrings(destFiles: IConcatFile[]): IConcatFile[] {
}
// Do one pass to record the usage counts for each module id
const useCounts: { [moduleId: string]: number; } = {};
const useCounts: { [moduleId: string]: number } = {};
destFile.sources.forEach((source) => {
const matches = source.contents.match(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/);
if (!matches) {
@ -302,7 +302,7 @@ function extractStrings(destFiles: IConcatFile[]): IConcatFile[] {
return useCounts[b] - useCounts[a];
});
const replacementMap: { [moduleId: string]: number; } = {};
const replacementMap: { [moduleId: string]: number } = {};
sortedByUseModules.forEach((module, index) => {
replacementMap[module] = index;
});
@ -599,7 +599,7 @@ function visit(rootNodes: string[], graph: IGraph): INodeSet {
function topologicalSort(graph: IGraph): string[] {
const allNodes: INodeSet = {},
outgoingEdgeCount: { [node: string]: number; } = {},
outgoingEdgeCount: { [node: string]: number } = {},
inverseEdges: IGraph = {};
Object.keys(graph).forEach((fromNode: string) => {

View file

@ -132,7 +132,7 @@ class MonacoGenerator {
private readonly _isWatch: boolean;
public readonly stream: NodeJS.ReadWriteStream;
private readonly _watchedFiles: { [filePath: string]: boolean; };
private readonly _watchedFiles: { [filePath: string]: boolean };
private readonly _fsProvider: monacodts.FSProvider;
private readonly _declarationResolver: monacodts.DeclarationResolver;

View file

@ -14,11 +14,11 @@ import * as util from './util';
type DarwinDocumentSuffix = 'document' | 'script' | 'file' | 'source code';
type DarwinDocumentType = {
name: string,
role: string,
ostypes: string[],
extensions: string[],
iconFile: string,
name: string;
role: string;
ostypes: string[];
extensions: string[];
iconFile: string;
};
function isDocumentSuffix(str?: string): str is DarwinDocumentSuffix {

View file

@ -29,7 +29,7 @@ export = new class NoUnexternalizedStrings implements eslint.Rule.RuleModule {
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
const externalizedStringLiterals = new Map<string, { call: TSESTree.CallExpression, message: TSESTree.Node }[]>();
const externalizedStringLiterals = new Map<string, { call: TSESTree.CallExpression; message: TSESTree.Node }[]>();
const doubleQuotedStringLiterals = new Set<TSESTree.Node>();
function collectDoubleQuotedStrings(node: TSESTree.Literal) {

View file

@ -24,7 +24,7 @@ export = new class ApiEventNaming implements eslint.Rule.RuleModule {
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
const config = <{ allowed: string[], verbs: string[] }>context.options[0];
const config = <{ allowed: string[]; verbs: string[] }>context.options[0];
const allowed = new Set(config.allowed);
const verbs = new Set(config.verbs);

View file

@ -409,7 +409,7 @@ export function scanBuiltinExtensions(extensionsRoot: string, exclude: string[]
export function translatePackageJSON(packageJSON: string, packageNLSPath: string) {
interface NLSFormat {
[key: string]: string | { message: string, comment: string[] };
[key: string]: string | { message: string; comment: string[] };
}
const CharCode_PC = '%'.charCodeAt(0);
const packageNls: NLSFormat = JSON.parse(fs.readFileSync(packageNLSPath).toString());
@ -446,7 +446,7 @@ const esbuildMediaScripts = [
'markdown-math/esbuild.js',
];
export async function webpackExtensions(taskName: string, isWatch: boolean, webpackConfigLocations: { configPath: string, outputRoot?: string }[]) {
export async function webpackExtensions(taskName: string, isWatch: boolean, webpackConfigLocations: { configPath: string; outputRoot?: string }[]) {
const webpack = require('webpack') as typeof import('webpack');
const webpackConfigs: webpack.Configuration[] = [];
@ -515,7 +515,7 @@ export async function webpackExtensions(taskName: string, isWatch: boolean, webp
});
}
async function esbuildExtensions(taskName: string, isWatch: boolean, scripts: { script: string, outputRoot?: string }[]) {
async function esbuildExtensions(taskName: string, isWatch: boolean, scripts: { script: string; outputRoot?: string }[]) {
function reporter(stdError: string, script: string) {
const matches = (stdError || '').match(/\> (.+): error: (.+)?/g);
fancyLog(`Finished ${ansiColors.green(taskName)} ${script} with ${matches ? matches.length : 0} errors.`);

View file

@ -277,7 +277,7 @@ export class XLF {
static parsePseudo = function (xlfString: string): Promise<ParsedXLF[]> {
return new Promise((resolve) => {
let parser = new xml2js.Parser();
let files: { messages: Map<string>, originalFilePath: string, language: string }[] = [];
let files: { messages: Map<string>; originalFilePath: string; language: string }[] = [];
parser.parseString(xlfString, function (_err: any, result: any) {
const fileNodes: any[] = result['xliff']['file'];
fileNodes.forEach(file => {
@ -304,7 +304,7 @@ export class XLF {
return new Promise((resolve, reject) => {
let parser = new xml2js.Parser();
let files: { messages: Map<string>, originalFilePath: string, language: string }[] = [];
let files: { messages: Map<string>; originalFilePath: string; language: string }[] = [];
parser.parseString(xlfString, function (err: any, result: any) {
if (err) {

View file

@ -111,7 +111,7 @@ function getTopLevelDeclaration(ts: typeof import('typescript'), sourceFile: ts.
}
function getNodeText(sourceFile: ts.SourceFile, node: { pos: number; end: number; }): string {
function getNodeText(sourceFile: ts.SourceFile, node: { pos: number; end: number }): string {
return sourceFile.getFullText().substring(node.pos, node.end);
}
@ -461,7 +461,7 @@ function generateDeclarationFile(ts: typeof import('typescript'), recipe: string
let replacer = createReplacer(m2[2]);
let typeNames = m2[3].split(/,/);
let typesToExcludeMap: { [typeName: string]: boolean; } = {};
let typesToExcludeMap: { [typeName: string]: boolean } = {};
let typesToExcludeArr: string[] = [];
typeNames.forEach((typeName) => {
typeName = typeName.trim();
@ -599,7 +599,7 @@ class CacheEntry {
export class DeclarationResolver {
public readonly ts: typeof import('typescript');
private _sourceFileCache: { [moduleId: string]: CacheEntry | null; };
private _sourceFileCache: { [moduleId: string]: CacheEntry | null };
constructor(private readonly _fsProvider: FSProvider) {
this.ts = require('typescript') as typeof import('typescript');
@ -667,8 +667,8 @@ export function run3(resolver: DeclarationResolver): IMonacoDeclarationResult |
interface ILibMap { [libName: string]: string; }
interface IFileMap { [fileName: string]: string; }
interface ILibMap { [libName: string]: string }
interface IFileMap { [fileName: string]: string }
class TypeScriptLanguageServiceHost implements ts.LanguageServiceHost {

View file

@ -10,7 +10,7 @@ import * as tss from './treeshaking';
const REPO_ROOT = path.join(__dirname, '../../');
const SRC_DIR = path.join(REPO_ROOT, 'src');
let dirCache: { [dir: string]: boolean; } = {};
let dirCache: { [dir: string]: boolean } = {};
function writeFile(filePath: string, contents: Buffer | string): void {
function ensureDirs(dirPath: string): void {
@ -69,7 +69,7 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str
writeFile(path.join(options.destRoot, fileName), result[fileName]);
}
}
let copied: { [fileName: string]: boolean; } = {};
let copied: { [fileName: string]: boolean } = {};
const copyFile = (fileName: string) => {
if (copied[fileName]) {
return;
@ -131,7 +131,7 @@ export interface IOptions2 {
outFolder: string;
outResourcesFolder: string;
ignores: string[];
renames: { [filename: string]: string; };
renames: { [filename: string]: string };
}
export function createESMSourcesAndResources2(options: IOptions2): void {

View file

@ -59,7 +59,7 @@ export interface ITreeShakingOptions {
*/
importIgnorePattern: RegExp;
redirects: { [module: string]: string; };
redirects: { [module: string]: string };
}
export interface ITreeShakingResult {
@ -140,7 +140,7 @@ function createTypeScriptLanguageService(ts: typeof import('typescript'), option
function discoverAndReadFiles(ts: typeof import('typescript'), options: ITreeShakingOptions): IFileMap {
const FILES: IFileMap = {};
const in_queue: { [module: string]: boolean; } = Object.create(null);
const in_queue: { [module: string]: boolean } = Object.create(null);
const queue: string[] = [];
const enqueue = (moduleId: string) => {
@ -225,8 +225,8 @@ function processLibFiles(ts: typeof import('typescript'), options: ITreeShakingO
return result;
}
interface ILibMap { [libName: string]: string; }
interface IFileMap { [fileName: string]: string; }
interface ILibMap { [libName: string]: string }
interface IFileMap { [fileName: string]: string }
/**
* A TypeScript language service host

View file

@ -68,9 +68,9 @@ function watch(root: string): Stream {
return result;
}
const cache: { [cwd: string]: Stream; } = Object.create(null);
const cache: { [cwd: string]: Stream } = Object.create(null);
module.exports = function (pattern: string | string[] | filter.FileFunction, options?: { cwd?: string; base?: string; }) {
module.exports = function (pattern: string | string[] | filter.FileFunction, options?: { cwd?: string; base?: string }) {
options = options || {};
const cwd = path.normalize(options.cwd || process.cwd());

View file

@ -142,7 +142,7 @@ vscode.languages.registerDocumentSymbolProvider({ pattern: '**/launch.json', lan
}, { label: 'Launch Targets' });
function registerContextKeyCompletions(): vscode.Disposable {
type ContextKeyInfo = { key: string, type?: string, description?: string };
type ContextKeyInfo = { key: string; type?: string; description?: string };
const paths = new Map<vscode.DocumentFilter, JSONPath[]>([
[{ language: 'jsonc', pattern: '**/keybindings.json' }, [

View file

@ -277,7 +277,7 @@ export class SettingsDocument {
return item;
}
private newSnippetCompletionItem(o: { label: string; documentation?: string; snippet: string; range: vscode.Range; }): vscode.CompletionItem {
private newSnippetCompletionItem(o: { label: string; documentation?: string; snippet: string; range: vscode.Range }): vscode.CompletionItem {
const item = new vscode.CompletionItem(o.label);
item.kind = vscode.CompletionItemKind.Value;
item.documentation = o.documentation;

View file

@ -12,7 +12,7 @@ declare const Worker: {
new(stringUrl: string): any;
};
declare const TextDecoder: {
new(encoding?: string): { decode(buffer: ArrayBuffer): string; };
new(encoding?: string): { decode(buffer: ArrayBuffer): string };
};
// this method is called when vs code is activated

View file

@ -18,7 +18,7 @@ const localize = nls.loadMessageBundle();
export type LanguageClientConstructor = (name: string, description: string, clientOptions: LanguageClientOptions) => CommonLanguageClient;
export interface Runtime {
TextDecoder: { new(encoding?: string): { decode(buffer: ArrayBuffer): string; } };
TextDecoder: { new(encoding?: string): { decode(buffer: ArrayBuffer): string } };
fs?: RequestService;
}

View file

@ -8,7 +8,7 @@ import { RequestType, CommonLanguageClient } from 'vscode-languageclient';
import { Runtime } from './cssClient';
export namespace FsContentRequest {
export const type: RequestType<{ uri: string; encoding?: string; }, string, any> = new RequestType('fs/content');
export const type: RequestType<{ uri: string; encoding?: string }, string, any> = new RequestType('fs/content');
}
export namespace FsStatRequest {
export const type: RequestType<string, FileStat, any> = new RequestType('fs/stat');
@ -19,7 +19,7 @@ export namespace FsReadDirRequest {
}
export function serveFileSystemRequests(client: CommonLanguageClient, runtime: Runtime) {
client.onRequest(FsContentRequest.type, (param: { uri: string; encoding?: string; }) => {
client.onRequest(FsContentRequest.type, (param: { uri: string; encoding?: string }) => {
const uri = Uri.parse(param.uri);
if (uri.scheme === 'file' && runtime.fs) {
return runtime.fs.getContent(param.uri);

View file

@ -30,7 +30,7 @@ export interface RuntimeEnvironment {
readonly timer: {
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable;
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable;
}
};
}
export function startServer(connection: Connection, runtime: RuntimeEnvironment) {

View file

@ -12,7 +12,7 @@ export interface LanguageModelCache<T> {
}
export function getLanguageModelCache<T>(maxEntries: number, cleanupIntervalTimeInSec: number, parse: (document: TextDocument) => T): LanguageModelCache<T> {
let languageModels: { [uri: string]: { version: number, languageId: string, cTime: number, languageModel: T } } = {};
let languageModels: { [uri: string]: { version: number; languageId: string; cTime: number; languageModel: T } } = {};
let nModels = 0;
let cleanupInterval: NodeJS.Timer | undefined = undefined;

View file

@ -7,7 +7,7 @@ import { RequestType, Connection } from 'vscode-languageserver';
import { RuntimeEnvironment } from './cssServer';
export namespace FsContentRequest {
export const type: RequestType<{ uri: string; encoding?: string; }, string, any> = new RequestType('fs/content');
export const type: RequestType<{ uri: string; encoding?: string }, string, any> = new RequestType('fs/content');
}
export namespace FsStatRequest {
export const type: RequestType<string, FileStat, any> = new RequestType('fs/stat');

View file

@ -31,7 +31,7 @@ suite('Completions', () => {
}
};
async function assertCompletions(value: string, expected: { count?: number, items?: ItemDescription[] }, testUri: string, workspaceFolders?: WorkspaceFolder[], lang: string = 'css'): Promise<any> {
async function assertCompletions(value: string, expected: { count?: number; items?: ItemDescription[] }, testUri: string, workspaceFolders?: WorkspaceFolder[], lang: string = 'css'): Promise<any> {
const offset = value.indexOf('|');
value = value.substr(0, offset) + value.substr(offset + 1);

View file

@ -14,10 +14,10 @@ import { ISizeCalculationResult } from 'image-size/dist/types/interface';
const reUrl = /^https?:/;
export type ImageInfoWithScale = {
realWidth: number,
realHeight: number,
width: number,
height: number
realWidth: number;
realHeight: number;
width: number;
height: number;
};
/**

View file

@ -9,8 +9,8 @@ import { HtmlNode as HtmlFlatNode } from 'EmmetFlatNode';
import { getRootNode } from './parseDocument';
interface TagRange {
name: string,
range: vscode.Range
name: string;
range: vscode.Range;
}
export async function updateTag(tagName: string | undefined): Promise<boolean | undefined> {

View file

@ -74,7 +74,7 @@ export class PackageDocument {
return item;
}
private newSnippetCompletionItem(o: { label: string; documentation?: string; snippet: string; range: vscode.Range; }): vscode.CompletionItem {
private newSnippetCompletionItem(o: { label: string; documentation?: string; snippet: string; range: vscode.Range }): vscode.CompletionItem {
const item = new vscode.CompletionItem(o.label);
item.kind = vscode.CompletionItemKind.Value;
item.documentation = o.documentation;

View file

@ -81,7 +81,7 @@ class RemoteSourceProviderQuickPick {
export async function pickRemoteSource(model: Model, options: PickRemoteSourceOptions & { branch?: false | undefined }): Promise<string | undefined>;
export async function pickRemoteSource(model: Model, options: PickRemoteSourceOptions & { branch: true }): Promise<PickRemoteSourceResult | undefined>;
export async function pickRemoteSource(model: Model, options: PickRemoteSourceOptions = {}): Promise<string | PickRemoteSourceResult | undefined> {
const quickpick = window.createQuickPick<(QuickPickItem & { provider?: RemoteSourceProvider, url?: string })>();
const quickpick = window.createQuickPick<(QuickPickItem & { provider?: RemoteSourceProvider; url?: string })>();
quickpick.ignoreFocusOut = true;
if (options.providerName) {

View file

@ -68,7 +68,7 @@ export class ApiRepository implements Repository {
return this._repository.apply(patch, reverse);
}
getConfigs(): Promise<{ key: string; value: string; }[]> {
getConfigs(): Promise<{ key: string; value: string }[]> {
return this._repository.getConfigs();
}
@ -84,11 +84,11 @@ export class ApiRepository implements Repository {
return this._repository.getGlobalConfig(key);
}
getObjectDetails(treeish: string, path: string): Promise<{ mode: string; object: string; size: number; }> {
getObjectDetails(treeish: string, path: string): Promise<{ mode: string; object: string; size: number }> {
return this._repository.getObjectDetails(treeish, path);
}
detectObjectType(object: string): Promise<{ mimetype: string, encoding?: string }> {
detectObjectType(object: string): Promise<{ mimetype: string; encoding?: string }> {
return this._repository.detectObjectType(object);
}

View file

@ -30,7 +30,7 @@ export class Askpass implements IIPCHandler {
}
}
async handle({ request, host }: { request: string, host: string }): Promise<string> {
async handle({ request, host }: { request: string; host: string }): Promise<string> {
const config = workspace.getConfiguration('git', null);
const enabled = config.get<boolean>('enabled');
@ -72,7 +72,7 @@ export class Askpass implements IIPCHandler {
return await window.showInputBox(options) || '';
}
getEnv(): { [key: string]: string; } {
getEnv(): { [key: string]: string } {
if (!this.ipc) {
return {
GIT_ASKPASS: path.join(__dirname, 'askpass-empty.sh')

View file

@ -186,7 +186,7 @@ function command(commandId: string, options: ScmCommandOptions = {}): Function {
// 'image/bmp'
// ];
async function categorizeResourceByResolution(resources: Resource[]): Promise<{ merge: Resource[], resolved: Resource[], unresolved: Resource[], deletionConflicts: Resource[] }> {
async function categorizeResourceByResolution(resources: Resource[]): Promise<{ merge: Resource[]; resolved: Resource[]; unresolved: Resource[]; deletionConflicts: Resource[] }> {
const selection = resources.filter(s => s instanceof Resource) as Resource[];
const merge = selection.filter(s => s.resourceGroupType === ResourceGroupType.Merge);
const isBothAddedOrModified = (s: Resource) => s.type === Status.BOTH_MODIFIED || s.type === Status.BOTH_ADDED;
@ -282,7 +282,7 @@ interface PushOptions {
remote?: string;
refspec?: string;
setUpstream?: boolean;
}
};
}
class CommandErrorOutputTextDocumentContentProvider implements TextDocumentContentProvider {
@ -544,7 +544,7 @@ export class CommandCenter {
} else {
const placeHolder = localize('init', "Pick workspace folder to initialize git repo in");
const pick = { label: localize('choose', "Choose Folder...") };
const items: { label: string, folder?: WorkspaceFolder }[] = [
const items: { label: string; folder?: WorkspaceFolder }[] = [
...workspace.workspaceFolders.map(folder => ({ label: folder.name, description: folder.uri.fsPath, folder })),
pick
];
@ -1683,7 +1683,7 @@ export class CommandCenter {
return this._checkout(repository, { detached: true, treeish });
}
private async _checkout(repository: Repository, opts?: { detached?: boolean, treeish?: string }): Promise<boolean> {
private async _checkout(repository: Repository, opts?: { detached?: boolean; treeish?: string }): Promise<boolean> {
if (typeof opts?.treeish === 'string') {
await repository.checkout(opts?.treeish, opts);
return true;
@ -2698,7 +2698,7 @@ export class CommandCenter {
env.clipboard.writeText(item.message);
}
private _selectedForCompare: { uri: Uri, item: GitTimelineItem } | undefined;
private _selectedForCompare: { uri: Uri; item: GitTimelineItem } | undefined;
@command('git.timeline.selectForCompare', { repository: false })
async timelineSelectForCompare(item: TimelineItem, uri: Uri | undefined, _source: string) {
@ -2959,7 +2959,7 @@ export class CommandCenter {
}
return result;
}, [] as { repository: Repository, resources: Uri[] }[]);
}, [] as { repository: Repository; resources: Uri[] }[]);
const promises = groups
.map(({ repository, resources }) => fn(repository as Repository, isSingleResource ? resources[0] : resources));

View file

@ -16,7 +16,7 @@ class GitIgnoreDecorationProvider implements FileDecorationProvider {
private static Decoration: FileDecoration = { color: new ThemeColor('gitDecoration.ignoredResourceForeground') };
readonly onDidChangeFileDecorations: Event<Uri[]>;
private queue = new Map<string, { repository: Repository; queue: Map<string, PromiseSource<FileDecoration | undefined>>; }>();
private queue = new Map<string, { repository: Repository; queue: Map<string, PromiseSource<FileDecoration | undefined>> }>();
private disposables: Disposable[] = [];
constructor(private model: Model) {

View file

@ -858,7 +858,7 @@ export class Repository {
return result.stdout.trim();
}
async getConfigs(scope: string): Promise<{ key: string; value: string; }[]> {
async getConfigs(scope: string): Promise<{ key: string; value: string }[]> {
const args = ['config'];
if (scope) {
@ -960,7 +960,7 @@ export class Repository {
return stdout;
}
async getObjectDetails(treeish: string, path: string): Promise<{ mode: string, object: string, size: number }> {
async getObjectDetails(treeish: string, path: string): Promise<{ mode: string; object: string; size: number }> {
if (!treeish) { // index
const elements = await this.lsfiles(path);
@ -998,7 +998,7 @@ export class Repository {
async getGitRelativePath(ref: string, relativePath: string): Promise<string> {
const relativePathLowercase = relativePath.toLowerCase();
const dirname = path.posix.dirname(relativePath) + '/';
const elements: { file: string; }[] = ref ? await this.lstree(ref, dirname) : await this.lsfiles(dirname);
const elements: { file: string }[] = ref ? await this.lstree(ref, dirname) : await this.lsfiles(dirname);
const element = elements.filter(file => file.file.toLowerCase() === relativePathLowercase)[0];
if (!element) {
@ -1008,7 +1008,7 @@ export class Repository {
return element.file;
}
async detectObjectType(object: string): Promise<{ mimetype: string, encoding?: string }> {
async detectObjectType(object: string): Promise<{ mimetype: string; encoding?: string }> {
const child = await this.stream(['show', '--textconv', object]);
const buffer = await readBytes(child.stdout!, 4100);
@ -1308,7 +1308,7 @@ export class Repository {
await this.exec(['update-index', add, '--cacheinfo', mode, hash, path]);
}
async checkout(treeish: string, paths: string[], opts: { track?: boolean, detached?: boolean } = Object.create(null)): Promise<void> {
async checkout(treeish: string, paths: string[], opts: { track?: boolean; detached?: boolean } = Object.create(null)): Promise<void> {
const args = ['checkout', '-q'];
if (opts.track) {
@ -1570,7 +1570,7 @@ export class Repository {
await this.exec(args);
}
async fetch(options: { remote?: string, ref?: string, all?: boolean, prune?: boolean, depth?: number, silent?: boolean, readonly cancellationToken?: CancellationToken } = {}): Promise<void> {
async fetch(options: { remote?: string; ref?: string; all?: boolean; prune?: boolean; depth?: number; silent?: boolean; readonly cancellationToken?: CancellationToken } = {}): Promise<void> {
const args = ['fetch'];
const spawnOptions: SpawnOptions = {
cancellationToken: options.cancellationToken,
@ -1813,8 +1813,8 @@ export class Repository {
}
}
getStatus(opts?: { limit?: number, ignoreSubmodules?: boolean }): Promise<{ status: IFileStatus[]; statusLength: number; didHitLimit: boolean; }> {
return new Promise<{ status: IFileStatus[]; statusLength: number; didHitLimit: boolean; }>((c, e) => {
getStatus(opts?: { limit?: number; ignoreSubmodules?: boolean }): Promise<{ status: IFileStatus[]; statusLength: number; didHitLimit: boolean }> {
return new Promise<{ status: IFileStatus[]; statusLength: number; didHitLimit: boolean }>((c, e) => {
const parser = new GitStatusParser();
const env = { GIT_OPTIONAL_LOCKS: '0' };
const args = ['status', '-z', '-u'];
@ -1894,7 +1894,7 @@ export class Repository {
.map(([ref]) => ({ name: ref, type: RefType.Head } as Branch));
}
async getRefs(opts?: { sort?: 'alphabetically' | 'committerdate', contains?: string, pattern?: string, count?: number }): Promise<Ref[]> {
async getRefs(opts?: { sort?: 'alphabetically' | 'committerdate'; contains?: string; pattern?: string; count?: number }): Promise<Ref[]> {
const args = ['for-each-ref'];
if (opts?.count) {

View file

@ -61,7 +61,7 @@ export async function createIPCServer(context?: string): Promise<IIPCServer> {
export interface IIPCServer extends Disposable {
readonly ipcHandlePath: string | undefined;
getEnv(): { [key: string]: string; };
getEnv(): { [key: string]: string };
registerHandler(name: string, handler: IIPCHandler): Disposable;
}
@ -106,7 +106,7 @@ class IPCServer implements IIPCServer, Disposable {
});
}
getEnv(): { [key: string]: string; } {
getEnv(): { [key: string]: string } {
return { VSCODE_GIT_IPC_HANDLE: this.ipcHandlePath };
}

View file

@ -25,7 +25,7 @@ import { GitTimelineProvider } from './timelineProvider';
import { registerAPICommands } from './api/api1';
import { TerminalEnvironmentManager } from './terminal';
const deactivateTasks: { (): Promise<any>; }[] = [];
const deactivateTasks: { (): Promise<any> }[] = [];
export async function deactivate(): Promise<any> {
for (const task of deactivateTasks) {
@ -165,7 +165,7 @@ export async function _activate(context: ExtensionContext): Promise<GitExtension
commands.registerCommand('git.showOutput', () => outputChannel.show());
disposables.push(outputChannel);
const { name, version, aiKey } = require('../package.json') as { name: string, version: string, aiKey: string };
const { name, version, aiKey } = require('../package.json') as { name: string; version: string; aiKey: string };
const telemetryReporter = new TelemetryReporter(name, version, aiKey);
deactivateTasks.push(() => telemetryReporter.dispose());

View file

@ -1071,7 +1071,7 @@ export class Repository implements Disposable {
return await this.repository.getCommitTemplate();
}
getConfigs(): Promise<{ key: string; value: string; }[]> {
getConfigs(): Promise<{ key: string; value: string }[]> {
return this.run(Operation.Config, () => this.repository.getConfigs('local'));
}
@ -1152,7 +1152,7 @@ export class Repository implements Disposable {
return this.run(Operation.HashObject, () => this.repository.hashObject(data));
}
async add(resources: Uri[], opts?: { update?: boolean; }): Promise<void> {
async add(resources: Uri[], opts?: { update?: boolean }): Promise<void> {
await this.run(Operation.Add, () => this.repository.add(resources.map(r => r.fsPath), opts));
}
@ -1289,11 +1289,11 @@ export class Repository implements Disposable {
await this.run(Operation.DeleteTag, () => this.repository.deleteTag(name));
}
async checkout(treeish: string, opts?: { detached?: boolean; }): Promise<void> {
async checkout(treeish: string, opts?: { detached?: boolean }): Promise<void> {
await this.run(Operation.Checkout, () => this.repository.checkout(treeish, [], opts));
}
async checkoutTracking(treeish: string, opts: { detached?: boolean; } = {}): Promise<void> {
async checkoutTracking(treeish: string, opts: { detached?: boolean } = {}): Promise<void> {
await this.run(Operation.CheckoutTracking, () => this.repository.checkout(treeish, [], { ...opts, track: true }));
}
@ -1326,7 +1326,7 @@ export class Repository implements Disposable {
}
@throttle
async fetchDefault(options: { silent?: boolean; } = {}): Promise<void> {
async fetchDefault(options: { silent?: boolean } = {}): Promise<void> {
await this._fetch({ silent: options.silent });
}
@ -1344,7 +1344,7 @@ export class Repository implements Disposable {
await this._fetch(options);
}
private async _fetch(options: { remote?: string, ref?: string, all?: boolean, prune?: boolean, depth?: number, silent?: boolean; } = {}): Promise<void> {
private async _fetch(options: { remote?: string; ref?: string; all?: boolean; prune?: boolean; depth?: number; silent?: boolean } = {}): Promise<void> {
if (!options.prune) {
const config = workspace.getConfiguration('git', Uri.file(this.root));
const prune = config.get<boolean>('pruneOnFetch');
@ -1570,11 +1570,11 @@ export class Repository implements Disposable {
});
}
getObjectDetails(ref: string, filePath: string): Promise<{ mode: string, object: string, size: number; }> {
getObjectDetails(ref: string, filePath: string): Promise<{ mode: string; object: string; size: number }> {
return this.run(Operation.GetObjectDetails, () => this.repository.getObjectDetails(ref, filePath));
}
detectObjectType(object: string): Promise<{ mimetype: string, encoding?: string; }> {
detectObjectType(object: string): Promise<{ mimetype: string; encoding?: string }> {
return this.run(Operation.Show, () => this.repository.detectObjectType(object));
}

View file

@ -175,7 +175,7 @@ export async function mkdirp(path: string, mode?: number): Promise<boolean> {
}
export function uniqueFilter<T>(keyFn: (t: T) => string): (t: T) => boolean {
const seen: { [key: string]: boolean; } = Object.create(null);
const seen: { [key: string]: boolean } = Object.create(null);
return element => {
const key = keyFn(element);
@ -395,7 +395,7 @@ export class Limiter<T> {
}
}
type Completion<T> = { success: true, value: T } | { success: false, err: any };
type Completion<T> = { success: true; value: T } | { success: false; err: any };
export class PromiseSource<T> {

View file

@ -49,7 +49,7 @@ const passthrough = (value: any, resolve: (value?: any) => void) => resolve(valu
*/
export function promiseFromEvent<T, U>(
event: Event<T>,
adapter: PromiseAdapter<T, U> = passthrough): { promise: Promise<U>, cancel: EventEmitter<void> } {
adapter: PromiseAdapter<T, U> = passthrough): { promise: Promise<U>; cancel: EventEmitter<void> } {
let subscription: Disposable;
let cancel = new EventEmitter<void>();
return {

View file

@ -18,7 +18,7 @@ interface SessionData {
label?: string;
displayName?: string;
id: string;
}
};
scopes: string[];
accessToken: string;
}
@ -39,7 +39,7 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
private _disposable: vscode.Disposable;
constructor(private readonly context: vscode.ExtensionContext, private readonly type: AuthProviderType) {
const { name, version, aiKey } = context.extension.packageJSON as { name: string, version: string, aiKey: string };
const { name, version, aiKey } = context.extension.packageJSON as { name: string; version: string; aiKey: string };
this._telemetryReporter = new ExperimentationTelemetry(context, new TelemetryReporter(name, version, aiKey));
if (this.type === AuthProviderType.github) {
@ -149,7 +149,7 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
if (scopesSeen.has(scopesStr)) {
return undefined;
}
let userInfo: { id: string, accountName: string } | undefined;
let userInfo: { id: string; accountName: string } | undefined;
if (!session.account) {
try {
userInfo = await this._githubServer.getUserInfo(session.accessToken);

View file

@ -41,7 +41,7 @@ function parseQuery(uri: vscode.Uri) {
export interface IGitHubServer extends vscode.Disposable {
login(scopes: string): Promise<string>;
getUserInfo(token: string): Promise<{ id: string, accountName: string }>;
getUserInfo(token: string): Promise<{ id: string; accountName: string }>;
sendAdditionalTelemetryInfo(token: string): Promise<void>;
friendlyName: string;
type: AuthProviderType;
@ -77,7 +77,7 @@ async function getScopes(token: string, serverUri: vscode.Uri, logger: Log): Pro
}
}
async function getUserInfo(token: string, serverUri: vscode.Uri, logger: Log): Promise<{ id: string, accountName: string }> {
async function getUserInfo(token: string, serverUri: vscode.Uri, logger: Log): Promise<{ id: string; accountName: string }> {
let result: Response;
try {
logger.info('Getting user info...');
@ -119,7 +119,7 @@ export class GitHubServer implements IGitHubServer {
private _onDidManuallyProvideToken = new vscode.EventEmitter<string | undefined>();
private _pendingStates = new Map<string, string[]>();
private _codeExchangePromises = new Map<string, { promise: Promise<string>, cancel: vscode.EventEmitter<void> }>();
private _codeExchangePromises = new Map<string, { promise: Promise<string>; cancel: vscode.EventEmitter<void> }>();
private _statusBarCommandId = `${this.type}.provide-manually`;
private _disposable: vscode.Disposable;
private _uriHandler = new UriEventHandler(this._logger);
@ -382,7 +382,7 @@ export class GitHubServer implements IGitHubServer {
this._uriHandler.handleUri(vscode.Uri.parse(uri.trim()));
}
public getUserInfo(token: string): Promise<{ id: string, accountName: string }> {
public getUserInfo(token: string): Promise<{ id: string; accountName: string }> {
return getUserInfo(token, this.getServerUri('/user'), this._logger);
}
@ -406,7 +406,7 @@ export class GitHubServer implements IGitHubServer {
});
if (result.ok) {
const json: { student: boolean, faculty: boolean } = await result.json();
const json: { student: boolean; faculty: boolean } = await result.json();
/* __GDPR__
"session" : {
@ -440,7 +440,7 @@ export class GitHubServer implements IGitHubServer {
return;
}
const json: { verifiable_password_authentication: boolean, installed_version: string } = await result.json();
const json: { verifiable_password_authentication: boolean; installed_version: string } = await result.json();
/* __GDPR__
"ghe-session" : {
@ -504,7 +504,7 @@ export class GitHubEnterpriseServer implements IGitHubServer {
return vscode.Uri.parse(`${apiUri.scheme}://${apiUri.authority}/api/v3${path}`);
}
public async getUserInfo(token: string): Promise<{ id: string, accountName: string }> {
public async getUserInfo(token: string): Promise<{ id: string; accountName: string }> {
return getUserInfo(token, this.getServerUri('/user'), this._logger);
}
@ -522,7 +522,7 @@ export class GitHubEnterpriseServer implements IGitHubServer {
return;
}
const json: { verifiable_password_authentication: boolean, installed_version: string } = await result.json();
const json: { verifiable_password_authentication: boolean; installed_version: string } = await result.json();
/* __GDPR__
"ghe-session" : {

View file

@ -50,7 +50,7 @@ export async function publishRepository(gitAPI: GitAPI, repository?: Repository)
folder = pick.folder.uri;
}
let quickpick = vscode.window.createQuickPick<vscode.QuickPickItem & { repo?: string, auth?: 'https' | 'ssh', isPrivate?: boolean }>();
let quickpick = vscode.window.createQuickPick<vscode.QuickPickItem & { repo?: string; auth?: 'https' | 'ssh'; isPrivate?: boolean }>();
quickpick.ignoreFocusOut = true;
quickpick.placeholder = 'Repository Name';

View file

@ -41,7 +41,7 @@ async function handlePushError(repository: Repository, remote: Remote, refspec:
try {
if (isInCodespaces()) {
// Call into the codespaces extension to fork the repository
const resp = await commands.executeCommand<{ repository: CreateForkResponseData, ref: string }>('github.codespaces.forkRepository');
const resp = await commands.executeCommand<{ repository: CreateForkResponseData; ref: string }>('github.codespaces.forkRepository');
if (!resp) {
throw new Error('Unable to fork respository');
}

View file

@ -7,7 +7,7 @@ import { RemoteSourceProvider, RemoteSource } from './typings/git-base';
import { getOctokit } from './auth';
import { Octokit } from '@octokit/rest';
function parse(url: string): { owner: string, repo: string } | undefined {
function parse(url: string): { owner: string; repo: string } | undefined {
const match = /^https:\/\/github\.com\/([^/]+)\/([^/]+)\.git/i.exec(url)
|| /^git@github\.com:([^/]+)\/([^/]+)\.git/i.exec(url);
return (match && { owner: match[1], repo: match[2] }) ?? undefined;

View file

@ -12,7 +12,7 @@ declare const Worker: {
new(stringUrl: string): any;
};
declare const TextDecoder: {
new(encoding?: string): { decode(buffer: ArrayBuffer): string; };
new(encoding?: string): { decode(buffer: ArrayBuffer): string };
};
// this method is called when vs code is activated

View file

@ -75,12 +75,12 @@ export interface TelemetryReporter {
export type LanguageClientConstructor = (name: string, description: string, clientOptions: LanguageClientOptions) => CommonLanguageClient;
export interface Runtime {
TextDecoder: { new(encoding?: string): { decode(buffer: ArrayBuffer): string; } };
TextDecoder: { new(encoding?: string): { decode(buffer: ArrayBuffer): string } };
fileFs?: FileSystemProvider;
telemetry?: TelemetryReporter;
readonly timer: {
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable;
}
};
}
export function startClient(context: ExtensionContext, newLanguageClient: LanguageClientConstructor, runtime: Runtime) {

View file

@ -71,7 +71,7 @@ export interface RuntimeEnvironment {
readonly timer: {
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable;
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable;
}
};
}

View file

@ -12,7 +12,7 @@ export interface LanguageModelCache<T> {
}
export function getLanguageModelCache<T>(maxEntries: number, cleanupIntervalTimeInSec: number, parse: (document: TextDocument) => T): LanguageModelCache<T> {
let languageModels: { [uri: string]: { version: number, languageId: string, cTime: number, languageModel: T } } = {};
let languageModels: { [uri: string]: { version: number; languageId: string; cTime: number; languageModel: T } } = {};
let nModels = 0;
let cleanupInterval: NodeJS.Timer | undefined = undefined;

View file

@ -20,7 +20,7 @@ export interface HTMLDocumentRegions {
export const CSS_STYLE_RULE = '__';
interface EmbeddedRegion { languageId: string | undefined; start: number; end: number; attributeValue?: boolean; }
interface EmbeddedRegion { languageId: string | undefined; start: number; end: number; attributeValue?: boolean }
export function getDocumentRegions(languageService: LanguageService, document: TextDocument): HTMLDocumentRegions {

View file

@ -362,7 +362,7 @@ export function getJavaScriptMode(documentRegions: LanguageModelCache<HTMLDocume
const jsLanguageService = await host.getLanguageService(jsDocument);
return getSemanticTokens(jsLanguageService, jsDocument, jsDocument.uri);
},
getSemanticTokenLegend(): { types: string[], modifiers: string[] } {
getSemanticTokenLegend(): { types: string[]; modifiers: string[] } {
return getSemanticTokenLegend();
},
dispose() {
@ -375,7 +375,7 @@ export function getJavaScriptMode(documentRegions: LanguageModelCache<HTMLDocume
function convertRange(document: TextDocument, span: { start: number | undefined, length: number | undefined }): Range {
function convertRange(document: TextDocument, span: { start: number | undefined; length: number | undefined }): Range {
if (typeof span.start === 'undefined') {
const pos = document.positionAt(0);
return Range.create(pos, pos);

View file

@ -77,7 +77,7 @@ export interface LanguageMode {
getFoldingRanges?: (document: TextDocument) => Promise<FoldingRange[]>;
onDocumentRemoved(document: TextDocument): void;
getSemanticTokens?(document: TextDocument): Promise<SemanticTokenData[]>;
getSemanticTokenLegend?(): { types: string[], modifiers: string[] };
getSemanticTokenLegend?(): { types: string[]; modifiers: string[] };
dispose(): void;
}
@ -97,7 +97,7 @@ export interface LanguageModeRange extends Range {
attributeValue?: boolean;
}
export function getLanguageModes(supportedLanguages: { [languageId: string]: boolean; }, workspace: Workspace, clientCapabilities: ClientCapabilities, requestService: FileSystemProvider): LanguageModes {
export function getLanguageModes(supportedLanguages: { [languageId: string]: boolean }, workspace: Workspace, clientCapabilities: ClientCapabilities, requestService: FileSystemProvider): LanguageModes {
const htmlLanguageService = getHTMLLanguageService({ clientCapabilities, fileSystemProvider: requestService });
const cssLanguageService = getCSSLanguageService({ clientCapabilities, fileSystemProvider: requestService });

View file

@ -20,7 +20,7 @@ export interface SemanticTokenProvider {
export function newSemanticTokenProvider(languageModes: LanguageModes): SemanticTokenProvider {
// combined legend across modes
const legend: { types: string[], modifiers: string[] } = { types: [], modifiers: [] };
const legend: { types: string[]; modifiers: string[] } = { types: [], modifiers: [] };
const legendMappings: { [modeId: string]: LegendMapping } = {};
for (let mode of languageModes.getAllModes()) {

View file

@ -14,7 +14,7 @@ export interface ItemDescription {
documentation?: string;
kind?: CompletionItemKind;
resultText?: string;
command?: { title: string, command: string };
command?: { title: string; command: string };
notAvailable?: boolean;
}
@ -46,7 +46,7 @@ export function assertCompletion(completions: CompletionList, expected: ItemDesc
const testUri = 'test://test/test.html';
export async function testCompletionFor(value: string, expected: { count?: number, items?: ItemDescription[] }, uri = testUri, workspaceFolders?: WorkspaceFolder[]): Promise<void> {
export async function testCompletionFor(value: string, expected: { count?: number; items?: ItemDescription[] }, uri = testUri, workspaceFolders?: WorkspaceFolder[]): Promise<void> {
let offset = value.indexOf('|');
value = value.substr(0, offset) + value.substr(offset + 1);

View file

@ -10,7 +10,7 @@ import * as path from 'path';
suite('HTML Language Configuration', () => {
const config = JSON.parse((fs.readFileSync(path.join(__dirname, '../../../../html/language-configuration.json')).toString()));
function createRegex(str: string | { pattern: string, flags: string }): RegExp {
function createRegex(str: string | { pattern: string; flags: string }): RegExp {
if (typeof str === 'string') {
return new RegExp(str, 'g');
}

View file

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export function getWordAtText(text: string, offset: number, wordDefinition: RegExp): { start: number, length: number } {
export function getWordAtText(text: string, offset: number, wordDefinition: RegExp): { start: number; length: number } {
let lineStart = offset;
while (lineStart > 0 && !isNewlineCharacter(text.charCodeAt(lineStart - 1))) {
lineStart--;

View file

@ -59,7 +59,7 @@ namespace ResultLimitReachedNotification {
interface Settings {
json?: {
schemas?: JSONSchemaSettings[];
format?: { enable: boolean; };
format?: { enable: boolean };
resultLimit?: number;
};
http?: {
@ -96,7 +96,7 @@ export type LanguageClientConstructor = (name: string, description: string, clie
export interface Runtime {
schemaRequests: SchemaRequestService;
telemetry?: TelemetryReporter
telemetry?: TelemetryReporter;
}
export interface SchemaRequestService {

View file

@ -56,12 +56,12 @@ export interface RequestService {
export interface RuntimeEnvironment {
file?: RequestService;
http?: RequestService
http?: RequestService;
configureHttpRequests?(proxy: string, strictSSL: boolean): void;
readonly timer: {
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable;
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable;
}
};
}
export function startServer(connection: Connection, runtime: RuntimeEnvironment) {
@ -168,7 +168,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
interface Settings {
json: {
schemas: JSONSchemaSettings[];
format: { enable: boolean; };
format: { enable: boolean };
resultLimit?: number;
};
http: {
@ -185,7 +185,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
const limitExceededWarnings = function () {
const pendingWarnings: { [uri: string]: { features: { [name: string]: string }; timeout?: Disposable; } } = {};
const pendingWarnings: { [uri: string]: { features: { [name: string]: string }; timeout?: Disposable } } = {};
const showLimitedNotification = (uri: string, resultLimit: number) => {
const warning = pendingWarnings[uri];
@ -358,7 +358,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
connection.sendDiagnostics({ uri: event.document.uri, diagnostics: [] });
});
const pendingValidationRequests: { [uri: string]: Disposable; } = {};
const pendingValidationRequests: { [uri: string]: Disposable } = {};
const validationDelayMs = 300;
function cleanPendingValidation(textDocument: TextDocument): void {

View file

@ -12,7 +12,7 @@ export interface LanguageModelCache<T> {
}
export function getLanguageModelCache<T>(maxEntries: number, cleanupIntervalTimeInSec: number, parse: (document: TextDocument) => T): LanguageModelCache<T> {
let languageModels: { [uri: string]: { version: number, languageId: string, cTime: number, languageModel: T } } = {};
let languageModels: { [uri: string]: { version: number; languageId: string; cTime: number; languageModel: T } } = {};
let nModels = 0;
let cleanupInterval: NodeJS.Timer | undefined = undefined;

View file

@ -53,7 +53,7 @@ const getCodeLineElements = (() => {
* If an exact match, returns a single element. If the line is between elements,
* returns the element prior to and the element after the given line.
*/
export function getElementsForSourceLine(targetLine: number, documentVersion: number): { previous: CodeLineElement; next?: CodeLineElement; } {
export function getElementsForSourceLine(targetLine: number, documentVersion: number): { previous: CodeLineElement; next?: CodeLineElement } {
const lineNumber = Math.floor(targetLine);
const lines = getCodeLineElements(documentVersion);
let previous = lines[0] || null;
@ -71,7 +71,7 @@ export function getElementsForSourceLine(targetLine: number, documentVersion: nu
/**
* Find the html elements that are at a specific pixel offset on the page.
*/
export function getLineElementsAtPageOffset(offset: number, documentVersion: number): { previous: CodeLineElement; next?: CodeLineElement; } {
export function getLineElementsAtPageOffset(offset: number, documentVersion: number): { previous: CodeLineElement; next?: CodeLineElement } {
const lines = getCodeLineElements(documentVersion);
const position = offset - window.scrollY;
let lo = -1;
@ -98,7 +98,7 @@ export function getLineElementsAtPageOffset(offset: number, documentVersion: num
return { previous: hiElement };
}
function getElementBounds({ element }: CodeLineElement): { top: number, height: number } {
function getElementBounds({ element }: CodeLineElement): { top: number; height: number } {
const myBounds = element.getBoundingClientRect();
// Some code line elements may contain other code line elements.

View file

@ -6,7 +6,7 @@
export interface PreviewSettings {
readonly source: string;
readonly line?: number;
readonly fragment?: string
readonly fragment?: string;
readonly lineCount: number;
readonly scrollPreviewWithEditor?: boolean;
readonly scrollEditorWithPreview: boolean;

View file

@ -15,7 +15,7 @@ const localize = nls.loadMessageBundle();
function parseLink(
document: vscode.TextDocument,
link: string,
): { uri: vscode.Uri, tooltip?: string } | undefined {
): { uri: vscode.Uri; tooltip?: string } | undefined {
const cleanLink = stripAngleBrackets(link);
const externalSchemeUri = getUriForLinkWithKnownExternalScheme(cleanLink);
@ -225,7 +225,7 @@ export default class LinkProvider implements vscode.DocumentLinkProvider {
}
public static getDefinitions(text: string, document: vscode.TextDocument) {
const out = new Map<string, { link: string, linkRange: vscode.Range }>();
const out = new Map<string, { link: string; linkRange: vscode.Range }>();
for (const match of text.matchAll(definitionPattern)) {
const pre = match[1];
const reference = match[2];

View file

@ -38,7 +38,7 @@ export default class MarkdownFoldingProvider implements vscode.FoldingRangeProvi
const regionMarkers = tokens.filter(isRegionMarker)
.map(token => ({ line: token.map[0], isStart: isStartRegion(token.content) }));
const nestingStack: { line: number, isStart: boolean }[] = [];
const nestingStack: { line: number; isStart: boolean }[] = [];
return regionMarkers
.map(marker => {
if (marker.isStart) {

View file

@ -60,7 +60,7 @@ interface CompletionContext {
/**
* Info if the link looks like it is for an anchor: `[](#header)`
*/
readonly anchorInfo?: AnchorContext
readonly anchorInfo?: AnchorContext;
}
export class PathCompletionProvider implements vscode.CompletionItemProvider {

View file

@ -26,7 +26,7 @@ interface WebviewMessage {
interface CacheImageSizesMessage extends WebviewMessage {
readonly type: 'cacheImageSizes';
readonly body: { id: string, width: number, height: number; }[];
readonly body: { id: string; width: number; height: number }[];
}
interface RevealLineMessage extends WebviewMessage {
@ -79,7 +79,7 @@ export class PreviewDocumentVersion {
interface MarkdownPreviewDelegate {
getTitle?(resource: vscode.Uri): string;
getAdditionalState(): {},
getAdditionalState(): {};
openPreviewLinkToMarkdownFile(markdownLink: vscode.Uri, fragment: string): void;
}
@ -117,7 +117,7 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
private currentVersion?: PreviewDocumentVersion;
private isScrolling = false;
private _disposed: boolean = false;
private imageInfo: { readonly id: string, readonly width: number, readonly height: number; }[] = [];
private imageInfo: { readonly id: string; readonly width: number; readonly height: number }[] = [];
private readonly _fileWatchersBySrc = new Map</* src: */ string, vscode.FileSystemWatcher>();
private readonly _unwatchedImageSchemes = new Set(['https', 'http', 'data']);

View file

@ -68,7 +68,7 @@ export default class MarkdownSmartSelect implements vscode.SelectionRangeProvide
}
}
function getHeadersForPosition(toc: readonly TocEntry[], position: vscode.Position): { headers: TocEntry[], headerOnThisLine: boolean } {
function getHeadersForPosition(toc: readonly TocEntry[], position: vscode.Position): { headers: TocEntry[]; headerOnThisLine: boolean } {
const enclosingHeaders = toc.filter(header => header.location.range.start.line <= position.line && header.location.range.end.line >= position.line);
const sortedHeaders = enclosingHeaders.sort((header1, header2) => (header1.line - position.line) - (header2.line - position.line));
const onThisLine = toc.find(header => header.line === position.line) !== undefined;

View file

@ -38,7 +38,7 @@ export class TopmostLineMonitor extends Disposable {
}));
}
private readonly _onChanged = this._register(new vscode.EventEmitter<{ readonly resource: vscode.Uri, readonly line: number }>());
private readonly _onChanged = this._register(new vscode.EventEmitter<{ readonly resource: vscode.Uri; readonly line: number }>());
public readonly onDidChanged = this._onChanged.event;
public setPreviousStaticEditorLine(scrollLocation: LastScrollLocation): void {

View file

@ -23,7 +23,7 @@ export default class MergeConflictContentProvider implements vscode.TextDocument
async provideTextDocumentContent(uri: vscode.Uri): Promise<string | null> {
try {
const { scheme, ranges } = JSON.parse(uri.query) as { scheme: string, ranges: [{ line: number, character: number }[], { line: number, character: number }[]][] };
const { scheme, ranges } = JSON.parse(uri.query) as { scheme: string; ranges: [{ line: number; character: number }[], { line: number; character: number }[]][] };
// complete diff
const document = await vscode.workspace.openTextDocument(uri.with({ scheme, query: '' }));

View file

@ -32,7 +32,7 @@ export class DocumentMergeConflict implements interfaces.IDocumentMergeConflict
return editor.edit((edit) => this.applyEdit(type, editor.document, edit));
}
public applyEdit(type: interfaces.CommitType, document: vscode.TextDocument, edit: { replace(range: vscode.Range, newText: string): void; }): void {
public applyEdit(type: interfaces.CommitType, document: vscode.TextDocument, edit: { replace(range: vscode.Range, newText: string): void }): void {
// Each conflict is a set of ranges as follows, note placements or newlines
// which may not in spans
@ -62,7 +62,7 @@ export class DocumentMergeConflict implements interfaces.IDocumentMergeConflict
}
}
private replaceRangeWithContent(content: string, edit: { replace(range: vscode.Range, newText: string): void; }) {
private replaceRangeWithContent(content: string, edit: { replace(range: vscode.Range, newText: string): void }) {
if (this.isNewlineOnly(content)) {
edit.replace(this.range, '');
return;

View file

@ -25,7 +25,7 @@ export interface IExtensionConfiguration {
export interface IDocumentMergeConflict extends IDocumentMergeConflictDescriptor {
commitEdit(type: CommitType, editor: vscode.TextEditor, edit?: vscode.TextEditorEdit): Thenable<boolean>;
applyEdit(type: CommitType, document: vscode.TextDocument, edit: { replace(range: vscode.Range, newText: string): void; }): void;
applyEdit(type: CommitType, document: vscode.TextDocument, edit: { replace(range: vscode.Range, newText: string): void }): void;
}
export interface IDocumentMergeConflictDescriptor {

View file

@ -58,9 +58,9 @@ interface IStoredSession {
scope: string; // Scopes are alphabetized and joined with a space
account: {
label?: string;
displayName?: string,
id: string
}
displayName?: string;
id: string;
};
}
export interface ITokenResponse {
@ -79,11 +79,11 @@ export interface IMicrosoftTokens {
}
interface IScopeData {
scopes: string[],
scopeStr: string,
scopesToSend: string,
clientId: string,
tenant: string
scopes: string[];
scopeStr: string;
scopesToSend: string;
clientId: string;
tenant: string;
}
function parseQuery(uri: vscode.Uri) {

View file

@ -101,11 +101,11 @@ async function callback(nonce: string, reqUrl: url.Url): Promise<string> {
}
export function createServer(nonce: string) {
type RedirectResult = { req: http.IncomingMessage; res: http.ServerResponse; } | { err: any; res: http.ServerResponse; };
type RedirectResult = { req: http.IncomingMessage; res: http.ServerResponse } | { err: any; res: http.ServerResponse };
let deferredRedirect: Deferred<RedirectResult>;
const redirectPromise = new Promise<RedirectResult>((resolve, reject) => deferredRedirect = { resolve, reject });
type CodeResult = { code: string; res: http.ServerResponse; } | { err: any; res: http.ServerResponse; };
type CodeResult = { code: string; res: http.ServerResponse } | { err: any; res: http.ServerResponse };
let deferredCode: Deferred<CodeResult>;
const codePromise = new Promise<CodeResult>((resolve, reject) => deferredCode = { resolve, reject });

View file

@ -9,7 +9,7 @@ import { Event, EventEmitter, ExtensionContext, SecretStorage, SecretStorageChan
export interface IDidChangeInOtherWindowEvent<T> {
added: string[];
updated: string[];
removed: Array<{ key: string, value: T; }>;
removed: Array<{ key: string; value: T }>;
}
export class BetterTokenStorage<T> {
@ -48,7 +48,7 @@ export class BetterTokenStorage<T> {
const keyList: Array<string> = JSON.parse(keyListStr);
// Gather promises that contain key value pairs our of secret storage
const promises = keyList.map(key => new Promise<{ key: string, value: string | undefined }>((res, rej) => {
const promises = keyList.map(key => new Promise<{ key: string; value: string | undefined }>((res, rej) => {
this._secretStorage.get(key).then((value) => {
res({ key, value });
}, rej);

View file

@ -8,7 +8,7 @@ import { AzureActiveDirectoryService, onDidChangeSessions } from './AADHelper';
import TelemetryReporter from '@vscode/extension-telemetry';
export async function activate(context: vscode.ExtensionContext) {
const { name, version, aiKey } = context.extension.packageJSON as { name: string, version: string, aiKey: string };
const { name, version, aiKey } = context.extension.packageJSON as { name: string; version: string; aiKey: string };
const telemetryReporter = new TelemetryReporter(name, version, aiKey);
const loginService = new AzureActiveDirectoryService(context);

View file

@ -69,7 +69,7 @@ export class BowerJSONContribution implements IJSONContribution {
try {
const obj = JSON.parse(success.responseText);
if (Array.isArray(obj)) {
const results = <{ name: string; description: string; }[]>obj;
const results = <{ name: string; description: string }[]>obj;
for (const result of results) {
const name = result.name;
const description = result.description || '';

View file

@ -102,7 +102,7 @@ export class PackageJSONContribution implements IJSONContribution {
try {
const obj = JSON.parse(success.responseText);
if (obj && obj.objects && Array.isArray(obj.objects)) {
const results = <{ package: SearchPackageInfo; }[]>obj.objects;
const results = <{ package: SearchPackageInfo }[]>obj.objects;
for (const result of results) {
this.processPackage(result.package, addValue, isLast, collector);
}
@ -162,7 +162,7 @@ export class PackageJSONContribution implements IJSONContribution {
try {
const obj = JSON.parse(success.responseText);
if (obj && Array.isArray(obj.objects)) {
const objects = <{ package: SearchPackageInfo; }[]>obj.objects;
const objects = <{ package: SearchPackageInfo }[]>obj.objects;
for (let object of objects) {
this.processPackage(object.package, addValue, isLast, collector);
}
@ -374,7 +374,7 @@ interface SearchPackageInfo {
name: string;
description?: string;
version?: string;
links?: { homepage?: string; };
links?: { homepage?: string };
}
interface ViewPackageInfo {

View file

@ -56,7 +56,7 @@ async function isNPMPreferred(pkgPath: string): Promise<PreferredProperties> {
return { isPreferred: lockfileExists, hasLockfile: lockfileExists };
}
export async function findPreferredPM(pkgPath: string): Promise<{ name: string, multipleLockFilesDetected: boolean }> {
export async function findPreferredPM(pkgPath: string): Promise<{ name: string; multipleLockFilesDetected: boolean }> {
const detectedPackageManagerNames: string[] = [];
const detectedPackageManagerProperties: PreferredProperties[] = [];

View file

@ -34,13 +34,13 @@ let cachedTasks: TaskWithLocation[] | undefined = undefined;
const INSTALL_SCRIPT = 'install';
export interface TaskLocation {
document: Uri,
line: Position
document: Uri;
line: Position;
}
export interface TaskWithLocation {
task: Task,
location?: Location
task: Task;
location?: Location;
}
export class NpmTaskProvider implements TaskProvider {
@ -416,7 +416,7 @@ export async function startDebugging(context: ExtensionContext, scriptName: stri
}
export type StringMap = { [s: string]: string; };
export type StringMap = { [s: string]: string };
export function findScriptAtPosition(document: TextDocument, buffer: string, position: Position): string | undefined {
const read = readScripts(document, buffer);

View file

@ -5,8 +5,8 @@
// file generated from PHP53Schema.xml using php-exclude_generate_php_globals.js
export interface IEntry { description?: string; signature?: string; }
export interface IEntries { [name: string]: IEntry; }
export interface IEntry { description?: string; signature?: string }
export interface IEntries { [name: string]: IEntry }
export const globalvariables: IEntries = {
$GLOBALS: {

View file

@ -13,7 +13,7 @@ const SEARCH_RESULT_SELECTOR = { language: 'search-result', exclusive: true };
const DIRECTIVES = ['# Query:', '# Flags:', '# Including:', '# Excluding:', '# ContextLines:'];
const FLAGS = ['RegExp', 'CaseSensitive', 'IgnoreExcludeSettings', 'WordMatch'];
let cachedLastParse: { version: number, parse: ParsedSearchResults, uri: vscode.Uri } | undefined;
let cachedLastParse: { version: number; parse: ParsedSearchResults; uri: vscode.Uri } | undefined;
let documentChangeListener: vscode.Disposable | undefined;
@ -174,8 +174,8 @@ function relativePathToUri(path: string, resultsUri: vscode.Uri): vscode.Uri | u
return undefined;
}
type ParsedSearchFileLine = { type: 'file', location: vscode.LocationLink, allLocations: vscode.LocationLink[], path: string };
type ParsedSearchResultLine = { type: 'result', locations: Required<vscode.LocationLink>[], isContext: boolean, prefixRange: vscode.Range };
type ParsedSearchFileLine = { type: 'file'; location: vscode.LocationLink; allLocations: vscode.LocationLink[]; path: string };
type ParsedSearchResultLine = { type: 'result'; locations: Required<vscode.LocationLink>[]; isContext: boolean; prefixRange: vscode.Range };
type ParsedSearchResults = Array<ParsedSearchFileLine | ParsedSearchResultLine>;
const isFileLine = (line: ParsedSearchResultLine | ParsedSearchFileLine): line is ParsedSearchFileLine => line.type === 'file';
const isResultLine = (line: ParsedSearchResultLine | ParsedSearchFileLine): line is ParsedSearchResultLine => line.type === 'result';

View file

@ -59,8 +59,8 @@ export function activate(context: vscode.ExtensionContext) {
}));
context.subscriptions.push(vscode.commands.registerCommand(openApiCommand, (url: vscode.Uri, showOptions?: {
preserveFocus?: boolean,
viewColumn: vscode.ViewColumn,
preserveFocus?: boolean;
viewColumn: vscode.ViewColumn;
}) => {
manager.show(url.toString(), showOptions);
}));

View file

@ -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 {};
}

View file

@ -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 }],

View file

@ -22,7 +22,7 @@ const localize = nls.loadMessageBundle();
interface DidApplyRefactoringCommand_Args {
readonly codeAction: InlinedCodeAction
readonly codeAction: InlinedCodeAction;
}
class DidApplyRefactoringCommand implements Command {

View file

@ -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;
}

View file

@ -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> {

View file

@ -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>,
) {

View file

@ -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! };

View file

@ -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);
}
}

View file

@ -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;

View file

@ -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;

View file

@ -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>;

View file

@ -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) {

View file

@ -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[] = [

View file

@ -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: {}) {

View file

@ -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':

View file

@ -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();
}

View file

@ -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 };
}

View file

@ -30,7 +30,7 @@ namespace Trace {
}
interface RequestExecutionMetadata {
readonly queuingStartTime: number
readonly queuingStartTime: number;
}
export default class Tracer {

Some files were not shown because too many files have changed in this diff Show more