mirror of https://github.com/microsoft/vscode.git
enable `@typescript-eslint/member-delimiter-style`, https://github.com/microsoft/vscode/issues/140391
This commit is contained in:
parent
5abc4e0071
commit
4a130c40ed
|
@ -45,6 +45,7 @@
|
||||||
"jsdoc/no-types": "warn",
|
"jsdoc/no-types": "warn",
|
||||||
"semi": "off",
|
"semi": "off",
|
||||||
"@typescript-eslint/semi": "warn",
|
"@typescript-eslint/semi": "warn",
|
||||||
|
"@typescript-eslint/member-delimiter-style": "warn",
|
||||||
"@typescript-eslint/naming-convention": [
|
"@typescript-eslint/naming-convention": [
|
||||||
"warn",
|
"warn",
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,7 +29,7 @@ interface OSSProduct {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Product {
|
interface Product {
|
||||||
readonly builtInExtensions?: IBuiltInExtension[] | { 'include'?: IBuiltInExtension[], 'exclude'?: string[] };
|
readonly builtInExtensions?: IBuiltInExtension[] | { 'include'?: IBuiltInExtension[]; 'exclude'?: string[] };
|
||||||
readonly webBuiltInExtensions?: IBuiltInExtension[];
|
readonly webBuiltInExtensions?: IBuiltInExtension[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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']!);
|
const credential = new ClientSecretCredential(process.env['AZURE_TENANT_ID']!, process.env['AZURE_CLIENT_ID']!, process.env['AZURE_CLIENT_SECRET']!);
|
||||||
|
|
||||||
interface NlsMetadata {
|
interface NlsMetadata {
|
||||||
keys: { [module: string]: string },
|
keys: { [module: string]: string };
|
||||||
messages: { [module: string]: string },
|
messages: { [module: string]: string };
|
||||||
bundles: { [bundle: string]: string[] },
|
bundles: { [bundle: string]: string[] };
|
||||||
}
|
}
|
||||||
|
|
||||||
function main(): Promise<void> {
|
function main(): Promise<void> {
|
||||||
|
|
|
@ -38,7 +38,7 @@ function main(): Promise<void> {
|
||||||
const vs = src('out-vscode-min'); // client source-maps only
|
const vs = src('out-vscode-min'); // client source-maps only
|
||||||
sources.push(vs);
|
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 productionDependenciesSrc = productionDependencies.map(d => path.relative(root, d.path)).map(d => `./${d}/**/*.map`);
|
||||||
const nodeModules = vfs.src(productionDependenciesSrc, { base: '.' })
|
const nodeModules = vfs.src(productionDependenciesSrc, { base: '.' })
|
||||||
.pipe(util.cleanNodeModules(path.join(root, 'build', '.moduleignore')));
|
.pipe(util.cleanNodeModules(path.join(root, 'build', '.moduleignore')));
|
||||||
|
|
|
@ -16,7 +16,7 @@ declare class AsarFilesystem {
|
||||||
readonly header: unknown;
|
readonly header: unknown;
|
||||||
constructor(src: string);
|
constructor(src: string);
|
||||||
insertDirectory(path: string, shouldUnpack?: boolean): unknown;
|
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 {
|
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--; };
|
let onFileInserted = () => { pendingInserts--; };
|
||||||
|
|
||||||
// Do not insert twice the same directory
|
// Do not insert twice the same directory
|
||||||
const seenDir: { [key: string]: boolean; } = {};
|
const seenDir: { [key: string]: boolean } = {};
|
||||||
const insertDirectoryRecursive = (dir: string) => {
|
const insertDirectoryRecursive = (dir: string) => {
|
||||||
if (seenDir[dir]) {
|
if (seenDir[dir]) {
|
||||||
return;
|
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);
|
insertDirectoryForFile(relativePath);
|
||||||
pendingInserts++;
|
pendingInserts++;
|
||||||
// Do not pass `onFileInserted` directly because it gets overwritten below.
|
// Do not pass `onFileInserted` directly because it gets overwritten below.
|
||||||
|
|
|
@ -31,7 +31,7 @@ export interface IExtensionDefinition {
|
||||||
flags: string;
|
flags: string;
|
||||||
};
|
};
|
||||||
publisherDisplayName: string;
|
publisherDisplayName: string;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const root = path.dirname(path.dirname(__dirname));
|
const root = path.dirname(path.dirname(__dirname));
|
||||||
|
|
|
@ -27,7 +27,7 @@ async function downloadExtensionDetails(extension: IExtensionDefinition): Promis
|
||||||
|
|
||||||
const promises = [];
|
const promises = [];
|
||||||
for (const fileName of contentFileNames) {
|
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}`)
|
got(`${repositoryContentBaseUrl}/${fileName}`)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
resolve({ fileName, body: response.rawBody });
|
resolve({ fileName, body: response.rawBody });
|
||||||
|
|
|
@ -75,7 +75,7 @@ export interface IConcatFile {
|
||||||
|
|
||||||
export interface IBundleData {
|
export interface IBundleData {
|
||||||
graph: IGraph;
|
graph: IGraph;
|
||||||
bundles: { [moduleId: string]: string[]; };
|
bundles: { [moduleId: string]: string[] };
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IBundleResult {
|
export interface IBundleResult {
|
||||||
|
@ -91,7 +91,7 @@ interface IPartialBundleResult {
|
||||||
|
|
||||||
export interface ILoaderConfig {
|
export interface ILoaderConfig {
|
||||||
isBuild?: boolean;
|
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;
|
entryPointsMap[module.name] = module;
|
||||||
});
|
});
|
||||||
|
|
||||||
const allMentionedModulesMap: { [modules: string]: boolean; } = {};
|
const allMentionedModulesMap: { [modules: string]: boolean } = {};
|
||||||
entryPoints.forEach((module: IEntryPoint) => {
|
entryPoints.forEach((module: IEntryPoint) => {
|
||||||
allMentionedModulesMap[module.name] = true;
|
allMentionedModulesMap[module.name] = true;
|
||||||
(module.include || []).forEach(function (includedModule) {
|
(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
|
// 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) => {
|
destFile.sources.forEach((source) => {
|
||||||
const matches = source.contents.match(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/);
|
const matches = source.contents.match(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/);
|
||||||
if (!matches) {
|
if (!matches) {
|
||||||
|
@ -302,7 +302,7 @@ function extractStrings(destFiles: IConcatFile[]): IConcatFile[] {
|
||||||
return useCounts[b] - useCounts[a];
|
return useCounts[b] - useCounts[a];
|
||||||
});
|
});
|
||||||
|
|
||||||
const replacementMap: { [moduleId: string]: number; } = {};
|
const replacementMap: { [moduleId: string]: number } = {};
|
||||||
sortedByUseModules.forEach((module, index) => {
|
sortedByUseModules.forEach((module, index) => {
|
||||||
replacementMap[module] = index;
|
replacementMap[module] = index;
|
||||||
});
|
});
|
||||||
|
@ -599,7 +599,7 @@ function visit(rootNodes: string[], graph: IGraph): INodeSet {
|
||||||
function topologicalSort(graph: IGraph): string[] {
|
function topologicalSort(graph: IGraph): string[] {
|
||||||
|
|
||||||
const allNodes: INodeSet = {},
|
const allNodes: INodeSet = {},
|
||||||
outgoingEdgeCount: { [node: string]: number; } = {},
|
outgoingEdgeCount: { [node: string]: number } = {},
|
||||||
inverseEdges: IGraph = {};
|
inverseEdges: IGraph = {};
|
||||||
|
|
||||||
Object.keys(graph).forEach((fromNode: string) => {
|
Object.keys(graph).forEach((fromNode: string) => {
|
||||||
|
|
|
@ -132,7 +132,7 @@ class MonacoGenerator {
|
||||||
private readonly _isWatch: boolean;
|
private readonly _isWatch: boolean;
|
||||||
public readonly stream: NodeJS.ReadWriteStream;
|
public readonly stream: NodeJS.ReadWriteStream;
|
||||||
|
|
||||||
private readonly _watchedFiles: { [filePath: string]: boolean; };
|
private readonly _watchedFiles: { [filePath: string]: boolean };
|
||||||
private readonly _fsProvider: monacodts.FSProvider;
|
private readonly _fsProvider: monacodts.FSProvider;
|
||||||
private readonly _declarationResolver: monacodts.DeclarationResolver;
|
private readonly _declarationResolver: monacodts.DeclarationResolver;
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,11 @@ import * as util from './util';
|
||||||
|
|
||||||
type DarwinDocumentSuffix = 'document' | 'script' | 'file' | 'source code';
|
type DarwinDocumentSuffix = 'document' | 'script' | 'file' | 'source code';
|
||||||
type DarwinDocumentType = {
|
type DarwinDocumentType = {
|
||||||
name: string,
|
name: string;
|
||||||
role: string,
|
role: string;
|
||||||
ostypes: string[],
|
ostypes: string[];
|
||||||
extensions: string[],
|
extensions: string[];
|
||||||
iconFile: string,
|
iconFile: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
function isDocumentSuffix(str?: string): str is DarwinDocumentSuffix {
|
function isDocumentSuffix(str?: string): str is DarwinDocumentSuffix {
|
||||||
|
|
|
@ -29,7 +29,7 @@ export = new class NoUnexternalizedStrings implements eslint.Rule.RuleModule {
|
||||||
|
|
||||||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
|
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>();
|
const doubleQuotedStringLiterals = new Set<TSESTree.Node>();
|
||||||
|
|
||||||
function collectDoubleQuotedStrings(node: TSESTree.Literal) {
|
function collectDoubleQuotedStrings(node: TSESTree.Literal) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ export = new class ApiEventNaming implements eslint.Rule.RuleModule {
|
||||||
|
|
||||||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
|
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 allowed = new Set(config.allowed);
|
||||||
const verbs = new Set(config.verbs);
|
const verbs = new Set(config.verbs);
|
||||||
|
|
||||||
|
|
|
@ -409,7 +409,7 @@ export function scanBuiltinExtensions(extensionsRoot: string, exclude: string[]
|
||||||
|
|
||||||
export function translatePackageJSON(packageJSON: string, packageNLSPath: string) {
|
export function translatePackageJSON(packageJSON: string, packageNLSPath: string) {
|
||||||
interface NLSFormat {
|
interface NLSFormat {
|
||||||
[key: string]: string | { message: string, comment: string[] };
|
[key: string]: string | { message: string; comment: string[] };
|
||||||
}
|
}
|
||||||
const CharCode_PC = '%'.charCodeAt(0);
|
const CharCode_PC = '%'.charCodeAt(0);
|
||||||
const packageNls: NLSFormat = JSON.parse(fs.readFileSync(packageNLSPath).toString());
|
const packageNls: NLSFormat = JSON.parse(fs.readFileSync(packageNLSPath).toString());
|
||||||
|
@ -446,7 +446,7 @@ const esbuildMediaScripts = [
|
||||||
'markdown-math/esbuild.js',
|
'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 webpack = require('webpack') as typeof import('webpack');
|
||||||
|
|
||||||
const webpackConfigs: webpack.Configuration[] = [];
|
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) {
|
function reporter(stdError: string, script: string) {
|
||||||
const matches = (stdError || '').match(/\> (.+): error: (.+)?/g);
|
const matches = (stdError || '').match(/\> (.+): error: (.+)?/g);
|
||||||
fancyLog(`Finished ${ansiColors.green(taskName)} ${script} with ${matches ? matches.length : 0} errors.`);
|
fancyLog(`Finished ${ansiColors.green(taskName)} ${script} with ${matches ? matches.length : 0} errors.`);
|
||||||
|
|
|
@ -277,7 +277,7 @@ export class XLF {
|
||||||
static parsePseudo = function (xlfString: string): Promise<ParsedXLF[]> {
|
static parsePseudo = function (xlfString: string): Promise<ParsedXLF[]> {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
let parser = new xml2js.Parser();
|
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) {
|
parser.parseString(xlfString, function (_err: any, result: any) {
|
||||||
const fileNodes: any[] = result['xliff']['file'];
|
const fileNodes: any[] = result['xliff']['file'];
|
||||||
fileNodes.forEach(file => {
|
fileNodes.forEach(file => {
|
||||||
|
@ -304,7 +304,7 @@ export class XLF {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let parser = new xml2js.Parser();
|
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) {
|
parser.parseString(xlfString, function (err: any, result: any) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
|
@ -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);
|
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 replacer = createReplacer(m2[2]);
|
||||||
|
|
||||||
let typeNames = m2[3].split(/,/);
|
let typeNames = m2[3].split(/,/);
|
||||||
let typesToExcludeMap: { [typeName: string]: boolean; } = {};
|
let typesToExcludeMap: { [typeName: string]: boolean } = {};
|
||||||
let typesToExcludeArr: string[] = [];
|
let typesToExcludeArr: string[] = [];
|
||||||
typeNames.forEach((typeName) => {
|
typeNames.forEach((typeName) => {
|
||||||
typeName = typeName.trim();
|
typeName = typeName.trim();
|
||||||
|
@ -599,7 +599,7 @@ class CacheEntry {
|
||||||
export class DeclarationResolver {
|
export class DeclarationResolver {
|
||||||
|
|
||||||
public readonly ts: typeof import('typescript');
|
public readonly ts: typeof import('typescript');
|
||||||
private _sourceFileCache: { [moduleId: string]: CacheEntry | null; };
|
private _sourceFileCache: { [moduleId: string]: CacheEntry | null };
|
||||||
|
|
||||||
constructor(private readonly _fsProvider: FSProvider) {
|
constructor(private readonly _fsProvider: FSProvider) {
|
||||||
this.ts = require('typescript') as typeof import('typescript');
|
this.ts = require('typescript') as typeof import('typescript');
|
||||||
|
@ -667,8 +667,8 @@ export function run3(resolver: DeclarationResolver): IMonacoDeclarationResult |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
interface ILibMap { [libName: string]: string; }
|
interface ILibMap { [libName: string]: string }
|
||||||
interface IFileMap { [fileName: string]: string; }
|
interface IFileMap { [fileName: string]: string }
|
||||||
|
|
||||||
class TypeScriptLanguageServiceHost implements ts.LanguageServiceHost {
|
class TypeScriptLanguageServiceHost implements ts.LanguageServiceHost {
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import * as tss from './treeshaking';
|
||||||
const REPO_ROOT = path.join(__dirname, '../../');
|
const REPO_ROOT = path.join(__dirname, '../../');
|
||||||
const SRC_DIR = path.join(REPO_ROOT, 'src');
|
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 writeFile(filePath: string, contents: Buffer | string): void {
|
||||||
function ensureDirs(dirPath: 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]);
|
writeFile(path.join(options.destRoot, fileName), result[fileName]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let copied: { [fileName: string]: boolean; } = {};
|
let copied: { [fileName: string]: boolean } = {};
|
||||||
const copyFile = (fileName: string) => {
|
const copyFile = (fileName: string) => {
|
||||||
if (copied[fileName]) {
|
if (copied[fileName]) {
|
||||||
return;
|
return;
|
||||||
|
@ -131,7 +131,7 @@ export interface IOptions2 {
|
||||||
outFolder: string;
|
outFolder: string;
|
||||||
outResourcesFolder: string;
|
outResourcesFolder: string;
|
||||||
ignores: string[];
|
ignores: string[];
|
||||||
renames: { [filename: string]: string; };
|
renames: { [filename: string]: string };
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createESMSourcesAndResources2(options: IOptions2): void {
|
export function createESMSourcesAndResources2(options: IOptions2): void {
|
||||||
|
|
|
@ -59,7 +59,7 @@ export interface ITreeShakingOptions {
|
||||||
*/
|
*/
|
||||||
importIgnorePattern: RegExp;
|
importIgnorePattern: RegExp;
|
||||||
|
|
||||||
redirects: { [module: string]: string; };
|
redirects: { [module: string]: string };
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ITreeShakingResult {
|
export interface ITreeShakingResult {
|
||||||
|
@ -140,7 +140,7 @@ function createTypeScriptLanguageService(ts: typeof import('typescript'), option
|
||||||
function discoverAndReadFiles(ts: typeof import('typescript'), options: ITreeShakingOptions): IFileMap {
|
function discoverAndReadFiles(ts: typeof import('typescript'), options: ITreeShakingOptions): IFileMap {
|
||||||
const FILES: 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 queue: string[] = [];
|
||||||
|
|
||||||
const enqueue = (moduleId: string) => {
|
const enqueue = (moduleId: string) => {
|
||||||
|
@ -225,8 +225,8 @@ function processLibFiles(ts: typeof import('typescript'), options: ITreeShakingO
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ILibMap { [libName: string]: string; }
|
interface ILibMap { [libName: string]: string }
|
||||||
interface IFileMap { [fileName: string]: string; }
|
interface IFileMap { [fileName: string]: string }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A TypeScript language service host
|
* A TypeScript language service host
|
||||||
|
|
|
@ -68,9 +68,9 @@ function watch(root: string): Stream {
|
||||||
return result;
|
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 || {};
|
options = options || {};
|
||||||
|
|
||||||
const cwd = path.normalize(options.cwd || process.cwd());
|
const cwd = path.normalize(options.cwd || process.cwd());
|
||||||
|
|
|
@ -142,7 +142,7 @@ vscode.languages.registerDocumentSymbolProvider({ pattern: '**/launch.json', lan
|
||||||
}, { label: 'Launch Targets' });
|
}, { label: 'Launch Targets' });
|
||||||
|
|
||||||
function registerContextKeyCompletions(): vscode.Disposable {
|
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[]>([
|
const paths = new Map<vscode.DocumentFilter, JSONPath[]>([
|
||||||
[{ language: 'jsonc', pattern: '**/keybindings.json' }, [
|
[{ language: 'jsonc', pattern: '**/keybindings.json' }, [
|
||||||
|
|
|
@ -277,7 +277,7 @@ export class SettingsDocument {
|
||||||
return item;
|
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);
|
const item = new vscode.CompletionItem(o.label);
|
||||||
item.kind = vscode.CompletionItemKind.Value;
|
item.kind = vscode.CompletionItemKind.Value;
|
||||||
item.documentation = o.documentation;
|
item.documentation = o.documentation;
|
||||||
|
|
|
@ -12,7 +12,7 @@ declare const Worker: {
|
||||||
new(stringUrl: string): any;
|
new(stringUrl: string): any;
|
||||||
};
|
};
|
||||||
declare const TextDecoder: {
|
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
|
// this method is called when vs code is activated
|
||||||
|
|
|
@ -18,7 +18,7 @@ const localize = nls.loadMessageBundle();
|
||||||
export type LanguageClientConstructor = (name: string, description: string, clientOptions: LanguageClientOptions) => CommonLanguageClient;
|
export type LanguageClientConstructor = (name: string, description: string, clientOptions: LanguageClientOptions) => CommonLanguageClient;
|
||||||
|
|
||||||
export interface Runtime {
|
export interface Runtime {
|
||||||
TextDecoder: { new(encoding?: string): { decode(buffer: ArrayBuffer): string; } };
|
TextDecoder: { new(encoding?: string): { decode(buffer: ArrayBuffer): string } };
|
||||||
fs?: RequestService;
|
fs?: RequestService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { RequestType, CommonLanguageClient } from 'vscode-languageclient';
|
||||||
import { Runtime } from './cssClient';
|
import { Runtime } from './cssClient';
|
||||||
|
|
||||||
export namespace FsContentRequest {
|
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 namespace FsStatRequest {
|
||||||
export const type: RequestType<string, FileStat, any> = new RequestType('fs/stat');
|
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) {
|
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);
|
const uri = Uri.parse(param.uri);
|
||||||
if (uri.scheme === 'file' && runtime.fs) {
|
if (uri.scheme === 'file' && runtime.fs) {
|
||||||
return runtime.fs.getContent(param.uri);
|
return runtime.fs.getContent(param.uri);
|
||||||
|
|
|
@ -30,7 +30,7 @@ export interface RuntimeEnvironment {
|
||||||
readonly timer: {
|
readonly timer: {
|
||||||
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable;
|
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable;
|
||||||
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable;
|
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function startServer(connection: Connection, runtime: RuntimeEnvironment) {
|
export function startServer(connection: Connection, runtime: RuntimeEnvironment) {
|
||||||
|
|
|
@ -12,7 +12,7 @@ export interface LanguageModelCache<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getLanguageModelCache<T>(maxEntries: number, cleanupIntervalTimeInSec: number, parse: (document: TextDocument) => T): 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 nModels = 0;
|
||||||
|
|
||||||
let cleanupInterval: NodeJS.Timer | undefined = undefined;
|
let cleanupInterval: NodeJS.Timer | undefined = undefined;
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { RequestType, Connection } from 'vscode-languageserver';
|
||||||
import { RuntimeEnvironment } from './cssServer';
|
import { RuntimeEnvironment } from './cssServer';
|
||||||
|
|
||||||
export namespace FsContentRequest {
|
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 namespace FsStatRequest {
|
||||||
export const type: RequestType<string, FileStat, any> = new RequestType('fs/stat');
|
export const type: RequestType<string, FileStat, any> = new RequestType('fs/stat');
|
||||||
|
|
|
@ -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('|');
|
const offset = value.indexOf('|');
|
||||||
value = value.substr(0, offset) + value.substr(offset + 1);
|
value = value.substr(0, offset) + value.substr(offset + 1);
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,10 @@ import { ISizeCalculationResult } from 'image-size/dist/types/interface';
|
||||||
|
|
||||||
const reUrl = /^https?:/;
|
const reUrl = /^https?:/;
|
||||||
export type ImageInfoWithScale = {
|
export type ImageInfoWithScale = {
|
||||||
realWidth: number,
|
realWidth: number;
|
||||||
realHeight: number,
|
realHeight: number;
|
||||||
width: number,
|
width: number;
|
||||||
height: number
|
height: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -9,8 +9,8 @@ import { HtmlNode as HtmlFlatNode } from 'EmmetFlatNode';
|
||||||
import { getRootNode } from './parseDocument';
|
import { getRootNode } from './parseDocument';
|
||||||
|
|
||||||
interface TagRange {
|
interface TagRange {
|
||||||
name: string,
|
name: string;
|
||||||
range: vscode.Range
|
range: vscode.Range;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateTag(tagName: string | undefined): Promise<boolean | undefined> {
|
export async function updateTag(tagName: string | undefined): Promise<boolean | undefined> {
|
||||||
|
|
|
@ -74,7 +74,7 @@ export class PackageDocument {
|
||||||
return item;
|
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);
|
const item = new vscode.CompletionItem(o.label);
|
||||||
item.kind = vscode.CompletionItemKind.Value;
|
item.kind = vscode.CompletionItemKind.Value;
|
||||||
item.documentation = o.documentation;
|
item.documentation = o.documentation;
|
||||||
|
|
|
@ -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?: 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 & { branch: true }): Promise<PickRemoteSourceResult | undefined>;
|
||||||
export async function pickRemoteSource(model: Model, options: PickRemoteSourceOptions = {}): Promise<string | 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;
|
quickpick.ignoreFocusOut = true;
|
||||||
|
|
||||||
if (options.providerName) {
|
if (options.providerName) {
|
||||||
|
|
|
@ -68,7 +68,7 @@ export class ApiRepository implements Repository {
|
||||||
return this._repository.apply(patch, reverse);
|
return this._repository.apply(patch, reverse);
|
||||||
}
|
}
|
||||||
|
|
||||||
getConfigs(): Promise<{ key: string; value: string; }[]> {
|
getConfigs(): Promise<{ key: string; value: string }[]> {
|
||||||
return this._repository.getConfigs();
|
return this._repository.getConfigs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,11 +84,11 @@ export class ApiRepository implements Repository {
|
||||||
return this._repository.getGlobalConfig(key);
|
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);
|
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);
|
return this._repository.detectObjectType(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 config = workspace.getConfiguration('git', null);
|
||||||
const enabled = config.get<boolean>('enabled');
|
const enabled = config.get<boolean>('enabled');
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ export class Askpass implements IIPCHandler {
|
||||||
return await window.showInputBox(options) || '';
|
return await window.showInputBox(options) || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
getEnv(): { [key: string]: string; } {
|
getEnv(): { [key: string]: string } {
|
||||||
if (!this.ipc) {
|
if (!this.ipc) {
|
||||||
return {
|
return {
|
||||||
GIT_ASKPASS: path.join(__dirname, 'askpass-empty.sh')
|
GIT_ASKPASS: path.join(__dirname, 'askpass-empty.sh')
|
||||||
|
|
|
@ -186,7 +186,7 @@ function command(commandId: string, options: ScmCommandOptions = {}): Function {
|
||||||
// 'image/bmp'
|
// '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 selection = resources.filter(s => s instanceof Resource) as Resource[];
|
||||||
const merge = selection.filter(s => s.resourceGroupType === ResourceGroupType.Merge);
|
const merge = selection.filter(s => s.resourceGroupType === ResourceGroupType.Merge);
|
||||||
const isBothAddedOrModified = (s: Resource) => s.type === Status.BOTH_MODIFIED || s.type === Status.BOTH_ADDED;
|
const isBothAddedOrModified = (s: Resource) => s.type === Status.BOTH_MODIFIED || s.type === Status.BOTH_ADDED;
|
||||||
|
@ -282,7 +282,7 @@ interface PushOptions {
|
||||||
remote?: string;
|
remote?: string;
|
||||||
refspec?: string;
|
refspec?: string;
|
||||||
setUpstream?: boolean;
|
setUpstream?: boolean;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
class CommandErrorOutputTextDocumentContentProvider implements TextDocumentContentProvider {
|
class CommandErrorOutputTextDocumentContentProvider implements TextDocumentContentProvider {
|
||||||
|
@ -544,7 +544,7 @@ export class CommandCenter {
|
||||||
} else {
|
} else {
|
||||||
const placeHolder = localize('init', "Pick workspace folder to initialize git repo in");
|
const placeHolder = localize('init', "Pick workspace folder to initialize git repo in");
|
||||||
const pick = { label: localize('choose', "Choose Folder...") };
|
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 })),
|
...workspace.workspaceFolders.map(folder => ({ label: folder.name, description: folder.uri.fsPath, folder })),
|
||||||
pick
|
pick
|
||||||
];
|
];
|
||||||
|
@ -1683,7 +1683,7 @@ export class CommandCenter {
|
||||||
return this._checkout(repository, { detached: true, treeish });
|
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') {
|
if (typeof opts?.treeish === 'string') {
|
||||||
await repository.checkout(opts?.treeish, opts);
|
await repository.checkout(opts?.treeish, opts);
|
||||||
return true;
|
return true;
|
||||||
|
@ -2698,7 +2698,7 @@ export class CommandCenter {
|
||||||
env.clipboard.writeText(item.message);
|
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 })
|
@command('git.timeline.selectForCompare', { repository: false })
|
||||||
async timelineSelectForCompare(item: TimelineItem, uri: Uri | undefined, _source: string) {
|
async timelineSelectForCompare(item: TimelineItem, uri: Uri | undefined, _source: string) {
|
||||||
|
@ -2959,7 +2959,7 @@ export class CommandCenter {
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}, [] as { repository: Repository, resources: Uri[] }[]);
|
}, [] as { repository: Repository; resources: Uri[] }[]);
|
||||||
|
|
||||||
const promises = groups
|
const promises = groups
|
||||||
.map(({ repository, resources }) => fn(repository as Repository, isSingleResource ? resources[0] : resources));
|
.map(({ repository, resources }) => fn(repository as Repository, isSingleResource ? resources[0] : resources));
|
||||||
|
|
|
@ -16,7 +16,7 @@ class GitIgnoreDecorationProvider implements FileDecorationProvider {
|
||||||
private static Decoration: FileDecoration = { color: new ThemeColor('gitDecoration.ignoredResourceForeground') };
|
private static Decoration: FileDecoration = { color: new ThemeColor('gitDecoration.ignoredResourceForeground') };
|
||||||
|
|
||||||
readonly onDidChangeFileDecorations: Event<Uri[]>;
|
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[] = [];
|
private disposables: Disposable[] = [];
|
||||||
|
|
||||||
constructor(private model: Model) {
|
constructor(private model: Model) {
|
||||||
|
|
|
@ -858,7 +858,7 @@ export class Repository {
|
||||||
return result.stdout.trim();
|
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'];
|
const args = ['config'];
|
||||||
|
|
||||||
if (scope) {
|
if (scope) {
|
||||||
|
@ -960,7 +960,7 @@ export class Repository {
|
||||||
return stdout;
|
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
|
if (!treeish) { // index
|
||||||
const elements = await this.lsfiles(path);
|
const elements = await this.lsfiles(path);
|
||||||
|
|
||||||
|
@ -998,7 +998,7 @@ export class Repository {
|
||||||
async getGitRelativePath(ref: string, relativePath: string): Promise<string> {
|
async getGitRelativePath(ref: string, relativePath: string): Promise<string> {
|
||||||
const relativePathLowercase = relativePath.toLowerCase();
|
const relativePathLowercase = relativePath.toLowerCase();
|
||||||
const dirname = path.posix.dirname(relativePath) + '/';
|
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];
|
const element = elements.filter(file => file.file.toLowerCase() === relativePathLowercase)[0];
|
||||||
|
|
||||||
if (!element) {
|
if (!element) {
|
||||||
|
@ -1008,7 +1008,7 @@ export class Repository {
|
||||||
return element.file;
|
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 child = await this.stream(['show', '--textconv', object]);
|
||||||
const buffer = await readBytes(child.stdout!, 4100);
|
const buffer = await readBytes(child.stdout!, 4100);
|
||||||
|
|
||||||
|
@ -1308,7 +1308,7 @@ export class Repository {
|
||||||
await this.exec(['update-index', add, '--cacheinfo', mode, hash, path]);
|
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'];
|
const args = ['checkout', '-q'];
|
||||||
|
|
||||||
if (opts.track) {
|
if (opts.track) {
|
||||||
|
@ -1570,7 +1570,7 @@ export class Repository {
|
||||||
await this.exec(args);
|
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 args = ['fetch'];
|
||||||
const spawnOptions: SpawnOptions = {
|
const spawnOptions: SpawnOptions = {
|
||||||
cancellationToken: options.cancellationToken,
|
cancellationToken: options.cancellationToken,
|
||||||
|
@ -1813,8 +1813,8 @@ export class Repository {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getStatus(opts?: { limit?: number, ignoreSubmodules?: boolean }): Promise<{ status: IFileStatus[]; statusLength: number; didHitLimit: boolean; }> {
|
getStatus(opts?: { limit?: number; ignoreSubmodules?: boolean }): Promise<{ status: IFileStatus[]; statusLength: number; didHitLimit: boolean }> {
|
||||||
return new Promise<{ status: IFileStatus[]; statusLength: number; didHitLimit: boolean; }>((c, e) => {
|
return new Promise<{ status: IFileStatus[]; statusLength: number; didHitLimit: boolean }>((c, e) => {
|
||||||
const parser = new GitStatusParser();
|
const parser = new GitStatusParser();
|
||||||
const env = { GIT_OPTIONAL_LOCKS: '0' };
|
const env = { GIT_OPTIONAL_LOCKS: '0' };
|
||||||
const args = ['status', '-z', '-u'];
|
const args = ['status', '-z', '-u'];
|
||||||
|
@ -1894,7 +1894,7 @@ export class Repository {
|
||||||
.map(([ref]) => ({ name: ref, type: RefType.Head } as Branch));
|
.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'];
|
const args = ['for-each-ref'];
|
||||||
|
|
||||||
if (opts?.count) {
|
if (opts?.count) {
|
||||||
|
|
|
@ -61,7 +61,7 @@ export async function createIPCServer(context?: string): Promise<IIPCServer> {
|
||||||
|
|
||||||
export interface IIPCServer extends Disposable {
|
export interface IIPCServer extends Disposable {
|
||||||
readonly ipcHandlePath: string | undefined;
|
readonly ipcHandlePath: string | undefined;
|
||||||
getEnv(): { [key: string]: string; };
|
getEnv(): { [key: string]: string };
|
||||||
registerHandler(name: string, handler: IIPCHandler): Disposable;
|
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 };
|
return { VSCODE_GIT_IPC_HANDLE: this.ipcHandlePath };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import { GitTimelineProvider } from './timelineProvider';
|
||||||
import { registerAPICommands } from './api/api1';
|
import { registerAPICommands } from './api/api1';
|
||||||
import { TerminalEnvironmentManager } from './terminal';
|
import { TerminalEnvironmentManager } from './terminal';
|
||||||
|
|
||||||
const deactivateTasks: { (): Promise<any>; }[] = [];
|
const deactivateTasks: { (): Promise<any> }[] = [];
|
||||||
|
|
||||||
export async function deactivate(): Promise<any> {
|
export async function deactivate(): Promise<any> {
|
||||||
for (const task of deactivateTasks) {
|
for (const task of deactivateTasks) {
|
||||||
|
@ -165,7 +165,7 @@ export async function _activate(context: ExtensionContext): Promise<GitExtension
|
||||||
commands.registerCommand('git.showOutput', () => outputChannel.show());
|
commands.registerCommand('git.showOutput', () => outputChannel.show());
|
||||||
disposables.push(outputChannel);
|
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);
|
const telemetryReporter = new TelemetryReporter(name, version, aiKey);
|
||||||
deactivateTasks.push(() => telemetryReporter.dispose());
|
deactivateTasks.push(() => telemetryReporter.dispose());
|
||||||
|
|
||||||
|
|
|
@ -1071,7 +1071,7 @@ export class Repository implements Disposable {
|
||||||
return await this.repository.getCommitTemplate();
|
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'));
|
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));
|
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));
|
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));
|
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));
|
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 }));
|
await this.run(Operation.CheckoutTracking, () => this.repository.checkout(treeish, [], { ...opts, track: true }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1326,7 +1326,7 @@ export class Repository implements Disposable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@throttle
|
@throttle
|
||||||
async fetchDefault(options: { silent?: boolean; } = {}): Promise<void> {
|
async fetchDefault(options: { silent?: boolean } = {}): Promise<void> {
|
||||||
await this._fetch({ silent: options.silent });
|
await this._fetch({ silent: options.silent });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1344,7 +1344,7 @@ export class Repository implements Disposable {
|
||||||
await this._fetch(options);
|
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) {
|
if (!options.prune) {
|
||||||
const config = workspace.getConfiguration('git', Uri.file(this.root));
|
const config = workspace.getConfiguration('git', Uri.file(this.root));
|
||||||
const prune = config.get<boolean>('pruneOnFetch');
|
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));
|
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));
|
return this.run(Operation.Show, () => this.repository.detectObjectType(object));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
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 => {
|
return element => {
|
||||||
const key = keyFn(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> {
|
export class PromiseSource<T> {
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ const passthrough = (value: any, resolve: (value?: any) => void) => resolve(valu
|
||||||
*/
|
*/
|
||||||
export function promiseFromEvent<T, U>(
|
export function promiseFromEvent<T, U>(
|
||||||
event: Event<T>,
|
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 subscription: Disposable;
|
||||||
let cancel = new EventEmitter<void>();
|
let cancel = new EventEmitter<void>();
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -18,7 +18,7 @@ interface SessionData {
|
||||||
label?: string;
|
label?: string;
|
||||||
displayName?: string;
|
displayName?: string;
|
||||||
id: string;
|
id: string;
|
||||||
}
|
};
|
||||||
scopes: string[];
|
scopes: string[];
|
||||||
accessToken: string;
|
accessToken: string;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
|
||||||
private _disposable: vscode.Disposable;
|
private _disposable: vscode.Disposable;
|
||||||
|
|
||||||
constructor(private readonly context: vscode.ExtensionContext, private readonly type: AuthProviderType) {
|
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));
|
this._telemetryReporter = new ExperimentationTelemetry(context, new TelemetryReporter(name, version, aiKey));
|
||||||
|
|
||||||
if (this.type === AuthProviderType.github) {
|
if (this.type === AuthProviderType.github) {
|
||||||
|
@ -149,7 +149,7 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
|
||||||
if (scopesSeen.has(scopesStr)) {
|
if (scopesSeen.has(scopesStr)) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
let userInfo: { id: string, accountName: string } | undefined;
|
let userInfo: { id: string; accountName: string } | undefined;
|
||||||
if (!session.account) {
|
if (!session.account) {
|
||||||
try {
|
try {
|
||||||
userInfo = await this._githubServer.getUserInfo(session.accessToken);
|
userInfo = await this._githubServer.getUserInfo(session.accessToken);
|
||||||
|
|
|
@ -41,7 +41,7 @@ function parseQuery(uri: vscode.Uri) {
|
||||||
|
|
||||||
export interface IGitHubServer extends vscode.Disposable {
|
export interface IGitHubServer extends vscode.Disposable {
|
||||||
login(scopes: string): Promise<string>;
|
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>;
|
sendAdditionalTelemetryInfo(token: string): Promise<void>;
|
||||||
friendlyName: string;
|
friendlyName: string;
|
||||||
type: AuthProviderType;
|
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;
|
let result: Response;
|
||||||
try {
|
try {
|
||||||
logger.info('Getting user info...');
|
logger.info('Getting user info...');
|
||||||
|
@ -119,7 +119,7 @@ export class GitHubServer implements IGitHubServer {
|
||||||
private _onDidManuallyProvideToken = new vscode.EventEmitter<string | undefined>();
|
private _onDidManuallyProvideToken = new vscode.EventEmitter<string | undefined>();
|
||||||
|
|
||||||
private _pendingStates = new Map<string, string[]>();
|
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 _statusBarCommandId = `${this.type}.provide-manually`;
|
||||||
private _disposable: vscode.Disposable;
|
private _disposable: vscode.Disposable;
|
||||||
private _uriHandler = new UriEventHandler(this._logger);
|
private _uriHandler = new UriEventHandler(this._logger);
|
||||||
|
@ -382,7 +382,7 @@ export class GitHubServer implements IGitHubServer {
|
||||||
this._uriHandler.handleUri(vscode.Uri.parse(uri.trim()));
|
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);
|
return getUserInfo(token, this.getServerUri('/user'), this._logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,7 +406,7 @@ export class GitHubServer implements IGitHubServer {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (result.ok) {
|
if (result.ok) {
|
||||||
const json: { student: boolean, faculty: boolean } = await result.json();
|
const json: { student: boolean; faculty: boolean } = await result.json();
|
||||||
|
|
||||||
/* __GDPR__
|
/* __GDPR__
|
||||||
"session" : {
|
"session" : {
|
||||||
|
@ -440,7 +440,7 @@ export class GitHubServer implements IGitHubServer {
|
||||||
return;
|
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__
|
/* __GDPR__
|
||||||
"ghe-session" : {
|
"ghe-session" : {
|
||||||
|
@ -504,7 +504,7 @@ export class GitHubEnterpriseServer implements IGitHubServer {
|
||||||
return vscode.Uri.parse(`${apiUri.scheme}://${apiUri.authority}/api/v3${path}`);
|
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);
|
return getUserInfo(token, this.getServerUri('/user'), this._logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -522,7 +522,7 @@ export class GitHubEnterpriseServer implements IGitHubServer {
|
||||||
return;
|
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__
|
/* __GDPR__
|
||||||
"ghe-session" : {
|
"ghe-session" : {
|
||||||
|
|
|
@ -50,7 +50,7 @@ export async function publishRepository(gitAPI: GitAPI, repository?: Repository)
|
||||||
folder = pick.folder.uri;
|
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.ignoreFocusOut = true;
|
||||||
|
|
||||||
quickpick.placeholder = 'Repository Name';
|
quickpick.placeholder = 'Repository Name';
|
||||||
|
|
|
@ -41,7 +41,7 @@ async function handlePushError(repository: Repository, remote: Remote, refspec:
|
||||||
try {
|
try {
|
||||||
if (isInCodespaces()) {
|
if (isInCodespaces()) {
|
||||||
// Call into the codespaces extension to fork the repository
|
// 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) {
|
if (!resp) {
|
||||||
throw new Error('Unable to fork respository');
|
throw new Error('Unable to fork respository');
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { RemoteSourceProvider, RemoteSource } from './typings/git-base';
|
||||||
import { getOctokit } from './auth';
|
import { getOctokit } from './auth';
|
||||||
import { Octokit } from '@octokit/rest';
|
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)
|
const match = /^https:\/\/github\.com\/([^/]+)\/([^/]+)\.git/i.exec(url)
|
||||||
|| /^git@github\.com:([^/]+)\/([^/]+)\.git/i.exec(url);
|
|| /^git@github\.com:([^/]+)\/([^/]+)\.git/i.exec(url);
|
||||||
return (match && { owner: match[1], repo: match[2] }) ?? undefined;
|
return (match && { owner: match[1], repo: match[2] }) ?? undefined;
|
||||||
|
|
|
@ -12,7 +12,7 @@ declare const Worker: {
|
||||||
new(stringUrl: string): any;
|
new(stringUrl: string): any;
|
||||||
};
|
};
|
||||||
declare const TextDecoder: {
|
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
|
// this method is called when vs code is activated
|
||||||
|
|
|
@ -75,12 +75,12 @@ export interface TelemetryReporter {
|
||||||
export type LanguageClientConstructor = (name: string, description: string, clientOptions: LanguageClientOptions) => CommonLanguageClient;
|
export type LanguageClientConstructor = (name: string, description: string, clientOptions: LanguageClientOptions) => CommonLanguageClient;
|
||||||
|
|
||||||
export interface Runtime {
|
export interface Runtime {
|
||||||
TextDecoder: { new(encoding?: string): { decode(buffer: ArrayBuffer): string; } };
|
TextDecoder: { new(encoding?: string): { decode(buffer: ArrayBuffer): string } };
|
||||||
fileFs?: FileSystemProvider;
|
fileFs?: FileSystemProvider;
|
||||||
telemetry?: TelemetryReporter;
|
telemetry?: TelemetryReporter;
|
||||||
readonly timer: {
|
readonly timer: {
|
||||||
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable;
|
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function startClient(context: ExtensionContext, newLanguageClient: LanguageClientConstructor, runtime: Runtime) {
|
export function startClient(context: ExtensionContext, newLanguageClient: LanguageClientConstructor, runtime: Runtime) {
|
||||||
|
|
|
@ -71,7 +71,7 @@ export interface RuntimeEnvironment {
|
||||||
readonly timer: {
|
readonly timer: {
|
||||||
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable;
|
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable;
|
||||||
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable;
|
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ export interface LanguageModelCache<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getLanguageModelCache<T>(maxEntries: number, cleanupIntervalTimeInSec: number, parse: (document: TextDocument) => T): 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 nModels = 0;
|
||||||
|
|
||||||
let cleanupInterval: NodeJS.Timer | undefined = undefined;
|
let cleanupInterval: NodeJS.Timer | undefined = undefined;
|
||||||
|
|
|
@ -20,7 +20,7 @@ export interface HTMLDocumentRegions {
|
||||||
|
|
||||||
export const CSS_STYLE_RULE = '__';
|
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 {
|
export function getDocumentRegions(languageService: LanguageService, document: TextDocument): HTMLDocumentRegions {
|
||||||
|
|
|
@ -362,7 +362,7 @@ export function getJavaScriptMode(documentRegions: LanguageModelCache<HTMLDocume
|
||||||
const jsLanguageService = await host.getLanguageService(jsDocument);
|
const jsLanguageService = await host.getLanguageService(jsDocument);
|
||||||
return getSemanticTokens(jsLanguageService, jsDocument, jsDocument.uri);
|
return getSemanticTokens(jsLanguageService, jsDocument, jsDocument.uri);
|
||||||
},
|
},
|
||||||
getSemanticTokenLegend(): { types: string[], modifiers: string[] } {
|
getSemanticTokenLegend(): { types: string[]; modifiers: string[] } {
|
||||||
return getSemanticTokenLegend();
|
return getSemanticTokenLegend();
|
||||||
},
|
},
|
||||||
dispose() {
|
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') {
|
if (typeof span.start === 'undefined') {
|
||||||
const pos = document.positionAt(0);
|
const pos = document.positionAt(0);
|
||||||
return Range.create(pos, pos);
|
return Range.create(pos, pos);
|
||||||
|
|
|
@ -77,7 +77,7 @@ export interface LanguageMode {
|
||||||
getFoldingRanges?: (document: TextDocument) => Promise<FoldingRange[]>;
|
getFoldingRanges?: (document: TextDocument) => Promise<FoldingRange[]>;
|
||||||
onDocumentRemoved(document: TextDocument): void;
|
onDocumentRemoved(document: TextDocument): void;
|
||||||
getSemanticTokens?(document: TextDocument): Promise<SemanticTokenData[]>;
|
getSemanticTokens?(document: TextDocument): Promise<SemanticTokenData[]>;
|
||||||
getSemanticTokenLegend?(): { types: string[], modifiers: string[] };
|
getSemanticTokenLegend?(): { types: string[]; modifiers: string[] };
|
||||||
dispose(): void;
|
dispose(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ export interface LanguageModeRange extends Range {
|
||||||
attributeValue?: boolean;
|
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 htmlLanguageService = getHTMLLanguageService({ clientCapabilities, fileSystemProvider: requestService });
|
||||||
const cssLanguageService = getCSSLanguageService({ clientCapabilities, fileSystemProvider: requestService });
|
const cssLanguageService = getCSSLanguageService({ clientCapabilities, fileSystemProvider: requestService });
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ export interface SemanticTokenProvider {
|
||||||
export function newSemanticTokenProvider(languageModes: LanguageModes): SemanticTokenProvider {
|
export function newSemanticTokenProvider(languageModes: LanguageModes): SemanticTokenProvider {
|
||||||
|
|
||||||
// combined legend across modes
|
// 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 } = {};
|
const legendMappings: { [modeId: string]: LegendMapping } = {};
|
||||||
|
|
||||||
for (let mode of languageModes.getAllModes()) {
|
for (let mode of languageModes.getAllModes()) {
|
||||||
|
|
|
@ -14,7 +14,7 @@ export interface ItemDescription {
|
||||||
documentation?: string;
|
documentation?: string;
|
||||||
kind?: CompletionItemKind;
|
kind?: CompletionItemKind;
|
||||||
resultText?: string;
|
resultText?: string;
|
||||||
command?: { title: string, command: string };
|
command?: { title: string; command: string };
|
||||||
notAvailable?: boolean;
|
notAvailable?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ export function assertCompletion(completions: CompletionList, expected: ItemDesc
|
||||||
|
|
||||||
const testUri = 'test://test/test.html';
|
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('|');
|
let offset = value.indexOf('|');
|
||||||
value = value.substr(0, offset) + value.substr(offset + 1);
|
value = value.substr(0, offset) + value.substr(offset + 1);
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import * as path from 'path';
|
||||||
suite('HTML Language Configuration', () => {
|
suite('HTML Language Configuration', () => {
|
||||||
const config = JSON.parse((fs.readFileSync(path.join(__dirname, '../../../../html/language-configuration.json')).toString()));
|
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') {
|
if (typeof str === 'string') {
|
||||||
return new RegExp(str, 'g');
|
return new RegExp(str, 'g');
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* 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;
|
let lineStart = offset;
|
||||||
while (lineStart > 0 && !isNewlineCharacter(text.charCodeAt(lineStart - 1))) {
|
while (lineStart > 0 && !isNewlineCharacter(text.charCodeAt(lineStart - 1))) {
|
||||||
lineStart--;
|
lineStart--;
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace ResultLimitReachedNotification {
|
||||||
interface Settings {
|
interface Settings {
|
||||||
json?: {
|
json?: {
|
||||||
schemas?: JSONSchemaSettings[];
|
schemas?: JSONSchemaSettings[];
|
||||||
format?: { enable: boolean; };
|
format?: { enable: boolean };
|
||||||
resultLimit?: number;
|
resultLimit?: number;
|
||||||
};
|
};
|
||||||
http?: {
|
http?: {
|
||||||
|
@ -96,7 +96,7 @@ export type LanguageClientConstructor = (name: string, description: string, clie
|
||||||
|
|
||||||
export interface Runtime {
|
export interface Runtime {
|
||||||
schemaRequests: SchemaRequestService;
|
schemaRequests: SchemaRequestService;
|
||||||
telemetry?: TelemetryReporter
|
telemetry?: TelemetryReporter;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SchemaRequestService {
|
export interface SchemaRequestService {
|
||||||
|
|
|
@ -56,12 +56,12 @@ export interface RequestService {
|
||||||
|
|
||||||
export interface RuntimeEnvironment {
|
export interface RuntimeEnvironment {
|
||||||
file?: RequestService;
|
file?: RequestService;
|
||||||
http?: RequestService
|
http?: RequestService;
|
||||||
configureHttpRequests?(proxy: string, strictSSL: boolean): void;
|
configureHttpRequests?(proxy: string, strictSSL: boolean): void;
|
||||||
readonly timer: {
|
readonly timer: {
|
||||||
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable;
|
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable;
|
||||||
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable;
|
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): Disposable;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function startServer(connection: Connection, runtime: RuntimeEnvironment) {
|
export function startServer(connection: Connection, runtime: RuntimeEnvironment) {
|
||||||
|
@ -168,7 +168,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
|
||||||
interface Settings {
|
interface Settings {
|
||||||
json: {
|
json: {
|
||||||
schemas: JSONSchemaSettings[];
|
schemas: JSONSchemaSettings[];
|
||||||
format: { enable: boolean; };
|
format: { enable: boolean };
|
||||||
resultLimit?: number;
|
resultLimit?: number;
|
||||||
};
|
};
|
||||||
http: {
|
http: {
|
||||||
|
@ -185,7 +185,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
|
||||||
|
|
||||||
|
|
||||||
const limitExceededWarnings = function () {
|
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 showLimitedNotification = (uri: string, resultLimit: number) => {
|
||||||
const warning = pendingWarnings[uri];
|
const warning = pendingWarnings[uri];
|
||||||
|
@ -358,7 +358,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
|
||||||
connection.sendDiagnostics({ uri: event.document.uri, diagnostics: [] });
|
connection.sendDiagnostics({ uri: event.document.uri, diagnostics: [] });
|
||||||
});
|
});
|
||||||
|
|
||||||
const pendingValidationRequests: { [uri: string]: Disposable; } = {};
|
const pendingValidationRequests: { [uri: string]: Disposable } = {};
|
||||||
const validationDelayMs = 300;
|
const validationDelayMs = 300;
|
||||||
|
|
||||||
function cleanPendingValidation(textDocument: TextDocument): void {
|
function cleanPendingValidation(textDocument: TextDocument): void {
|
||||||
|
|
|
@ -12,7 +12,7 @@ export interface LanguageModelCache<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getLanguageModelCache<T>(maxEntries: number, cleanupIntervalTimeInSec: number, parse: (document: TextDocument) => T): 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 nModels = 0;
|
||||||
|
|
||||||
let cleanupInterval: NodeJS.Timer | undefined = undefined;
|
let cleanupInterval: NodeJS.Timer | undefined = undefined;
|
||||||
|
|
|
@ -53,7 +53,7 @@ const getCodeLineElements = (() => {
|
||||||
* If an exact match, returns a single element. If the line is between elements,
|
* 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.
|
* 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 lineNumber = Math.floor(targetLine);
|
||||||
const lines = getCodeLineElements(documentVersion);
|
const lines = getCodeLineElements(documentVersion);
|
||||||
let previous = lines[0] || null;
|
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.
|
* 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 lines = getCodeLineElements(documentVersion);
|
||||||
const position = offset - window.scrollY;
|
const position = offset - window.scrollY;
|
||||||
let lo = -1;
|
let lo = -1;
|
||||||
|
@ -98,7 +98,7 @@ export function getLineElementsAtPageOffset(offset: number, documentVersion: num
|
||||||
return { previous: hiElement };
|
return { previous: hiElement };
|
||||||
}
|
}
|
||||||
|
|
||||||
function getElementBounds({ element }: CodeLineElement): { top: number, height: number } {
|
function getElementBounds({ element }: CodeLineElement): { top: number; height: number } {
|
||||||
const myBounds = element.getBoundingClientRect();
|
const myBounds = element.getBoundingClientRect();
|
||||||
|
|
||||||
// Some code line elements may contain other code line elements.
|
// Some code line elements may contain other code line elements.
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
export interface PreviewSettings {
|
export interface PreviewSettings {
|
||||||
readonly source: string;
|
readonly source: string;
|
||||||
readonly line?: number;
|
readonly line?: number;
|
||||||
readonly fragment?: string
|
readonly fragment?: string;
|
||||||
readonly lineCount: number;
|
readonly lineCount: number;
|
||||||
readonly scrollPreviewWithEditor?: boolean;
|
readonly scrollPreviewWithEditor?: boolean;
|
||||||
readonly scrollEditorWithPreview: boolean;
|
readonly scrollEditorWithPreview: boolean;
|
||||||
|
|
|
@ -15,7 +15,7 @@ const localize = nls.loadMessageBundle();
|
||||||
function parseLink(
|
function parseLink(
|
||||||
document: vscode.TextDocument,
|
document: vscode.TextDocument,
|
||||||
link: string,
|
link: string,
|
||||||
): { uri: vscode.Uri, tooltip?: string } | undefined {
|
): { uri: vscode.Uri; tooltip?: string } | undefined {
|
||||||
|
|
||||||
const cleanLink = stripAngleBrackets(link);
|
const cleanLink = stripAngleBrackets(link);
|
||||||
const externalSchemeUri = getUriForLinkWithKnownExternalScheme(cleanLink);
|
const externalSchemeUri = getUriForLinkWithKnownExternalScheme(cleanLink);
|
||||||
|
@ -225,7 +225,7 @@ export default class LinkProvider implements vscode.DocumentLinkProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getDefinitions(text: string, document: vscode.TextDocument) {
|
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)) {
|
for (const match of text.matchAll(definitionPattern)) {
|
||||||
const pre = match[1];
|
const pre = match[1];
|
||||||
const reference = match[2];
|
const reference = match[2];
|
||||||
|
|
|
@ -38,7 +38,7 @@ export default class MarkdownFoldingProvider implements vscode.FoldingRangeProvi
|
||||||
const regionMarkers = tokens.filter(isRegionMarker)
|
const regionMarkers = tokens.filter(isRegionMarker)
|
||||||
.map(token => ({ line: token.map[0], isStart: isStartRegion(token.content) }));
|
.map(token => ({ line: token.map[0], isStart: isStartRegion(token.content) }));
|
||||||
|
|
||||||
const nestingStack: { line: number, isStart: boolean }[] = [];
|
const nestingStack: { line: number; isStart: boolean }[] = [];
|
||||||
return regionMarkers
|
return regionMarkers
|
||||||
.map(marker => {
|
.map(marker => {
|
||||||
if (marker.isStart) {
|
if (marker.isStart) {
|
||||||
|
|
|
@ -60,7 +60,7 @@ interface CompletionContext {
|
||||||
/**
|
/**
|
||||||
* Info if the link looks like it is for an anchor: `[](#header)`
|
* Info if the link looks like it is for an anchor: `[](#header)`
|
||||||
*/
|
*/
|
||||||
readonly anchorInfo?: AnchorContext
|
readonly anchorInfo?: AnchorContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class PathCompletionProvider implements vscode.CompletionItemProvider {
|
export class PathCompletionProvider implements vscode.CompletionItemProvider {
|
||||||
|
|
|
@ -26,7 +26,7 @@ interface WebviewMessage {
|
||||||
|
|
||||||
interface CacheImageSizesMessage extends WebviewMessage {
|
interface CacheImageSizesMessage extends WebviewMessage {
|
||||||
readonly type: 'cacheImageSizes';
|
readonly type: 'cacheImageSizes';
|
||||||
readonly body: { id: string, width: number, height: number; }[];
|
readonly body: { id: string; width: number; height: number }[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RevealLineMessage extends WebviewMessage {
|
interface RevealLineMessage extends WebviewMessage {
|
||||||
|
@ -79,7 +79,7 @@ export class PreviewDocumentVersion {
|
||||||
|
|
||||||
interface MarkdownPreviewDelegate {
|
interface MarkdownPreviewDelegate {
|
||||||
getTitle?(resource: vscode.Uri): string;
|
getTitle?(resource: vscode.Uri): string;
|
||||||
getAdditionalState(): {},
|
getAdditionalState(): {};
|
||||||
openPreviewLinkToMarkdownFile(markdownLink: vscode.Uri, fragment: string): void;
|
openPreviewLinkToMarkdownFile(markdownLink: vscode.Uri, fragment: string): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
|
||||||
private currentVersion?: PreviewDocumentVersion;
|
private currentVersion?: PreviewDocumentVersion;
|
||||||
private isScrolling = false;
|
private isScrolling = false;
|
||||||
private _disposed: boolean = 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 _fileWatchersBySrc = new Map</* src: */ string, vscode.FileSystemWatcher>();
|
||||||
private readonly _unwatchedImageSchemes = new Set(['https', 'http', 'data']);
|
private readonly _unwatchedImageSchemes = new Set(['https', 'http', 'data']);
|
||||||
|
|
|
@ -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 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 sortedHeaders = enclosingHeaders.sort((header1, header2) => (header1.line - position.line) - (header2.line - position.line));
|
||||||
const onThisLine = toc.find(header => header.line === position.line) !== undefined;
|
const onThisLine = toc.find(header => header.line === position.line) !== undefined;
|
||||||
|
|
|
@ -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 readonly onDidChanged = this._onChanged.event;
|
||||||
|
|
||||||
public setPreviousStaticEditorLine(scrollLocation: LastScrollLocation): void {
|
public setPreviousStaticEditorLine(scrollLocation: LastScrollLocation): void {
|
||||||
|
|
|
@ -23,7 +23,7 @@ export default class MergeConflictContentProvider implements vscode.TextDocument
|
||||||
|
|
||||||
async provideTextDocumentContent(uri: vscode.Uri): Promise<string | null> {
|
async provideTextDocumentContent(uri: vscode.Uri): Promise<string | null> {
|
||||||
try {
|
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
|
// complete diff
|
||||||
const document = await vscode.workspace.openTextDocument(uri.with({ scheme, query: '' }));
|
const document = await vscode.workspace.openTextDocument(uri.with({ scheme, query: '' }));
|
||||||
|
|
|
@ -32,7 +32,7 @@ export class DocumentMergeConflict implements interfaces.IDocumentMergeConflict
|
||||||
return editor.edit((edit) => this.applyEdit(type, editor.document, edit));
|
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
|
// Each conflict is a set of ranges as follows, note placements or newlines
|
||||||
// which may not in spans
|
// 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)) {
|
if (this.isNewlineOnly(content)) {
|
||||||
edit.replace(this.range, '');
|
edit.replace(this.range, '');
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -25,7 +25,7 @@ export interface IExtensionConfiguration {
|
||||||
|
|
||||||
export interface IDocumentMergeConflict extends IDocumentMergeConflictDescriptor {
|
export interface IDocumentMergeConflict extends IDocumentMergeConflictDescriptor {
|
||||||
commitEdit(type: CommitType, editor: vscode.TextEditor, edit?: vscode.TextEditorEdit): Thenable<boolean>;
|
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 {
|
export interface IDocumentMergeConflictDescriptor {
|
||||||
|
|
|
@ -58,9 +58,9 @@ interface IStoredSession {
|
||||||
scope: string; // Scopes are alphabetized and joined with a space
|
scope: string; // Scopes are alphabetized and joined with a space
|
||||||
account: {
|
account: {
|
||||||
label?: string;
|
label?: string;
|
||||||
displayName?: string,
|
displayName?: string;
|
||||||
id: string
|
id: string;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ITokenResponse {
|
export interface ITokenResponse {
|
||||||
|
@ -79,11 +79,11 @@ export interface IMicrosoftTokens {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IScopeData {
|
interface IScopeData {
|
||||||
scopes: string[],
|
scopes: string[];
|
||||||
scopeStr: string,
|
scopeStr: string;
|
||||||
scopesToSend: string,
|
scopesToSend: string;
|
||||||
clientId: string,
|
clientId: string;
|
||||||
tenant: string
|
tenant: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseQuery(uri: vscode.Uri) {
|
function parseQuery(uri: vscode.Uri) {
|
||||||
|
|
|
@ -101,11 +101,11 @@ async function callback(nonce: string, reqUrl: url.Url): Promise<string> {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createServer(nonce: 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>;
|
let deferredRedirect: Deferred<RedirectResult>;
|
||||||
const redirectPromise = new Promise<RedirectResult>((resolve, reject) => deferredRedirect = { resolve, reject });
|
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>;
|
let deferredCode: Deferred<CodeResult>;
|
||||||
const codePromise = new Promise<CodeResult>((resolve, reject) => deferredCode = { resolve, reject });
|
const codePromise = new Promise<CodeResult>((resolve, reject) => deferredCode = { resolve, reject });
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { Event, EventEmitter, ExtensionContext, SecretStorage, SecretStorageChan
|
||||||
export interface IDidChangeInOtherWindowEvent<T> {
|
export interface IDidChangeInOtherWindowEvent<T> {
|
||||||
added: string[];
|
added: string[];
|
||||||
updated: string[];
|
updated: string[];
|
||||||
removed: Array<{ key: string, value: T; }>;
|
removed: Array<{ key: string; value: T }>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class BetterTokenStorage<T> {
|
export class BetterTokenStorage<T> {
|
||||||
|
@ -48,7 +48,7 @@ export class BetterTokenStorage<T> {
|
||||||
|
|
||||||
const keyList: Array<string> = JSON.parse(keyListStr);
|
const keyList: Array<string> = JSON.parse(keyListStr);
|
||||||
// Gather promises that contain key value pairs our of secret storage
|
// 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) => {
|
this._secretStorage.get(key).then((value) => {
|
||||||
res({ key, value });
|
res({ key, value });
|
||||||
}, rej);
|
}, rej);
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { AzureActiveDirectoryService, onDidChangeSessions } from './AADHelper';
|
||||||
import TelemetryReporter from '@vscode/extension-telemetry';
|
import TelemetryReporter from '@vscode/extension-telemetry';
|
||||||
|
|
||||||
export async function activate(context: vscode.ExtensionContext) {
|
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 telemetryReporter = new TelemetryReporter(name, version, aiKey);
|
||||||
|
|
||||||
const loginService = new AzureActiveDirectoryService(context);
|
const loginService = new AzureActiveDirectoryService(context);
|
||||||
|
|
|
@ -69,7 +69,7 @@ export class BowerJSONContribution implements IJSONContribution {
|
||||||
try {
|
try {
|
||||||
const obj = JSON.parse(success.responseText);
|
const obj = JSON.parse(success.responseText);
|
||||||
if (Array.isArray(obj)) {
|
if (Array.isArray(obj)) {
|
||||||
const results = <{ name: string; description: string; }[]>obj;
|
const results = <{ name: string; description: string }[]>obj;
|
||||||
for (const result of results) {
|
for (const result of results) {
|
||||||
const name = result.name;
|
const name = result.name;
|
||||||
const description = result.description || '';
|
const description = result.description || '';
|
||||||
|
|
|
@ -102,7 +102,7 @@ export class PackageJSONContribution implements IJSONContribution {
|
||||||
try {
|
try {
|
||||||
const obj = JSON.parse(success.responseText);
|
const obj = JSON.parse(success.responseText);
|
||||||
if (obj && obj.objects && Array.isArray(obj.objects)) {
|
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) {
|
for (const result of results) {
|
||||||
this.processPackage(result.package, addValue, isLast, collector);
|
this.processPackage(result.package, addValue, isLast, collector);
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ export class PackageJSONContribution implements IJSONContribution {
|
||||||
try {
|
try {
|
||||||
const obj = JSON.parse(success.responseText);
|
const obj = JSON.parse(success.responseText);
|
||||||
if (obj && Array.isArray(obj.objects)) {
|
if (obj && Array.isArray(obj.objects)) {
|
||||||
const objects = <{ package: SearchPackageInfo; }[]>obj.objects;
|
const objects = <{ package: SearchPackageInfo }[]>obj.objects;
|
||||||
for (let object of objects) {
|
for (let object of objects) {
|
||||||
this.processPackage(object.package, addValue, isLast, collector);
|
this.processPackage(object.package, addValue, isLast, collector);
|
||||||
}
|
}
|
||||||
|
@ -374,7 +374,7 @@ interface SearchPackageInfo {
|
||||||
name: string;
|
name: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
version?: string;
|
version?: string;
|
||||||
links?: { homepage?: string; };
|
links?: { homepage?: string };
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ViewPackageInfo {
|
interface ViewPackageInfo {
|
||||||
|
|
|
@ -56,7 +56,7 @@ async function isNPMPreferred(pkgPath: string): Promise<PreferredProperties> {
|
||||||
return { isPreferred: lockfileExists, hasLockfile: lockfileExists };
|
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 detectedPackageManagerNames: string[] = [];
|
||||||
const detectedPackageManagerProperties: PreferredProperties[] = [];
|
const detectedPackageManagerProperties: PreferredProperties[] = [];
|
||||||
|
|
||||||
|
|
|
@ -34,13 +34,13 @@ let cachedTasks: TaskWithLocation[] | undefined = undefined;
|
||||||
const INSTALL_SCRIPT = 'install';
|
const INSTALL_SCRIPT = 'install';
|
||||||
|
|
||||||
export interface TaskLocation {
|
export interface TaskLocation {
|
||||||
document: Uri,
|
document: Uri;
|
||||||
line: Position
|
line: Position;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TaskWithLocation {
|
export interface TaskWithLocation {
|
||||||
task: Task,
|
task: Task;
|
||||||
location?: Location
|
location?: Location;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NpmTaskProvider implements TaskProvider {
|
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 {
|
export function findScriptAtPosition(document: TextDocument, buffer: string, position: Position): string | undefined {
|
||||||
const read = readScripts(document, buffer);
|
const read = readScripts(document, buffer);
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
|
|
||||||
// file generated from PHP53Schema.xml using php-exclude_generate_php_globals.js
|
// file generated from PHP53Schema.xml using php-exclude_generate_php_globals.js
|
||||||
|
|
||||||
export interface IEntry { description?: string; signature?: string; }
|
export interface IEntry { description?: string; signature?: string }
|
||||||
export interface IEntries { [name: string]: IEntry; }
|
export interface IEntries { [name: string]: IEntry }
|
||||||
|
|
||||||
export const globalvariables: IEntries = {
|
export const globalvariables: IEntries = {
|
||||||
$GLOBALS: {
|
$GLOBALS: {
|
||||||
|
|
|
@ -13,7 +13,7 @@ const SEARCH_RESULT_SELECTOR = { language: 'search-result', exclusive: true };
|
||||||
const DIRECTIVES = ['# Query:', '# Flags:', '# Including:', '# Excluding:', '# ContextLines:'];
|
const DIRECTIVES = ['# Query:', '# Flags:', '# Including:', '# Excluding:', '# ContextLines:'];
|
||||||
const FLAGS = ['RegExp', 'CaseSensitive', 'IgnoreExcludeSettings', 'WordMatch'];
|
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;
|
let documentChangeListener: vscode.Disposable | undefined;
|
||||||
|
|
||||||
|
|
||||||
|
@ -174,8 +174,8 @@ function relativePathToUri(path: string, resultsUri: vscode.Uri): vscode.Uri | u
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
type ParsedSearchFileLine = { type: 'file', location: vscode.LocationLink, allLocations: vscode.LocationLink[], path: string };
|
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 ParsedSearchResultLine = { type: 'result'; locations: Required<vscode.LocationLink>[]; isContext: boolean; prefixRange: vscode.Range };
|
||||||
type ParsedSearchResults = Array<ParsedSearchFileLine | ParsedSearchResultLine>;
|
type ParsedSearchResults = Array<ParsedSearchFileLine | ParsedSearchResultLine>;
|
||||||
const isFileLine = (line: ParsedSearchResultLine | ParsedSearchFileLine): line is ParsedSearchFileLine => line.type === 'file';
|
const isFileLine = (line: ParsedSearchResultLine | ParsedSearchFileLine): line is ParsedSearchFileLine => line.type === 'file';
|
||||||
const isResultLine = (line: ParsedSearchResultLine | ParsedSearchFileLine): line is ParsedSearchResultLine => line.type === 'result';
|
const isResultLine = (line: ParsedSearchResultLine | ParsedSearchFileLine): line is ParsedSearchResultLine => line.type === 'result';
|
||||||
|
|
|
@ -59,8 +59,8 @@ export function activate(context: vscode.ExtensionContext) {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
context.subscriptions.push(vscode.commands.registerCommand(openApiCommand, (url: vscode.Uri, showOptions?: {
|
context.subscriptions.push(vscode.commands.registerCommand(openApiCommand, (url: vscode.Uri, showOptions?: {
|
||||||
preserveFocus?: boolean,
|
preserveFocus?: boolean;
|
||||||
viewColumn: vscode.ViewColumn,
|
viewColumn: vscode.ViewColumn;
|
||||||
}) => {
|
}) => {
|
||||||
manager.show(url.toString(), showOptions);
|
manager.show(url.toString(), showOptions);
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -38,12 +38,12 @@ interface CompletionContext {
|
||||||
readonly dotAccessorContext?: DotAccessorContext;
|
readonly dotAccessorContext?: DotAccessorContext;
|
||||||
|
|
||||||
readonly enableCallCompletions: boolean;
|
readonly enableCallCompletions: boolean;
|
||||||
readonly useCodeSnippetsOnMethodSuggest: boolean,
|
readonly useCodeSnippetsOnMethodSuggest: boolean;
|
||||||
|
|
||||||
readonly wordRange: vscode.Range | undefined;
|
readonly wordRange: vscode.Range | undefined;
|
||||||
readonly line: string;
|
readonly line: string;
|
||||||
|
|
||||||
readonly useFuzzyWordRangeLogic: boolean,
|
readonly useFuzzyWordRangeLogic: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
type ResolvedCompletionItem = {
|
type ResolvedCompletionItem = {
|
||||||
|
@ -299,7 +299,7 @@ class MyCompletionItem extends vscode.CompletionItem {
|
||||||
private getCodeActions(
|
private getCodeActions(
|
||||||
detail: Proto.CompletionEntryDetails,
|
detail: Proto.CompletionEntryDetails,
|
||||||
filepath: string
|
filepath: string
|
||||||
): { command?: vscode.Command, additionalTextEdits?: vscode.TextEdit[] } {
|
): { command?: vscode.Command; additionalTextEdits?: vscode.TextEdit[] } {
|
||||||
if (!detail.codeActions || !detail.codeActions.length) {
|
if (!detail.codeActions || !detail.codeActions.length) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
|
@ -370,7 +370,7 @@ const fixAllErrorCodes = new Map<number, number>([
|
||||||
[2345, 2339],
|
[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.annotateWithTypeFromJSDoc, { priority: 2 }],
|
||||||
[fixNames.constructorForDerivedNeedSuperCall, { priority: 2 }],
|
[fixNames.constructorForDerivedNeedSuperCall, { priority: 2 }],
|
||||||
[fixNames.extendsInterfaceBecomesImplements, { priority: 2 }],
|
[fixNames.extendsInterfaceBecomesImplements, { priority: 2 }],
|
||||||
|
|
|
@ -22,7 +22,7 @@ const localize = nls.loadMessageBundle();
|
||||||
|
|
||||||
|
|
||||||
interface DidApplyRefactoringCommand_Args {
|
interface DidApplyRefactoringCommand_Args {
|
||||||
readonly codeAction: InlinedCodeAction
|
readonly codeAction: InlinedCodeAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
class DidApplyRefactoringCommand implements Command {
|
class DidApplyRefactoringCommand implements Command {
|
||||||
|
|
|
@ -132,7 +132,7 @@ export default class LanguageProvider extends Disposable {
|
||||||
this.client.bufferSyncSupport.requestAllDiagnostics();
|
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)) {
|
if (diagnosticsKind !== DiagnosticKind.Syntax && !this.client.hasCapabilityForResource(file, ClientCapability.Semantic)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,14 +23,14 @@ export function createLazyClientHost(
|
||||||
context: vscode.ExtensionContext,
|
context: vscode.ExtensionContext,
|
||||||
onCaseInsensitiveFileSystem: boolean,
|
onCaseInsensitiveFileSystem: boolean,
|
||||||
services: {
|
services: {
|
||||||
pluginManager: PluginManager,
|
pluginManager: PluginManager;
|
||||||
commandManager: CommandManager,
|
commandManager: CommandManager;
|
||||||
logDirectoryProvider: ILogDirectoryProvider,
|
logDirectoryProvider: ILogDirectoryProvider;
|
||||||
cancellerFactory: OngoingRequestCancellerFactory,
|
cancellerFactory: OngoingRequestCancellerFactory;
|
||||||
versionProvider: ITypeScriptVersionProvider,
|
versionProvider: ITypeScriptVersionProvider;
|
||||||
processFactory: TsServerProcessFactory,
|
processFactory: TsServerProcessFactory;
|
||||||
activeJsTsEditorTracker: ActiveJsTsEditorTracker,
|
activeJsTsEditorTracker: ActiveJsTsEditorTracker;
|
||||||
serviceConfigurationProvider: ServiceConfigurationProvider,
|
serviceConfigurationProvider: ServiceConfigurationProvider;
|
||||||
},
|
},
|
||||||
onCompletionAccepted: (item: vscode.CompletionItem) => void,
|
onCompletionAccepted: (item: vscode.CompletionItem) => void,
|
||||||
): Lazy<TypeScriptServiceClientHost> {
|
): Lazy<TypeScriptServiceClientHost> {
|
||||||
|
|
|
@ -153,7 +153,7 @@ export function onChangedDocument(documentUri: vscode.Uri, disposables: vscode.D
|
||||||
|
|
||||||
export async function retryUntilDocumentChanges(
|
export async function retryUntilDocumentChanges(
|
||||||
documentUri: vscode.Uri,
|
documentUri: vscode.Uri,
|
||||||
options: { retries: number, timeout: number },
|
options: { retries: number; timeout: number },
|
||||||
disposables: vscode.Disposable[],
|
disposables: vscode.Disposable[],
|
||||||
exec: () => Thenable<unknown>,
|
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;
|
let resolve: (value: T) => void;
|
||||||
const promise = new Promise<T>(r => { resolve = r; });
|
const promise = new Promise<T>(r => { resolve = r; });
|
||||||
return { promise, resolve: resolve! };
|
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
|
* @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.
|
* 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;
|
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 request = this._requestQueue.createRequest(command, args);
|
||||||
const requestInfo: RequestItem = {
|
const requestInfo: RequestItem = {
|
||||||
request,
|
request,
|
||||||
|
@ -410,7 +410,7 @@ export class GetErrRoutingTsServer extends Disposable implements ITypeScriptServ
|
||||||
private readonly router: RequestRouter;
|
private readonly router: RequestRouter;
|
||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
servers: { getErr: ITypeScriptServer, primary: ITypeScriptServer },
|
servers: { getErr: ITypeScriptServer; primary: ITypeScriptServer },
|
||||||
delegate: TsServerDelegate,
|
delegate: TsServerDelegate,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
@ -463,7 +463,7 @@ export class GetErrRoutingTsServer extends Disposable implements ITypeScriptServ
|
||||||
this.mainServer.kill();
|
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);
|
return this.router.execute(command, args, executeInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -519,7 +519,7 @@ export class SyntaxRoutingTsServer extends Disposable implements ITypeScriptServ
|
||||||
private _projectLoading = true;
|
private _projectLoading = true;
|
||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
servers: { syntax: ITypeScriptServer, semantic: ITypeScriptServer },
|
servers: { syntax: ITypeScriptServer; semantic: ITypeScriptServer },
|
||||||
delegate: TsServerDelegate,
|
delegate: TsServerDelegate,
|
||||||
enableDynamicRouting: boolean,
|
enableDynamicRouting: boolean,
|
||||||
) {
|
) {
|
||||||
|
@ -603,7 +603,7 @@ export class SyntaxRoutingTsServer extends Disposable implements ITypeScriptServ
|
||||||
this.semanticServer.kill();
|
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);
|
return this.router.execute(command, args, executeInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,7 +186,7 @@ export class TypeScriptServerSpawner {
|
||||||
apiVersion: API,
|
apiVersion: API,
|
||||||
pluginManager: PluginManager,
|
pluginManager: PluginManager,
|
||||||
cancellationPipeName: string | undefined,
|
cancellationPipeName: string | undefined,
|
||||||
): { args: string[], tsServerLogFile: string | undefined, tsServerTraceDirectory: string | undefined } {
|
): { args: string[]; tsServerLogFile: string | undefined; tsServerTraceDirectory: string | undefined } {
|
||||||
const args: string[] = [];
|
const args: string[] = [];
|
||||||
let tsServerLogFile: string | undefined;
|
let tsServerLogFile: string | undefined;
|
||||||
let tsServerTraceDirectory: string | undefined;
|
let tsServerTraceDirectory: string | undefined;
|
||||||
|
|
|
@ -64,14 +64,14 @@ export default class TypeScriptServiceClientHost extends Disposable {
|
||||||
context: vscode.ExtensionContext,
|
context: vscode.ExtensionContext,
|
||||||
onCaseInsensitiveFileSystem: boolean,
|
onCaseInsensitiveFileSystem: boolean,
|
||||||
services: {
|
services: {
|
||||||
pluginManager: PluginManager,
|
pluginManager: PluginManager;
|
||||||
commandManager: CommandManager,
|
commandManager: CommandManager;
|
||||||
logDirectoryProvider: ILogDirectoryProvider,
|
logDirectoryProvider: ILogDirectoryProvider;
|
||||||
cancellerFactory: OngoingRequestCancellerFactory,
|
cancellerFactory: OngoingRequestCancellerFactory;
|
||||||
versionProvider: ITypeScriptVersionProvider,
|
versionProvider: ITypeScriptVersionProvider;
|
||||||
processFactory: TsServerProcessFactory,
|
processFactory: TsServerProcessFactory;
|
||||||
activeJsTsEditorTracker: ActiveJsTsEditorTracker,
|
activeJsTsEditorTracker: ActiveJsTsEditorTracker;
|
||||||
serviceConfigurationProvider: ServiceConfigurationProvider,
|
serviceConfigurationProvider: ServiceConfigurationProvider;
|
||||||
},
|
},
|
||||||
onCompletionAccepted: (item: vscode.CompletionItem) => void,
|
onCompletionAccepted: (item: vscode.CompletionItem) => void,
|
||||||
) {
|
) {
|
||||||
|
@ -268,11 +268,11 @@ export default class TypeScriptServiceClientHost extends Disposable {
|
||||||
private createMarkerDatas(
|
private createMarkerDatas(
|
||||||
diagnostics: Proto.Diagnostic[],
|
diagnostics: Proto.Diagnostic[],
|
||||||
source: string
|
source: string
|
||||||
): (vscode.Diagnostic & { reportUnnecessary: any, reportDeprecated: any })[] {
|
): (vscode.Diagnostic & { reportUnnecessary: any; reportDeprecated: any })[] {
|
||||||
return diagnostics.map(tsDiag => this.tsDiagnosticToVsDiagnostic(tsDiag, source));
|
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 { start, end, text } = diagnostic;
|
||||||
const range = new vscode.Range(typeConverters.Position.fromLocation(start), typeConverters.Position.fromLocation(end));
|
const range = new vscode.Range(typeConverters.Position.fromLocation(start), typeConverters.Position.fromLocation(end));
|
||||||
const converted = new vscode.Diagnostic(range, text, this.getDiagnosticSeverity(diagnostic));
|
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;
|
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.reportUnnecessary = diagnostic.reportsUnnecessary;
|
||||||
resultConverted.reportDeprecated = diagnostic.reportsDeprecated;
|
resultConverted.reportDeprecated = diagnostic.reportsDeprecated;
|
||||||
return resultConverted;
|
return resultConverted;
|
||||||
|
|
|
@ -150,7 +150,7 @@ export interface ITypeScriptServiceClient {
|
||||||
* @return The normalized path or `undefined` if the document is not open on the server.
|
* @return The normalized path or `undefined` if the document is not open on the server.
|
||||||
*/
|
*/
|
||||||
toOpenedFilePath(document: vscode.TextDocument, options?: {
|
toOpenedFilePath(document: vscode.TextDocument, options?: {
|
||||||
suppressAlertOnFailure?: boolean
|
suppressAlertOnFailure?: boolean;
|
||||||
}): string | undefined;
|
}): string | undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -160,7 +160,7 @@ export interface ITypeScriptServiceClient {
|
||||||
|
|
||||||
getWorkspaceRootForResource(resource: vscode.Uri): string | undefined;
|
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 onProjectLanguageServiceStateChanged: vscode.Event<Proto.ProjectLanguageServiceStateEventBody>;
|
||||||
readonly onDidBeginInstallTypings: vscode.Event<Proto.BeginInstallTypesEventBody>;
|
readonly onDidBeginInstallTypings: vscode.Event<Proto.BeginInstallTypesEventBody>;
|
||||||
readonly onDidEndInstallTypings: vscode.Event<Proto.EndInstallTypesEventBody>;
|
readonly onDidEndInstallTypings: vscode.Event<Proto.EndInstallTypesEventBody>;
|
||||||
|
|
|
@ -99,7 +99,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
||||||
|
|
||||||
private readonly workspaceState: vscode.Memento;
|
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 _configuration: TypeScriptServiceConfiguration;
|
||||||
private pluginPathsProvider: TypeScriptPluginPathsProvider;
|
private pluginPathsProvider: TypeScriptPluginPathsProvider;
|
||||||
private readonly _versionManager: TypeScriptVersionManager;
|
private readonly _versionManager: TypeScriptVersionManager;
|
||||||
|
@ -130,12 +130,12 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
||||||
private readonly context: vscode.ExtensionContext,
|
private readonly context: vscode.ExtensionContext,
|
||||||
onCaseInsenitiveFileSystem: boolean,
|
onCaseInsenitiveFileSystem: boolean,
|
||||||
services: {
|
services: {
|
||||||
pluginManager: PluginManager,
|
pluginManager: PluginManager;
|
||||||
logDirectoryProvider: ILogDirectoryProvider,
|
logDirectoryProvider: ILogDirectoryProvider;
|
||||||
cancellerFactory: OngoingRequestCancellerFactory,
|
cancellerFactory: OngoingRequestCancellerFactory;
|
||||||
versionProvider: ITypeScriptVersionProvider,
|
versionProvider: ITypeScriptVersionProvider;
|
||||||
processFactory: TsServerProcessFactory,
|
processFactory: TsServerProcessFactory;
|
||||||
serviceConfigurationProvider: ServiceConfigurationProvider,
|
serviceConfigurationProvider: ServiceConfigurationProvider;
|
||||||
},
|
},
|
||||||
allModeIds: readonly string[]
|
allModeIds: readonly string[]
|
||||||
) {
|
) {
|
||||||
|
@ -290,7 +290,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
||||||
this.serverState = this.startService(true);
|
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;
|
public readonly onTsServerStarted = this._onTsServerStarted.event;
|
||||||
|
|
||||||
private readonly _onDiagnosticsReceived = this._register(new vscode.EventEmitter<TsDiagnostics>());
|
private readonly _onDiagnosticsReceived = this._register(new vscode.EventEmitter<TsDiagnostics>());
|
||||||
|
@ -830,7 +830,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
||||||
})[0]!;
|
})[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);
|
this.bufferSyncSupport.beforeCommand(command);
|
||||||
const runningServerState = this.service();
|
const runningServerState = this.service();
|
||||||
return runningServerState.server.executeImpl(command, args, executeInfo);
|
return runningServerState.server.executeImpl(command, args, executeInfo);
|
||||||
|
@ -996,7 +996,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
||||||
function getReportIssueArgsForError(
|
function getReportIssueArgsForError(
|
||||||
error: TypeScriptServerError,
|
error: TypeScriptServerError,
|
||||||
logPath: string | undefined,
|
logPath: string | undefined,
|
||||||
): { extensionId: string, issueTitle: string, issueBody: string } | undefined {
|
): { extensionId: string; issueTitle: string; issueBody: string } | undefined {
|
||||||
if (!error.serverStack || !error.serverMessage) {
|
if (!error.serverStack || !error.serverMessage) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
@ -1063,7 +1063,7 @@ function getDignosticsKind(event: Proto.Event) {
|
||||||
|
|
||||||
class ServerInitializingIndicator extends Disposable {
|
class ServerInitializingIndicator extends Disposable {
|
||||||
|
|
||||||
private _task?: { project: string | undefined, resolve: () => void };
|
private _task?: { project: string | undefined; resolve: () => void };
|
||||||
|
|
||||||
public reset(): void {
|
public reset(): void {
|
||||||
if (this._task) {
|
if (this._task) {
|
||||||
|
|
|
@ -22,7 +22,7 @@ export interface LanguageDescription {
|
||||||
readonly languageIds: readonly string[];
|
readonly languageIds: readonly string[];
|
||||||
readonly configFilePattern?: RegExp;
|
readonly configFilePattern?: RegExp;
|
||||||
readonly isExternal?: boolean;
|
readonly isExternal?: boolean;
|
||||||
readonly standardFileExtensions: readonly string[],
|
readonly standardFileExtensions: readonly string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const standardLanguageDescriptions: LanguageDescription[] = [
|
export const standardLanguageDescriptions: LanguageDescription[] = [
|
||||||
|
|
|
@ -12,7 +12,7 @@ export interface TypeScriptServerPlugin {
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
readonly enableForWorkspaceTypeScriptVersions: boolean;
|
readonly enableForWorkspaceTypeScriptVersions: boolean;
|
||||||
readonly languages: ReadonlyArray<string>;
|
readonly languages: ReadonlyArray<string>;
|
||||||
readonly configNamespace?: string
|
readonly configNamespace?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace TypeScriptServerPlugin {
|
namespace TypeScriptServerPlugin {
|
||||||
|
@ -54,7 +54,7 @@ export class PluginManager extends Disposable {
|
||||||
private readonly _onDidUpdatePlugins = this._register(new vscode.EventEmitter<this>());
|
private readonly _onDidUpdatePlugins = this._register(new vscode.EventEmitter<this>());
|
||||||
public readonly onDidChangePlugins = this._onDidUpdatePlugins.event;
|
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 readonly onDidUpdateConfig = this._onDidUpdateConfig.event;
|
||||||
|
|
||||||
public setConfiguration(pluginId: string, config: {}) {
|
public setConfiguration(pluginId: string, config: {}) {
|
||||||
|
|
|
@ -130,7 +130,7 @@ function convertLinkTags(
|
||||||
|
|
||||||
const out: string[] = [];
|
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) {
|
for (const part of parts) {
|
||||||
switch (part.kind) {
|
switch (part.kind) {
|
||||||
case 'link':
|
case 'link':
|
||||||
|
|
|
@ -21,12 +21,12 @@ export class ResourceMap<T> {
|
||||||
return resource.toString(true);
|
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(
|
constructor(
|
||||||
protected readonly _normalizePath: (resource: vscode.Uri) => string | undefined = ResourceMap.defaultPathNormalizer,
|
protected readonly _normalizePath: (resource: vscode.Uri) => string | undefined = ResourceMap.defaultPathNormalizer,
|
||||||
protected readonly config: {
|
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);
|
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();
|
return this._map.values();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ import type * as Proto from '../protocol';
|
||||||
import * as PConst from '../protocol.const';
|
import * as PConst from '../protocol.const';
|
||||||
|
|
||||||
export function snippetForFunctionCall(
|
export function snippetForFunctionCall(
|
||||||
item: { insertText?: string | vscode.SnippetString; label: string; },
|
item: { insertText?: string | vscode.SnippetString; label: string },
|
||||||
displayParts: ReadonlyArray<Proto.SymbolDisplayPart>
|
displayParts: ReadonlyArray<Proto.SymbolDisplayPart>
|
||||||
): { snippet: vscode.SnippetString, parameterCount: number } {
|
): { snippet: vscode.SnippetString; parameterCount: number } {
|
||||||
if (item.insertText && typeof item.insertText !== 'string') {
|
if (item.insertText && typeof item.insertText !== 'string') {
|
||||||
return { snippet: item.insertText, parameterCount: 0 };
|
return { snippet: item.insertText, parameterCount: 0 };
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace Trace {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RequestExecutionMetadata {
|
interface RequestExecutionMetadata {
|
||||||
readonly queuingStartTime: number
|
readonly queuingStartTime: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class Tracer {
|
export default class Tracer {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue