diff --git a/Herebyfile.mjs b/Herebyfile.mjs index cd7a8c45fc9d4..61cadb60f0f3e 100644 --- a/Herebyfile.mjs +++ b/Herebyfile.mjs @@ -729,6 +729,18 @@ export const generateAPI = task({ run: runGenerateAPI, }); +async function runGenerateAPIDiff() { + await run("node", ["tools/scripts/gen/apiDiff.mts"]); +} + +export const generateAPIDiff = task({ + name: "generate:api-diff", + description: "Generates the API compatibility report.", + dependencies: [generateAST, generateAPI], + outputs: ["tsc/testdata/apiDiff.txt"], + run: runGenerateAPIDiff, +}); + const vendorJsonrpcDir = "packages/typescript/vendor/vscode-jsonrpc"; const vendorJsonrpcSrc = "node_modules/vscode-jsonrpc"; // Files copied verbatim from the installed vscode-jsonrpc package into the @@ -776,11 +788,12 @@ async function runGenerate() { }, runGenerateVendor, ], 4); + await runGenerateAPIDiff(); } export const generate = task({ name: "generate", - description: "Runs all code generation, including AST, LSP, APIs, extension localization, and vendored dependencies.", + description: "Runs all code generation, including AST, LSP, APIs, the API compatibility report, extension localization, and vendored dependencies.", run: runGenerate, }); diff --git a/tools/scripts/gen/apiDiff.mts b/tools/scripts/gen/apiDiff.mts new file mode 100644 index 0000000000000..7d9a7e985b281 --- /dev/null +++ b/tools/scripts/gen/apiDiff.mts @@ -0,0 +1,304 @@ +import fs from "node:fs"; +import path from "node:path"; +import ts from "typescript"; +import { repoRoot } from "./utils.mts"; + +const oldApiPath = path.join(repoRoot, "node_modules", "typescript", "lib", "typescript.d.ts"); +const newApiPackageDirectory = path.join(repoRoot, "packages", "typescript"); +const newApiEntryPoints = [ + "src/api/async/api.ts", + "src/api/fs.ts", + "src/api/proto.ts", + "src/ast/index.ts", + "src/ast/is.ts", + "src/ast/factory.generated.ts", + "src/ast/utils.ts", + "src/ast/scanner.ts", + "src/ast/visitor.ts", + "src/ast/clone.ts", +].map(file => path.join(newApiPackageDirectory, file)); +const outputPath = path.join(repoRoot, "tsc", "testdata", "apiDiff.txt"); +const typeMappings = new Map([ + ["TypeChecker", "Checker"], + ["BuilderProgram", "Program"], + ["Program", "Program"], + ["SolutionBuilder", "BuildOrchestrator"], + ["Project", "Project"], + ["LanguageService", "Project"], + ["Scanner", "Scanner"], + ["Printer", "Printer"], + ["Signature", "Signature"], + ["SourceFile", "SourceFile"], + ["Symbol", "Symbol"], + ["Type", ["Type", "ts"]], + ["Node", "Node"], + ["NodeFactory", "ts"], + ["ts", ["ts", "API"]], +]); + +const typescriptVersion = JSON.parse( + fs.readFileSync(path.join(repoRoot, "node_modules", "typescript", "package.json"), "utf8"), +).version as string; +const oldApiSourceFiles = [createSourceFile(oldApiPath)]; +const newApiProgram = createNewApiProgram(); +const newApiChecker = newApiProgram.getTypeChecker(); +const newApiExports = getEntryPointExports(newApiProgram, newApiChecker, newApiEntryPoints); + +const oldApiTypes = getTypesWithMethods(oldApiSourceFiles, visitOld); +oldApiTypes.set("ts", getNamespaceFunctions(oldApiSourceFiles, "ts")); + +const newApiTypes = getExportedTypesWithMethods(newApiExports); +newApiTypes.set("ts", [getExportedTopLevelFunctions(newApiExports, newApiChecker), new Set()]); + +const acceptedDiffs = getAcceptedDiffs(); + +const report: string[] = [ + "# This report is generated by tools/scripts/gen/apidiff.mts.", + `# Old API: TypeScript ${typescriptVersion} (node_modules/typescript/lib/typescript.d.ts)`, + "# New API: public package entry points", +]; + +const comparisons = [...typeMappings].map(([oldType, newTypes]) => { + const oldMethods = oldApiTypes.get(oldType)!; + const acceptedChanges = acceptedDiffs.get(oldType) ?? new Map(); + let missing: string[] = [...oldMethods.keys()]; + const present: string[] = []; + const newTypeArray = Array.isArray(newTypes) ? newTypes : [newTypes]; + for (const newType of newTypeArray) { + const currMissing: string[] = []; + const newMethods = newApiTypes.get(newType)!; + for (const method of missing) { + if (newMethods[0].has(method)) { + present.push(method); + newMethods[0].delete(method); + newMethods[1].add(method); + } + else if (newMethods[1].has(method)) { + present.push(method); + } + else if (acceptedChanges.has(method)) { + present.push(method); + const [newType, newMethodName] = acceptedChanges.get(method)!.split("."); + const actualNewType = newApiTypes.get(newType); + if (actualNewType) { + actualNewType[0].delete(newMethodName); + actualNewType[1].add(newMethodName); + } + } + else { + currMissing.push(method); + } + } + missing = currMissing; + } + return { + oldType, + newTypes, + present: present.sort(), + missing: missing.sort(), + }; +}); + +report.push( + `Types not compared:`, +); +for (const [type, _] of oldApiTypes) { + typeMappings.has(type) || report.push(`- ${type}`); +} +report.push( + "", +); + +for (const comparison of comparisons) { + const { oldType, newTypes, present, missing } = comparison; + const newType = Array.isArray(newTypes) ? newTypes.join(", ") : newTypes; + report.push( + "", + `# ${oldType} (old) methods compared to ${newType} (new).`, + `## (${present.length}) ${oldType} methods matched in async ${newType} ##`, + "", + `## ${oldType} methods missing from async ${newType} (${missing.length}) ##`, + ...missing, + "", + ); +} + +report.push("\n\n # New Methods in async API (temporarily reported for increased ease of matching)"); + +for (const [newType, newMethods] of newApiTypes) { + report.push( + `## New ${newType} methods in async API (${newMethods[0].size}) ##`, + ...newMethods[0], + "", + ); +} + +fs.writeFileSync(outputPath, report.join("\n")); + +function createSourceFile(file: string): ts.SourceFile { + return ts.createSourceFile( + file, + fs.readFileSync(file, "utf8"), + ts.ScriptTarget.Latest, + true, + ); +} + +function createNewApiProgram(): ts.Program { + const configPath = path.join(newApiPackageDirectory, "tsconfig.json"); + const configFile = ts.readConfigFile(configPath, ts.sys.readFile); + if (configFile.error) { + throw new Error(ts.flattenDiagnosticMessageText(configFile.error.messageText, "\n")); + } + const config = ts.parseJsonConfigFileContent(configFile.config, ts.sys, newApiPackageDirectory, { noEmit: true }, configPath); + if (config.errors.length > 0) { + throw new Error(config.errors.map(error => ts.flattenDiagnosticMessageText(error.messageText, "\n")).join("\n")); + } + return ts.createProgram({ + rootNames: config.fileNames, + options: config.options, + projectReferences: config.projectReferences, + }); +} + +type EntryPointExports = ReadonlyMap>; + +function getEntryPointExports(program: ts.Program, checker: ts.TypeChecker, entryPoints: readonly string[]): EntryPointExports { + const exports = new Map>(); + for (const entryPoint of entryPoints) { + const sourceFile = program.getSourceFile(entryPoint); + if (!sourceFile) throw new Error(`Could not find API entry point ${entryPoint}`); + const moduleSymbol = checker.getSymbolAtLocation(sourceFile); + if (!moduleSymbol) throw new Error(`Could not resolve API entry point ${entryPoint}`); + for (const exportedSymbol of checker.getExportsOfModule(moduleSymbol)) { + const symbols = exports.get(exportedSymbol.name) ?? new Set(); + symbols.add(resolveAlias(exportedSymbol, checker)); + exports.set(exportedSymbol.name, symbols); + } + } + return exports; +} + +function resolveAlias(symbol: ts.Symbol, checker: ts.TypeChecker): ts.Symbol { + return symbol.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(symbol) : symbol; +} + +function getTypesWithMethods(sourceFiles: readonly ts.SourceFile[], visitNode: (node: ts.Node, types: Map) => void): Map { + const types = new Map(); + for (const sourceFile of sourceFiles) { + visit(sourceFile); + } + return types; + + function visit(node: ts.Node): void { + visitNode(node, types); + ts.forEachChild(node, visit); + } +} + +function getAcceptedDiffs(): Map> { + const diffs = new Map>(); + const contents = fs.readFileSync(path.join(repoRoot, "tsc", "testdata", "apiAccepted.txt"), "utf-8").split("\n"); + contents.slice(2).forEach(line => { + const [oldMethod, newMethod, _] = line.split("|"); + const [oldType, oldMethodName] = oldMethod.split("."); + if (!diffs.has(oldType)) diffs.set(oldType, new Map()); + diffs.get(oldType)!.set(oldMethodName, newMethod); + }); + return diffs; +} + +function visitOld(node: ts.Node, types: Map>): void { + if ((ts.isClassDeclaration(node) || ts.isInterfaceDeclaration(node)) && node.name) { + const methods = types.get(node.name.text) ?? new Set(); + for (const member of node.members) { + if ( + (ts.isMethodDeclaration(member) || ts.isMethodSignature(member)) + && !hasModifier(member, ts.SyntaxKind.PrivateKeyword) + && !hasModifier(member, ts.SyntaxKind.ProtectedKeyword) + ) { + const name = getPropertyName(member.name); + if (name !== undefined) methods.add(name); + } + } + if (methods.size > 0) types.set(node.name.text, methods); + } +} + +function getExportedTypesWithMethods(exports: EntryPointExports): Map, seen: Set]> { + const types = new Map, seen: Set]>(); + for (const [exportName, symbols] of exports) { + const methods = new Set(); + for (const symbol of symbols) { + for (const declaration of symbol.declarations ?? []) { + if (ts.isClassDeclaration(declaration) || ts.isInterfaceDeclaration(declaration)) { + addPublicMethods(declaration.members, methods); + } + } + } + if (methods.size > 0) types.set(exportName, [methods, new Set()]); + } + return types; +} + +function addPublicMethods(members: ts.NodeArray, methods: Set): void { + for (const member of members) { + if ( + (ts.isMethodDeclaration(member) || ts.isMethodSignature(member)) + && !hasModifier(member, ts.SyntaxKind.PrivateKeyword) + && !hasModifier(member, ts.SyntaxKind.ProtectedKeyword) + ) { + const name = getPropertyName(member.name); + if (name !== undefined) methods.add(name); + } + } +} + +function getNamespaceFunctions(sourceFiles: readonly ts.SourceFile[], namespace: string): Set { + const functions = new Set(); + for (const sourceFile of sourceFiles) { + for (const statement of sourceFile.statements) { + if ( + ts.isModuleDeclaration(statement) + && statement.name.text === namespace + && statement.body + && ts.isModuleBlock(statement.body) + ) { + for (const member of statement.body.statements) { + if (ts.isFunctionDeclaration(member) && member.name) { + functions.add(member.name.text); + } + } + } + } + } + return functions; +} + +function getExportedTopLevelFunctions(exports: EntryPointExports, checker: ts.TypeChecker): Set { + const functions = new Set(); + for (const [exportName, symbols] of exports) { + for (const symbol of symbols) { + const declaration = symbol.valueDeclaration; + if ( + declaration + && checker.getTypeOfSymbolAtLocation(symbol, declaration).getCallSignatures().length > 0 + ) { + functions.add(exportName); + break; + } + } + } + return functions; +} + +function hasModifier(node: ts.Node, kind: ts.SyntaxKind): boolean { + return ts.canHaveModifiers(node) && ts.getModifiers(node)?.some(modifier => modifier.kind === kind) === true; +} + +function getPropertyName(name: ts.PropertyName): string | undefined { + if (ts.isIdentifier(name) || ts.isStringLiteral(name) || ts.isNumericLiteral(name)) { + return name.text; + } + return undefined; +} diff --git a/tsc/testdata/apiAccepted.txt b/tsc/testdata/apiAccepted.txt new file mode 100644 index 0000000000000..895dbc9f5b021 --- /dev/null +++ b/tsc/testdata/apiAccepted.txt @@ -0,0 +1,258 @@ +originalType.MethodName|newType.MethodName|reason (will be discarded in parsing) + +TypeChecker.tryGetMemberInModuleExports|Checker.getMemberInModuleExports|rename +TypeChecker.getAugmentedPropertiesOfType|| use `Type.getApparentProperties()` instead +Program.getTypeChecker|| removed +Program.getOptionsDiagnostics|| removed +Project.containsFile|| same as `Program` method +Project.getFileNames|| same as `Program` method +Project.getRootFiles||same as `Program` method +Project.hasRoots|| same as `Program` method +Project.isRoot|| same as `Program` method +Project.hasConfigFile|| same as `Program` method +Project.getSourceFile|| same as `Program` method +ts.parseCommandLine|API.parseCommandLine| +ts.parseJsonConfigFileContent|API.parseJsonConfigFileContent| +ts.readConfigFile|API.readConfigFile| +ts.parseJsonSourceFileConfigFileContent|API.parseConfigFile| +TypeChecker.runWithCancellationToken||Cancellation will be investigated at the client level, no longer tied to Checker +BuilderProgram.getAllDependencies||BuilderProgram deferred for redesign +BuilderProgram.getOptionsDiagnostics||BuilderProgram deferred for redesign +BuilderProgram.getProgram||BuilderProgram deferred for redesign +BuilderProgram.getSourceFiles||BuilderProgram deferred for redesign +SolutionBuilder.getNextInvalidatedProject||SolutionBuilder deferred for redesign +Project.addMissingFileRoot||Project is immutable; use file change and snapshot update APIs +Project.addRoot||Project is immutable; use file change and snapshot update APIs +Project.close|Snapshot.update|Use `closeProjects` as part of snapshot update +Project.containsScriptInfo||ScriptInfo does not exist +Project.directoryExists||Project no longer proxies methods from its host +Project.disableLanguageService||LanguageService is no longer a stateful object owned by a Project +Project.emitFile||Project no longer proxies methods from objects it owns +Project.enableLanguageService||LanguageService is no longer a stateful object owned by Project +Project.error||Utility method intended for internal use +Project.fileExists||Project no longer proxies methods from its host +Project.filesToString||Utility method intended for internal use +Project.getAllProjectErrors||Use Program APIs +Project.getCancellationToken||Cancellation will be investigated as a client-level feature +Project.getCompilationSettings||Project no longer proxies methods from objects it owns; use the Program API instead +Project.getCompileOnSaveAffectedFileList||Compile on save is no longer a built-in feature +Project.getCompilerOptions||Project no longer proxies methods from objects it owns; use the Program API instead +Project.getCurrentDirectory||Project no longer proxies methods from its host +Project.getDefaultLibFileName||Project no longer proxies methods from its host +Project.getDirectories||Project no longer proxies methods from its host +Project.getExcludedFiles||Utility method intended for internal use +Project.getExternalFiles||External files is no longer a concept +Project.getGlobalProjectErrors||Use Program APIs +Project.getLanguageService||LanguageService is no longer a stateful object owned by a Project; access Project.languageService instead +Project.getNewLine||Project no longer proxies methods from its host +Project.getProjectName|Project.id| +Project.getProjectReferences||Project no longer proxies methods from objects it owns; use the Program API instead +Project.getProjectVersion||Projects are immutable use `snapshot.id` and snapshot update results to track changes +Project.getRootScriptInfos||ScriptInfo does not exist +Project.getScriptFileNames||Project no longer proxies methods from objects it owns; use the Program API instead +Project.getScriptInfo||ScriptInfo does not exist +Project.getScriptInfoForNormalizedPath||ScriptInfo does not exist +Project.getScriptInfos||ScriptInfo does not exist +Project.getScriptKind||Project no longer proxies methods from its host +Project.getScriptSnapshot||Project no longer proxies methods from its host +Project.getScriptVersion||Project no longer proxies methods from its host +Project.installPackage||Project is immutable; ATA controlling is intended internal +Project.isClosed||Project is immutable +Project.isKnownTypesPackageName||Internal utility method +Project.isNonTsProject||Internal utility method +Project.log||Project no longer proxies methods from its host +Project.readDirectory||Project no longer proxies methods from its host +Project.readFile||Project no longer proxies methods from its host +Project.refreshDiagnostics||Project is immutable; use file change and snapshot update APIs +Project.registerFileUpdate||Project is immutable; use file change and snapshot update APIs +Project.removeFile||Project is immutable; use file change and snapshot update APIs +Project.resolveModule||Project no longer proxies methods from its owned objects +Project.setCompilerOptions||Project is immutable; use file change and snapshot update APIs +Project.setProjectErrors||Project is immutable; use file change and snapshot update APIs +Project.setTypeAcquisition||Project is immutable; use file change and snapshot update APIs +Project.updateGraph||Project is immutable; use file change and snapshot update APIs +Project.useCaseSensitiveFileNames||Project no longer proxies methods from its host +Project.writeFile||Project no longer proxies methods from its host +Scanner.getStartPos||Removal of deprecated alias; use `Scanner.getTokenFullStart()` +Scanner.getTextPos||Removal of deprecated alias; use `Scanner.getTokenEnd()` +Scanner.getTokenPos||Removal of deprecated alias; use `Scanner.getTokenStart()` +Scanner.setJSDocParsingMode||JSDoc parsing is no longer configurable to improve AST reuse between programs with different requirements +Scanner.setOnError||Scanner no longer reports errors; use `isUnterminated()` and flags to inspect state +Scanner.setScriptKind||Scanner behavior is no longer dependent on ScriptKind +Scanner.setScriptTarget||Scanner behavior is no longer dependent on ScriptTarget +Scanner.setTextPos||Removal of deprecated alias; use `Scanner.resetTokenState(pos)` +Printer.printBundle||outFile is not supported in TypeScript 7 +Signature.getDeclaration|Signature.declaration| +Signature.getDocumentationComment|Symbol.getDocumentationComment|Go through the signature’s declaration’s symbol +Signature.getJsDocTags||Go through the signature’s declaration’s symbol +SourceFile.update||Incremental parsing is not implemented in TypeScript 7 +Symbol.getDeclarations|Symbol.declarations| +Symbol.getEscapedName|Symbol.escapedName| +Symbol.getFlags|Symbol.flags| +Symbol.getName|Symbol.name| +Type.getConstraint|TypeParameter.getConstraint|Available as an async method on TypeParameter, not as a public Type property. Narrow with type.isTypeParameter() before calling; the old method returned undefined for non-type-parameters. See packages/typescript/src/api/async/types.ts. +Type.getDefault|TypeParameter.getDefault|Available as an async method on TypeParameter, not as a public Type property. Narrow with type.isTypeParameter() before calling; the old method returned undefined for non-type-parameters. See packages/typescript/src/api/async/types.ts. +Type.getFlags|Type.flags| +Type.isIntersection|Type.isIntersectionType| +Type.isLiteral|Type.isLiteralType| +Type.isNumberLiteral|Type.isNumberLiteralType| +Type.isUnion|Type.isUnionType| +NodeFactory.createAssertClause||AssertClause is removed in TypeScript 7 +NodeFactory.createAssertEntry||AssertEntry is removed in TypeScript 7 +NodeFactory.createBundle||outFile is removed in TypeScript 7 +NodeFactory.createCallSignature|ts.createCallSignatureDeclaration| +NodeFactory.createCommaListExpression||CommaListExpression is removed in TypeScript 7 +NodeFactory.createConstructSignature|ts.createConstructSignatureDeclaration| +NodeFactory.createImportTypeAssertionContainer||ImportTypeAssertionContainer is removed in TypeScript 7 +NodeFactory.createIndexSignature|ts.createIndexSignatureDeclaration| +NodeFactory.createJSDocAuthorTag||@author no longer has a bespoke kind; it is a JSDocUnknownTag with tagName author. Use ts.createJSDocUnknownTag for the generic representation. Removed intentionally in microsoft/typescript-go#34: https://github.com/microsoft/typescript-go/pull/34 +NodeFactory.createJSDocClassTag||@class/@constructor no longer have a bespoke kind; they are JSDocUnknownTag nodes, not class-declaration factories. Use ts.createJSDocUnknownTag for the generic representation. Removed intentionally in microsoft/typescript-go#34: https://github.com/microsoft/typescript-go/pull/34 +NodeFactory.createJSDocComment|ts.createJSDoc|Renamed to createJSDoc. Comment is now a readonly JSDocComment[] (required); use [] for no comment and [ts.createJSDocText(text)] for a plain string. See packages/typescript/src/ast/factory.generated.ts and ast.generated.ts. +NodeFactory.createJSDocEnumTag||@enum no longer has a bespoke kind or enum semantics; it is a JSDocUnknownTag, with any type text left in the comment. Use ts.createJSDocUnknownTag for the generic representation. Removed intentionally in microsoft/typescript-go#34: https://github.com/microsoft/typescript-go/pull/34 +NodeFactory.createJSDocFunctionType||JSDocFunctionType and Closure-style function(...) type syntax are not supported; this is not a rename to FunctionTypeNode. TypeScript-style function types use the ordinary function-type factories. Intentional removal: https://github.com/microsoft/typescript-go/pull/408 +NodeFactory.createJSDocMemberName|ts.createQualifiedName|The separate JSDocMemberName kind was removed. Class#member link names are represented by QualifiedName, just like dotted names; parseJSDocLinkName constructs QualifiedName for both. The AST no longer distinguishes the # separator. See tsc/internal/parser/jsdoc.go:742-760. +NodeFactory.createJSDocNamepathType||JSDocNamepathType and its Closure namepath syntax were intentionally dropped, not renamed. No dedicated AST kind remains. See usage analysis in https://github.com/microsoft/typescript-go/pull/34 +NodeFactory.createJSDocUnknownType||The standalone JSDoc ? type and JSDocUnknownType kind were intentionally dropped; this is not the TypeScript unknown keyword or a rename to createKeywordTypeNode. See usage analysis in https://github.com/microsoft/typescript-go/pull/34 +NodeFactory.createJsxJsxClosingFragment|ts.createJsxClosingFragment| +NodeFactory.createLoopVariable||The factory is stateless; generated-name and source/emit metadata behavior is not supported. +NodeFactory.createMethodSignature|ts.createMethodSignatureDeclaration|Renamed to createMethodSignatureDeclaration. Export verified in packages/typescript/src/ast/factory.generated.ts; use the current signature (including postfix-token/type parameters as applicable). +NodeFactory.createParenthesizedType|ts.createParenthesizedTypeNode|Renamed to createParenthesizedTypeNode. Export and corresponding type-node shape verified in packages/typescript/src/ast/factory.generated.ts. +NodeFactory.createPropertySignature|ts.createPropertySignatureDeclaration|Renamed to createPropertySignatureDeclaration. Export verified in packages/typescript/src/ast/factory.generated.ts; use the current signature (including postfix-token/type parameters as applicable). +NodeFactory.createStringLiteralFromNode||The factory is stateless; generated-name and source/emit metadata behavior is not supported. +NodeFactory.createTempVariable||The factory is stateless; generated-name and source/emit metadata behavior is not supported. +NodeFactory.createTemplateLiteralType|ts.createTemplateLiteralTypeNode|Renamed to createTemplateLiteralTypeNode. Export and corresponding type-node shape verified in packages/typescript/src/ast/factory.generated.ts. +NodeFactory.createUniqueName||The factory is stateless; generated-name and source/emit metadata behavior is not supported. +NodeFactory.createUniquePrivateName||The factory is stateless; generated-name and source/emit metadata behavior is not supported. +NodeFactory.getGeneratedNameForNode||The factory is stateless; generated-name and source/emit metadata behavior is not supported. +NodeFactory.getGeneratedPrivateNameForNode||The factory is stateless; generated-name and source/emit metadata behavior is not supported. +NodeFactory.updateAssertClause||AssertClause is removed in TypeScript 7; same classification as the corresponding create method. +NodeFactory.updateAssertEntry||AssertEntry is removed in TypeScript 7; same classification as the corresponding create method. +NodeFactory.updateBundle||outFile is removed in TypeScript 7; same classification as the corresponding create method. +NodeFactory.updateCallSignature|ts.updateCallSignatureDeclaration|Renamed to updateCallSignatureDeclaration. Export verified in packages/typescript/src/ast/factory.generated.ts; use the current signature (including postfix-token/type parameters as applicable). +NodeFactory.updateCommaListExpression||CommaListExpression is removed in TypeScript 7; same classification as the corresponding create method. +NodeFactory.updateConstructSignature|ts.updateConstructSignatureDeclaration|Renamed to updateConstructSignatureDeclaration. Export verified in packages/typescript/src/ast/factory.generated.ts; use the current signature (including postfix-token/type parameters as applicable). +NodeFactory.updateImportTypeAssertionContainer||ImportTypeAssertionContainer is removed in TypeScript 7; same classification as the corresponding create method. +NodeFactory.updateIndexSignature|ts.updateIndexSignatureDeclaration|Renamed to updateIndexSignatureDeclaration. Export verified in packages/typescript/src/ast/factory.generated.ts; use the current signature (including postfix-token/type parameters as applicable). +NodeFactory.updateJSDocAuthorTag||@author no longer has a bespoke kind; it is a JSDocUnknownTag with tagName author. Use ts.updateJSDocUnknownTag for the generic representation. Removed intentionally in microsoft/typescript-go#34: https://github.com/microsoft/typescript-go/pull/34 +NodeFactory.updateJSDocClassTag||@class/@constructor no longer have a bespoke kind; they are JSDocUnknownTag nodes, not class-declaration factories. Use ts.updateJSDocUnknownTag for the generic representation. Removed intentionally in microsoft/typescript-go#34: https://github.com/microsoft/typescript-go/pull/34 +NodeFactory.updateJSDocComment|ts.updateJSDoc|Renamed to updateJSDoc. Comment is now a readonly JSDocComment[] (required); use [] for no comment and [ts.createJSDocText(text)] for a plain string. See packages/typescript/src/ast/factory.generated.ts and ast.generated.ts. +NodeFactory.updateJSDocEnumTag||@enum no longer has a bespoke kind or enum semantics; it is a JSDocUnknownTag, with any type text left in the comment. Use ts.updateJSDocUnknownTag for the generic representation. Removed intentionally in microsoft/typescript-go#34: https://github.com/microsoft/typescript-go/pull/34 +NodeFactory.updateJSDocFunctionType||JSDocFunctionType and Closure-style function(...) type syntax are not supported; this is not a rename to FunctionTypeNode. TypeScript-style function types use the ordinary function-type factories. Intentional removal: https://github.com/microsoft/typescript-go/pull/408 +NodeFactory.updateJSDocMemberName|ts.updateQualifiedName|The separate JSDocMemberName kind was removed. Class#member link names are represented by QualifiedName, just like dotted names; parseJSDocLinkName constructs QualifiedName for both. The AST no longer distinguishes the # separator. See tsc/internal/parser/jsdoc.go:742-760. +NodeFactory.updateJSDocNamepathType||JSDocNamepathType and its Closure namepath syntax were intentionally dropped, not renamed. No dedicated AST kind remains. See usage analysis in https://github.com/microsoft/typescript-go/pull/34 +NodeFactory.updateMethodSignature|ts.updateMethodSignatureDeclaration|Renamed to updateMethodSignatureDeclaration. Export verified in packages/typescript/src/ast/factory.generated.ts; use the current signature (including postfix-token/type parameters as applicable). +NodeFactory.updateParenthesizedType|ts.updateParenthesizedTypeNode|Renamed to updateParenthesizedTypeNode. Export and corresponding type-node shape verified in packages/typescript/src/ast/factory.generated.ts. +NodeFactory.updatePropertySignature|ts.updatePropertySignatureDeclaration|Renamed to updatePropertySignatureDeclaration. Export verified in packages/typescript/src/ast/factory.generated.ts; use the current signature (including postfix-token/type parameters as applicable). +NodeFactory.updateTemplateLiteralType|ts.updateTemplateLiteralTypeNode|Renamed to updateTemplateLiteralTypeNode. Export and corresponding type-node shape verified in packages/typescript/src/ast/factory.generated.ts. +ts.bundlerModuleNameResolver||Use `api.createModuleResolver` +ts.classicNameResolver||Classic module resolution is removed from TypeScript 7 +ts.collapseTextChangeRangesAcrossMultipleVersions||Internal helper +ts.createAbstractBuilder||SolutionBuilder is deferred for redesign +ts.createBuilderStatusReporter||SolutionBuilder is deferred for redesign +ts.createClassifier||No equivalent in TypeScript 7 +ts.createCompilerHost||No longer needed to create a program or customize its behavior +ts.createDocumentRegistry||SourceFiles are automatically cached +ts.createEmitAndSemanticDiagnosticsBuilderProgram||SolutionBuilder is deferred for redesign +ts.createIncrementalCompilerHost||IncrementalProgram is deferred for redesign +ts.createIncrementalProgram||IncrementalProgram is deferred for redesign +ts.createLanguageService||Access a LanguageService from a Project +ts.createLanguageServiceSourceFile||No equivalent concept in TypeScript 7 +ts.createModuleResolutionCache||Module resolution is cached only in the scope of a single program build in TypeScript 7 +ts.createPrinter|API.printer| +ts.createSemanticDiagnosticsBuilderProgram||SolutionBuilder is deferred for redesign +ts.createSolutionBuilder||SolutionBuilder is deferred for redesign +ts.createSolutionBuilderHost||SolutionBuilder is deferred for redesign +ts.createSolutionBuilderWithWatch||SolutionBuilder is deferred for redesign +ts.createSolutionBuilderWithWatchHost||SolutionBuilder is deferred for redesign +ts.createSourceMapSource||Trivial plain JavaScript object +ts.createTextChangeRange||Internal helper, trivial plain JavaScript object +ts.createTextSpan||Internal helper, trivial plain JavaScript object +ts.createTextSpanFromBounds||Internal helper, trivial plain JavaScript object +ts.createTypeReferenceDirectiveResolutionCache||Module resolution is only cached within a single Program build in TypeScript 7 +ts.createWatchCompilerHost||Watch APIs are deferred for redesign +ts.createWatchProgram||Watch APIs are deferred for redesign +ts.decodedTextSpanIntersectsWith||Internal helper +ts.displayPartsToString||Display parts are not used in TypeScript 7 +ts.disposeEmitNodes||EmitNodes are not used in TypeScript 7 +ts.forEachChild||Node.forEachChild is sufficient +ts.formatDiagnostic||formatDiagnostics is sufficient +ts.getCommentRange||EmitNodes are not used in TypeScript 7 +ts.getConfigFileParsingDiagnostics|Program.getConfigFileParsingDiagnostics| +ts.getEmitHelpers||EmitNodes are not used in TypeScript 7 +ts.getJSDocClassTag||The bespoke JSDocClassTag kind and @class/@constructor semantics were intentionally removed. Such tags are available as JSDocUnknownTag through getJSDocTags, filtered by tagName.text. Same decision as the removed NodeFactory class-tag factories; https://github.com/microsoft/typescript-go/pull/34 +ts.getJSDocEnumTag||The bespoke JSDocEnumTag kind and @enum semantics were intentionally removed. Such tags are available as JSDocUnknownTag through getJSDocTags, filtered by tagName.text, without a structured enum typeExpression. Same decision as the removed NodeFactory enum-tag factories; https://github.com/microsoft/typescript-go/pull/34 +ts.getLineAndCharacterOfPosition||SourceFile.getLineAndCharacterOfPosition is sufficient +ts.getModeForFileReference||Internal helper, trivially reimplementable in user code +ts.getNameOfJSDocTypedef||Function not used in TypeScript 7 +ts.getOriginalNode||EmitNodes are not used in TypeScript 7 +ts.getParseTreeNode||Original nodes are not stored on clones in TypeScript 7 +ts.getParsedCommandLineOfConfigFile||Internal helper +ts.getPositionOfLineAndCharacter||SourceFile.getPositionOfLineAndCharacter is sufficient +ts.getSourceMapRange||EmitNodes are not used in TypeScript 7 +ts.getSupportedCodeFixes||Only public for TS Server plugins; no longer needed +ts.getSyntheticLeadingComments||EmitNodes are not used in TypeScript 7 +ts.getSyntheticTrailingComments||EmitNodes are not used in TypeScript 7 +ts.getTokenSourceMapRange||EmitNodes are not used in TypeScript 7 +ts.getTypeParameterOwner||Function not used in TypeScript 7, trivially implementable in user code +ts.hasJSDocParameterTags||Function not used in TypeScript 7, trivially reimplementable in user code +ts.isAccessor|ts.isAccessorDeclaration| +ts.isAssertClause||AssertClause is removed in TypeScript 7 +ts.isAssertEntry||AssertEntry is removed in TypeScript 7 +ts.isBuildCommand||Build APIs are deferred for redesign +ts.isBundle||outFile is removed in TypeScript 7 +ts.isCommaListExpression||CommaListExpression is removed in TypeScript 7 +ts.isGetAccessor|ts.isGetAccessorDeclaration| +ts.isImportTypeAssertionContainer||ImportTypeAssertionContainer is removed in TypeScript 7 +ts.isJSDocAuthorTag||The bespoke JSDoc author tag kind was intentionally removed. Such tags are represented by JSDocUnknownTag and can be identified by tagName.text; no dedicated kind predicate remains. Same decision as the removed tag factories/getters. https://github.com/microsoft/typescript-go/pull/34 +ts.isJSDocClassTag||The bespoke JSDoc class/constructor tag kind was intentionally removed. Such tags are represented by JSDocUnknownTag and can be identified by tagName.text; no dedicated kind predicate remains. Same decision as the removed tag factories/getters. https://github.com/microsoft/typescript-go/pull/34 +ts.isJSDocEnumTag||The bespoke JSDoc enum tag kind was intentionally removed. Such tags are represented by JSDocUnknownTag and can be identified by tagName.text; no dedicated kind predicate remains. Same decision as the removed tag factories/getters. https://github.com/microsoft/typescript-go/pull/34 +ts.isJSDocFunctionType||JSDocFunctionType and Closure-style function(...) type syntax are not supported. isFunctionTypeNode identifies TypeScript-style function types, not an equivalent of the removed syntax. https://github.com/microsoft/typescript-go/pull/408 +ts.isJSDocMemberName||The distinct JSDocMemberName kind was removed; JSDoc Class#member and dotted names are both QualifiedName nodes. Unlike the factory replacement, isQualifiedName is not an equivalent predicate: it also matches dotted names and the AST no longer retains the distinction. See tsc/internal/parser/jsdoc.go:742-760. +ts.isJSDocNamepathType||JSDocNamepathType and its Closure namepath syntax were intentionally dropped; there is no corresponding node kind to test. https://github.com/microsoft/typescript-go/pull/34 +ts.isJSDocUnknownType||The standalone JSDoc ? type and JSDocUnknownType kind were intentionally dropped. The TypeScript unknown keyword is a different type, not a predicate rename. https://github.com/microsoft/typescript-go/pull/34 +ts.isMethodSignature|ts.isMethodSignatureDeclaration| +ts.isParameter|ts.isParameterDeclaration| +ts.isPropertySignature|ts.isPropertySignatureDeclaration| +ts.isSetAccessor|ts.isSetAccessorDeclaration| +ts.isTypeAssertionExpression|ts.isTypeAssertion| +ts.moveEmitHelpers||EmitNodes are not used in TypeScript 7 +ts.moveSyntheticComments||EmitNodes are not used in TypeScript 7 +ts.nodeModuleNameResolver||Node module resolution is removed in TypeScript 7; use `api.createModuleResolver` with supported options +ts.parseBuildCommand||Build APIs are deferred for redesign +ts.preProcessFile||File preprocessing is not used in TypeScript 7 +ts.readBuilderProgram||Build APIs are deferred for redesign +ts.removeEmitHelper||EmitNodes are not used in TypeScript 7 +ts.resolveModuleName|ModuleResolver.resolveModuleName|Through `api.createModuleResolver` +ts.resolveModuleNameFromCache||Module resolution results are not cached beyond a single program build in TypeScript 7 +ts.resolveProjectReferencePath||Internal helper; trivially reimplementable in user code +ts.setCommentRange||EmitNodes are not used in TypeScript 7 +ts.setConstantValue||EmitNodes are not used in TypeScript 7 +ts.setEmitFlags||EmitNodes are not used in TypeScript 7 +ts.setOriginalNode||EmitNodes are not used in TypeScript 7 +ts.setSourceMapRange||EmitNodes are not used in TypeScript 7 +ts.setSyntheticLeadingComments||EmitNodes are not used in TypeScript 7 +ts.setSyntheticTrailingComments||EmitNodes are not used in TypeScript 7 +ts.setTextRange||Internal helper; Nodes should be considered immutable by user code +ts.setTokenSourceMapRange||EmitNodes are not used in TypeScript 7 +ts.textChangeRangeIsUnchanged||Internal helper +ts.textChangeRangeNewSpan||Internal helper +ts.textSpanContainsPosition||Internal helper, trivially reimplementable in user code +ts.textSpanContainsTextSpan||Internal helper, trivially reimplementable in user code +ts.textSpanEnd||Internal helper, trivially reimplementable in user code +ts.textSpanIntersection||Internal helper, trivially reimplementable in user code +ts.textSpanIntersectsWith||Internal helper, trivially reimplementable in user code +ts.textSpanIntersectsWithPosition||Internal helper, trivially reimplementable in user code +ts.textSpanIntersectsWithTextSpan||Internal helper, trivially reimplementable in user code +ts.textSpanIsEmpty||Internal helper, trivially reimplementable in user code +ts.textSpanOverlap||Internal helper, trivially reimplementable in user code +ts.textSpanOverlapsWith||Internal helper, trivially reimplementable in user code +ts.toEditorSettings||Internal helper, no longer needed +ts.transform||Transform APIs are deferred +ts.transpile||`api.transpileModule` is sufficient +ts.updateLanguageServiceSourceFile||Incremental parsing is not used in TypeScript 7 +ts.validateLocaleAndSetLanguage||The locale cannot be set from the API in TypeScript 7 +ts.visitCommaListElements||CommaListExpression is removed in TypeScript 7 +ts.visitFunctionBody||Only needed for internal transforms +ts.visitIterationBody||Only needed for internal transforms +ts.visitLexicalEnvironment||Only needed for internal transforms +ts.visitParameterList||Only needed for internal transforms diff --git a/tsc/testdata/apiDiff.txt b/tsc/testdata/apiDiff.txt new file mode 100644 index 0000000000000..b19d3d8d65e7c --- /dev/null +++ b/tsc/testdata/apiDiff.txt @@ -0,0 +1,841 @@ +# This report is generated by tools/scripts/gen/apidiff.mts. +# Old API: TypeScript 6.0.3 (node_modules/typescript/lib/typescript.d.ts) +# New API: public package entry points +Types not compared: +- Log +- TypingsInstaller +- InstallTypingHost +- ServerHost +- ITypingsInstaller +- Logger +- NormalizedPathMap +- ScriptInfo +- PluginModule +- InferredProject +- AutoImportProviderProject +- ConfiguredProject +- ExternalProject +- ProjectService +- ServerCancellationToken +- Session +- TypingResolutionHost +- SourceFileLike +- ScriptReferenceHost +- ParseConfigHost +- CancellationToken +- CustomTransformer +- ModuleResolutionHost +- MinimalResolutionCacheHost +- CompilerHost +- SourceMapSource +- CoreTransformationContext +- TransformationContext +- TransformationResult +- PrintHandlers +- GetEffectiveTypeRootsHost +- System +- FileWatcher +- ParseConfigFileHost +- ModeAwareCache +- PerDirectoryResolutionCache +- NonRelativeNameResolutionCache +- PerNonRelativeNameCache +- ModuleResolutionCache +- NonRelativeModuleNameResolutionCache +- PackageJsonInfoCache +- FormatDiagnosticsHost +- SemanticDiagnosticsBuilderProgram +- EmitAndSemanticDiagnosticsBuilderProgram +- ReadBuildProgramHost +- WatchHost +- ProgramHost +- WatchCompilerHost +- WatchCompilerHostOfConfigFile +- Watch +- WatchOfFilesAndCompilerOptions +- SolutionBuilderHostBase +- InvalidatedProjectBase +- UpdateOutputFileStampsProject +- BuildInvalidedProject +- IScriptSnapshot +- HostCancellationToken +- IncompleteCompletionsCache +- LanguageServiceHost +- Classifier +- DocumentRegistry + + +# TypeChecker (old) methods compared to Checker (new). +## (73) TypeChecker methods matched in async Checker ## + +## TypeChecker methods missing from async Checker (16) ## +getRootSymbols +getSymbolOfExpando +getSymbolsOfParameterPropertyDeclaration +getTypeArgumentsForResolvedSignature +getTypeOfAssignmentPattern +indexInfoToIndexSignatureDeclaration +isOptionalParameter +isValidPropertyAccess +signatureToString +symbolToEntityName +symbolToExpression +symbolToParameterDeclaration +symbolToString +symbolToTypeParameterDeclarations +typeParameterToDeclaration +typePredicateToString + + +# BuilderProgram (old) methods compared to Program (new). +## (13) BuilderProgram methods matched in async Program ## + +## BuilderProgram methods missing from async Program (0) ## + + +# Program (old) methods compared to Program (new). +## (15) Program methods matched in async Program ## + +## Program methods missing from async Program (8) ## +getIdentifierCount +getInstantiationCount +getNodeCount +getRelationCacheSizes +getResolvedProjectReferences +getSourceFiles +getSymbolCount +getTypeCount + + +# SolutionBuilder (old) methods compared to BuildOrchestrator (new). +## (5) SolutionBuilder methods matched in async BuildOrchestrator ## + +## SolutionBuilder methods missing from async BuildOrchestrator (0) ## + + +# Project (old) methods compared to Project (new). +## (59) Project methods matched in async Project ## + +## Project methods missing from async Project (2) ## +getTypeAcquisition +isJsOnlyProject + + +# LanguageService (old) methods compared to Project (new). +## (1) LanguageService methods matched in async Project ## + +## LanguageService methods missing from async Project (64) ## +applyCodeActionCommand +cleanupSemanticCache +commentSelection +findReferences +findRenameLocations +getApplicableRefactors +getBraceMatchingAtPosition +getBreakpointStatementAtPosition +getCodeFixesAtPosition +getCombinedCodeFix +getCompilerOptionsDiagnostics +getCompletionEntryDetails +getCompletionEntrySymbol +getCompletionsAtPosition +getDefinitionAndBoundSpan +getDefinitionAtPosition +getDocCommentTemplateAtPosition +getDocumentHighlights +getEditsForFileRename +getEditsForRefactor +getEmitOutput +getEncodedSemanticClassifications +getEncodedSyntacticClassifications +getFileReferences +getFormattingEditsAfterKeystroke +getFormattingEditsForDocument +getFormattingEditsForRange +getImplementationAtPosition +getIndentationAtPosition +getJsxClosingTagAtPosition +getLinkedEditingRangeAtPosition +getMoveToRefactoringFileSuggestions +getNameOrDottedNameSpan +getNavigateToItems +getNavigationBarItems +getNavigationTree +getOutliningSpans +getPasteEdits +getProgram +getQuickInfoAtPosition +getReferencesAtPosition +getRenameInfo +getSemanticClassifications +getSemanticDiagnostics +getSignatureHelpItems +getSmartSelectionRange +getSpanOfEnclosingComment +getSuggestionDiagnostics +getSupportedCodeFixes +getSyntacticClassifications +getSyntacticDiagnostics +getTodoComments +getTypeDefinitionAtPosition +isValidBraceCompletionAtPosition +organizeImports +prepareCallHierarchy +preparePasteEditsForFile +provideCallHierarchyIncomingCalls +provideCallHierarchyOutgoingCalls +provideInlayHints +toLineColumnOffset +toggleLineComment +toggleMultilineComment +uncommentSelection + + +# Scanner (old) methods compared to Scanner (new). +## (43) Scanner methods matched in async Scanner ## + +## Scanner methods missing from async Scanner (0) ## + + +# Printer (old) methods compared to Printer (new). +## (3) Printer methods matched in async Printer ## + +## Printer methods missing from async Printer (1) ## +printList + + +# Signature (old) methods compared to Signature (new). +## (7) Signature methods matched in async Signature ## + +## Signature methods missing from async Signature (0) ## + + +# SourceFile (old) methods compared to SourceFile (new). +## (4) SourceFile methods matched in async SourceFile ## + +## SourceFile methods missing from async SourceFile (1) ## +getLineEndOfPosition + + +# Symbol (old) methods compared to Symbol (new). +## (6) Symbol methods matched in async Symbol ## + +## Symbol methods missing from async Symbol (0) ## + + +# Type (old) methods compared to Type, ts (new). +## (21) Type methods matched in async Type, ts ## + +## Type methods missing from async Type, ts (2) ## +isClass +isUnionOrIntersection + + +# Node (old) methods compared to Node (new). +## (15) Node methods matched in async Node ## + +## Node methods missing from async Node (0) ## + + +# NodeFactory (old) methods compared to ts (new). +## (389) NodeFactory methods matched in async ts ## + +## NodeFactory methods missing from async ts (58) ## +createAdd +createAssignment +createBitwiseAnd +createBitwiseNot +createBitwiseOr +createBitwiseXor +createCallChain +createComma +createDivide +createElementAccessChain +createEquality +createExponent +createExportDefault +createExternalModuleExport +createFalse +createGreaterThan +createGreaterThanEquals +createImmediatelyInvokedArrowFunction +createImmediatelyInvokedFunctionExpression +createInequality +createLeftShift +createLessThan +createLessThanEquals +createLogicalAnd +createLogicalNot +createLogicalOr +createModifier +createModifiersFromModifierFlags +createModulo +createMultiply +createNonNullChain +createNull +createPostfixDecrement +createPostfixIncrement +createPrefixDecrement +createPrefixIncrement +createPrefixMinus +createPrefixPlus +createPropertyAccessChain +createRightShift +createStrictEquality +createStrictInequality +createSubtract +createSuper +createThis +createTrue +createUnsignedRightShift +createVoidZero +replaceDecoratorsAndModifiers +replaceModifiers +replacePropertyName +restoreOuterExpressions +updateCallChain +updateElementAccessChain +updateJSDocText +updateJsxText +updateNonNullChain +updatePropertyAccessChain + + +# ts (old) methods compared to ts, API (new). +## (391) ts methods matched in async ts, API ## + +## ts methods missing from async ts, API (97) ## +addEmitHelper +addEmitHelpers +addSyntheticLeadingComment +addSyntheticTrailingComment +canHaveDecorators +canHaveModifiers +convertCompilerOptionsFromJson +convertToObject +convertTypeAcquisitionFromJson +findAncestor +findConfigFile +flattenDiagnosticMessageText +getAutomaticTypeDirectiveNames +getCombinedNodeFlags +getConstantValue +getDecorators +getDefaultCompilerOptions +getDefaultFormatCodeSettings +getDefaultLibFileName +getDefaultLibFilePath +getEffectiveConstraintOfTypeParameter +getEffectiveTypeParameterDeclarations +getEffectiveTypeRoots +getImpliedNodeFormatForFile +getJSDocAugmentsTag +getJSDocDeprecatedTag +getJSDocImplementsTags +getJSDocOverrideTagNoCache +getJSDocParameterTags +getJSDocPrivateTag +getJSDocProtectedTag +getJSDocPublicTag +getJSDocReadonlyTag +getJSDocReturnTag +getJSDocReturnType +getJSDocSatisfiesTag +getJSDocTemplateTag +getJSDocThisTag +getJSDocType +getJSDocTypeParameterTags +getJSDocTypeTag +getModeForResolutionAtIndex +getModeForUsageLocation +getModifiers +getOutputFileNames +getPreEmitDiagnostics +getTsBuildInfoEmitOutputFilePath +hasOnlyExpressionInitializer +hasRestParameter +idText +identifierToKeywordKind +isAutoAccessorPropertyDeclaration +isCallChain +isClassElement +isClassLike +isClassOrTypeElement +isConstTypeReference +isDeclarationStatement +isElementAccessChain +isEmptyBindingElement +isEmptyBindingPattern +isExternalModuleNameRelative +isFunctionLike +isFunctionOrConstructorTypeNode +isImportOrExportSpecifier +isInternalDeclaration +isIterationStatement +isJSDocCommentContainingNode +isJSDocLinkLike +isJSDocPropertyLikeTag +isJsxCallLike +isNonNullChain +isNullishCoalesce +isObjectLiteralElement +isOptionalChain +isParameterPropertyDeclaration +isParseTreeNode +isPartOfTypeNode +isPartOfTypeOnlyImportOrExportDeclaration +isPropertyAccessChain +isPropertyAccessOrQualifiedName +isRestParameter +isStringLiteralLike +isStringLiteralOrJsxExpression +isStringTextContainingNode +isTypeElement +isTypeOnlyExportDeclaration +isTypeOnlyImportDeclaration +isTypeOnlyImportOrExportDeclaration +parseIsolatedEntityName +parseJsonText +readJsonConfigFile +resolveTripleslashReference +resolveTypeReferenceDirective +sortAndDeduplicateDiagnostics +symbolName +walkUpBindingElementsAndPatterns + + + + # New Methods in async API (temporarily reported for increased ease of matching) +## New ConditionalType methods in async API (4) ## +getCheckType +getExtendsType +getTrueType +getFalseType + +## New FormatDiagnosticsHost methods in async API (3) ## +getCurrentDirectory +getCanonicalFileName +getNewLine + +## New FreshableType methods in async API (2) ## +getFreshType +getRegularType + +## New IndexedAccessType methods in async API (2) ## +getObjectType +getIndexType + +## New IndexType methods in async API (1) ## +getTarget + +## New InterfaceType methods in async API (4) ## +getTypeParameters +getOuterTypeParameters +getLocalTypeParameters +getThisType + +## New MappedType methods in async API (4) ## +getTypeParameter +getConstraintType +getNameType +getTemplateType + +## New StringMappingType methods in async API (1) ## +getTarget + +## New SubstitutionType methods in async API (2) ## +getBaseType +getConstraint + +## New TemplateLiteralType methods in async API (1) ## +getTypes + +## New TupleType methods in async API (1) ## +getTarget + +## New TupleTypeReference methods in async API (1) ## +getTarget + +## New Type methods in async API (20) ## +getApparentType +getReducedType +getIndexInfos +getAliasTypeArguments +getAliasSymbol +isObjectType +isIntrinsicType +isErrorType +isStringLiteralType +isBigIntLiteralType +isBooleanLiteralType +isTypeReference +isTupleType +isTupleTypeTarget +isIndexedAccessType +isConditionalType +isSubstitutionType +isTemplateLiteralType +isStringMappingType +isMappedType + +## New TypeParameter methods in async API (0) ## + +## New TypeReference methods in async API (1) ## +getTarget + +## New UnionOrIntersectionType methods in async API (1) ## +getTypes + +## New API methods in async API (20) ## +getSymbol +fromLSPConnection +batchContext +getCurrentDirectory +getCanonicalFileName +getNewLine +createBuildOrchestrator +createSourceFile +createSourceFileFromFile +retainSourceFile +transpileModuleFromFile +transpileDeclarationFromFile +createSnapshot +getCurrentLanguageServerSnapshot +close +createModuleResolver +clearSourceFileCache +runWithTemporaryFileUpdate +getTimingInfo +resetTimingInfo + +## New RetainedSourceFile methods in async API (1) ## +dispose + +## New DebugHandlers methods in async API (3) ## +startCPUProfile +stopCPUProfile +saveHeapProfile + +## New Snapshot methods in async API (7) ## +getProjects +getConfiguredProject +getProject +getProgram +getDefaultProjectForFile +dispose +isDisposed + +## New ModuleResolver methods in async API (2) ## +dispose +ensureNotDisposed + +## New Project methods in async API (0) ## + +## New LanguageService methods in async API (6) ## +getImportAdderEdits +getImportEditsForSymbols +getReferencedSymbolsForNode +getSignatureUsage +getCompletionsAtPosition +formatNodeForInsertion + +## New Program methods in async API (22) ## +getCanonicalFileName +getNewLine +setOwnedSnapshot +dispose +getStatistics +getSourceFileByPath +getResolvedModule +getResolvedModuleFromModuleSpecifier +getResolvedTypeReferenceDirective +getResolvedTypeReferenceDirectiveFromTypeReferenceDirective +getSourceFileNames +getSourceFileMetadata +getSourceFileMetadataByPath +getConfigFileNames +getConfigSourceFile +getBindDiagnostics +getSuggestionDiagnostics +getProgramDiagnostics +emitToString +getJavaScriptEmit +getDeclarationEmit +getProject + +## New BuildOrchestrator methods in async API (2) ## +dispose +isDisposed + +## New Checker methods in async API (23) ## +dispose +getSymbolOfNode +getSymbolOfDeclaration +getParentOfSymbol +getSymbolAtPosition +getSymbolOfSourceFile +getNonMissingTypeOfSymbol +getReferencesToSymbolInFile +getTypeAtPosition +getResolvedSymbol +getContextualTypeForArgumentAtIndex +getParameterType +isContextSensitive +isTupleTypeTarget +isReadonlySymbol +getRestTypeOfSignature +getReducedType +getTypeOfPropertyOfType +getConstraintOfTypeParameter +getTargetSymbol +isUnknownSignature +getJsDocTagsOfSymbol +getDocumentationCommentOfSymbol + +## New Printer methods in async API (0) ## + +## New NodeHandle methods in async API (1) ## +resolve + +## New Symbol methods in async API (4) ## +getParent +getMembers +getExports +getExportSymbol + +## New Signature methods in async API (2) ## +getThisParameter +getTarget + +## New Node methods in async API (1) ## +childrenIter + +## New SourceFile methods in async API (0) ## + +## New Scanner methods in async API (10) ## +hasPrecedingJSDocComment +hasPrecedingJSDocLeadingAsterisks +hasPrecedingJSDocWithDeprecatedTag +hasPrecedingJSDocWithSeeOrLink +getNumericLiteralFlags +getCommentDirectives +getTokenFlags +scanJSDocCommentTextToken +clearCommentDirectives +setSkipJsDocLeadingAsterisks + +## New SpanMap methods in async API (9) ## +isExact +isSingleSegment +isNone +virtualToOriginalSpan +virtualToOriginalSpanForFeature +virtualToOriginalPosition +virtualToOriginalPositionForFeature +originalToVirtualPositions +originalToVirtualSpans + +## New NodeObject methods in async API (16) ## +forEachChild +childrenIter +getSourceFile +getStart +getFullStart +getEnd +getWidth +getFullWidth +getLeadingTriviaWidth +getFullText +getText +getChildCount +getChildAt +getChildren +getFirstToken +getLastToken + +## New ts methods in async API (185) ## +isRemoteNode +getSymbol +isUnionType +isIntersectionType +isObjectType +isClassOrInterfaceType +isIntrinsicType +isErrorType +isLiteralType +isStringLiteralType +isNumberLiteralType +isBigIntLiteralType +isBooleanLiteralType +isTypeReference +isTupleType +isTupleTypeTarget +isIndexType +isIndexedAccessType +isConditionalType +isSubstitutionType +isTemplateLiteralType +isStringMappingType +isTypeParameter +documentURIToFileName +fileNameToDocumentURI +createFileSystem +createFileSystemWithLib +createFileSystemLayer +createFileSystemFromSnapshot +validateSymbolOwner +validateSymbolResponse +resolveFileName +resolveDocumentURI +getTokenAtPosition +getTouchingPropertyName +getTouchingToken +findNextToken +findPrecedingToken +getTokenPosOfNode +getPooledScannersForTesting +getChildren +getFirstToken +getLastToken +getSynthesizedDeepClone +getSynthesizedDeepClones +isValidTypeOnlyAliasUseSite +isBlockOrExpression +isUnaryExpression +isOuterExpression +skipOuterExpressions +isBindingPattern +isIdentifierOrJSDocNamespaceDeclaration +isJSDocTypeExpressionOrJSDocTypeLiteral +isNotEmittedTypeElement +isKeywordExpression +isKeywordTypeNode +isSyntaxList +isJSDocText +isSyntheticReferenceExpression +isHeritageClauseElement +isAccessExpression +isDeclarationName +isJSDocFullName +isJsxAttributeName +isJsxAttributeValue +isClassLikeDeclaration +isLiteralLikeNode +isUnionOrIntersectionTypeNode +isTemplateLiteralLikeNode +isTemplateMiddleOrTail +isTypePredicateParameterName +isJSDocComment +isSignatureDeclaration +isStringLiteralLikeNode +isNumericOrStringLikeLiteral +isObjectLiteralLikeNode +isObjectTypeDeclaration +isNamedImportsOrExports +isFunctionLikeDeclaration +isVariableOrParameterDeclaration +isVariableOrPropertyDeclaration +isImportClauseOrBindingPattern +isAnyImportSyntax +isBooleanLiteral +isDestructuringAssignment +isLiteralToken +isPropertyNameLiteral +isPseudoLiteralToken +isArrayDestructuringAssignment +isObjectDestructuringAssignment +isFunctionBody +isTriviaKind +isPseudoLiteralKind +isModifierKind +isKeywordTypeKind +isKeywordExpressionKind +isJsxTokenKind +isImportPhaseModifierKind +isPostfixUnaryOperator +isPrefixUnaryOperator +isAssignmentOperator +isBinaryOperator +isExponentiationOperator +isMultiplicativeOperator +isMultiplicativeOperatorOrHigher +isAdditiveOperator +isAdditiveOperatorOrHigher +isShiftOperator +isShiftOperatorOrHigher +isRelationalOperator +isRelationalOperatorOrHigher +isEqualityOperator +isEqualityOperatorOrHigher +isBitwiseOperator +isBitwiseOperatorOrHigher +isLogicalOperator +isLogicalOperatorOrHigher +isCompoundAssignmentOperator +isAssignmentOperatorOrHigher +isLogicalOrCoalescingAssignmentOperator +isLiteralKind +isPunctuationKind +isKeywordKind +isJSDocNodeKind +isEndOfFile +isDotToken +isEqualsToken +isAssertKeyword +isCaseKeyword +isAbstractKeyword +isAccessorKeyword +isAsyncKeyword +isConstKeyword +isDeclareKeyword +isDefaultKeyword +isExportKeyword +isInKeyword +isPrivateKeyword +isProtectedKeyword +isPublicKeyword +isReadonlyKeyword +isOutKeyword +isOverrideKeyword +isStaticKeyword +isAssignmentOperatorToken +isNullLiteral +isTrueLiteral +isFalseLiteral +isThisExpression +isSuperExpression +isImportExpression +tokenIsIdentifierOrKeyword +tokenIsIdentifierOrKeywordOrGreaterThan +isUnicodeIdentifierStart +stringToToken +characterCodeToRegularExpressionFlag +computeLineStarts +skipTrivia +isIdentifierText +utf16EncodeAsString +formatSyntaxKind +tryGetAmbientModuleNameFromSymbolName +tryCast +cast +hasExpression +hasInitializer +hasObjectAssignmentInitializer +cloneSourceFileData +visitNodesArray +forEachChildOfJSDocParameterTag +forEachChildOfJSDocPropertyTag +yieldEachChildOfJSDocParameterTag +yieldEachChildOfJSDocPropertyTag +visitEachChildOfJSDocParameterTag +visitEachChildOfJSDocPropertyTag +cloneNode +createMissingDeclaration +createKeywordExpression +createSyntheticExpression +createSyntaxList +createSyntheticReferenceExpression +updateMissingDeclaration +updateSyntheticExpression +updateSyntaxList +updateSyntheticReferenceExpression