diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 6f1de3677e7..4ea2489de88 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -1798,7 +1798,7 @@ namespace ts { * @param node The node to analyze * @param subtreeFlags Transform flags computed for this node's subtree */ - export function computeTransformFlagsForNode(node: Node, subtreeFlags: TransformFlags) { + export function computeTransformFlagsForNode(node: Node, subtreeFlags: TransformFlags): TransformFlags { // Ambient nodes are TypeScript syntax and the flags of their subtree are ignored. if (node.flags & NodeFlags.Ambient) { return (node.transformFlags = TransformFlags.AssertTypeScript) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 09446cf668d..a464bd86682 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -130,11 +130,12 @@ namespace ts { return -1; } - export function countWhere(array: T[], predicate: (x: T) => boolean): number { + export function countWhere(array: T[], predicate: (x: T, i: number) => boolean): number { let count = 0; if (array) { - for (const v of array) { - if (predicate(v)) { + for (let i = 0; i < array.length; i++) { + const v = array[i]; + if (predicate(v, i)) { count++; } } @@ -170,7 +171,10 @@ namespace ts { return result; } - export function flatMap(array: T[], f: (x: T, i: number) => U[]): U[] { + /** + * Maps an array. If the mapped value is an array, it is spread into the result. + */ + export function flatMap(array: T[], f: (x: T, i: number) => U | U[]): U[] { let result: U[]; if (array) { result = []; @@ -178,7 +182,9 @@ namespace ts { const v = array[i]; const ar = f(v, i); if (ar) { - result = result.concat(ar); + // We cast to here to leverage the behavior of Array#concat + // which will append a single value here. + result = result.concat(ar); } } } @@ -191,18 +197,6 @@ namespace ts { return [...array1, ...array2]; } - export function append(array: T[], value: T): T[] { - if (value === undefined) return array; - if (!array || !array.length) return [value]; - return [...array, value]; - } - - export function prepend(array: T[], value: T): T[] { - if (value === undefined) return array; - if (!array || !array.length) return [value]; - return [value, ...array]; - } - export function deduplicate(array: T[]): T[] { let result: T[]; if (array) { @@ -216,6 +210,27 @@ namespace ts { return result; } + /** + * Compacts an array, removing any falsey elements. + */ + export function compact(array: T[]): T[] { + let result: T[]; + if (array) { + for (let i = 0; i < array.length; i++) { + const v = array[i]; + if (result || !v) { + if (!result) { + result = array.slice(0, i); + } + if (v) { + result.push(v); + } + } + } + } + return result || array; + } + export function sum(array: any[], prop: string): number { let result = 0; for (const v of array) { diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 5fdffc32d46..8cd328b3a1e 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -22,7 +22,7 @@ namespace ts { return node; } - export function createNodeArray(elements?: T[], location?: TextRange): NodeArray { + export function createNodeArray(elements?: T[], location?: TextRange, hasTrailingComma?: boolean): NodeArray { if (elements) { if (isNodeArray(elements)) { return elements; @@ -42,6 +42,10 @@ namespace ts { array.end = -1; } + if (hasTrailingComma) { + array.hasTrailingComma = true; + } + array.arrayKind = ArrayKind.NodeArray; return array; } @@ -145,6 +149,13 @@ namespace ts { return clone; } + /** + * Creates a shallow, memberwise clone of a node for mutation. + */ + export function getMutableNode(node: T): T { + return cloneNode(node, node, node.flags, node.parent, node); + } + export function createNodeArrayNode(elements: T[]): NodeArrayNode { const node = >createSynthesizedNode(SyntaxKind.NodeArrayNode); node.nodes = createNodeArray(elements); @@ -279,7 +290,6 @@ namespace ts { return node; } - // Expression export function createArrayLiteral(elements?: Expression[]) { @@ -364,6 +374,13 @@ namespace ts { return node; } + export function createPrefix(operator: SyntaxKind, operand: Expression, location?: TextRange) { + const node = createNode(SyntaxKind.PrefixUnaryExpression, location); + node.operator = operator; + node.operand = parenthesizePrefixOperand(operand); + return node; + } + export function createPostfix(operand: Expression, operator: SyntaxKind, location?: TextRange) { const node = createNode(SyntaxKind.PostfixUnaryExpression, location); node.operand = parenthesizePostfixOperand(operand); @@ -512,6 +529,14 @@ namespace ts { return node; } + export function createForOf(initializer: ForInitializer, expression: Expression, statement: Statement, location?: TextRange) { + const node = createNode(SyntaxKind.ForOfStatement, location); + node.initializer = initializer; + node.expression = expression; + node.statement = statement; + return node; + } + export function createReturn(expression?: Expression, location?: TextRange): ReturnStatement { const node = createNode(SyntaxKind.ReturnStatement, location); node.expression = expression; @@ -630,6 +655,10 @@ namespace ts { return createBinary(left, SyntaxKind.BarBarToken, right); } + export function createLogicalNot(operand: Expression) { + return createPrefix(SyntaxKind.ExclamationToken, operand); + } + export function createVoidZero() { return createVoid(createLiteral(0)); } @@ -840,6 +869,13 @@ namespace ts { ); } + export function createHasOwnProperty(target: LeftHandSideExpression, propertyName: Expression) { + return createCall( + createPropertyAccess(target, "hasOwnProperty"), + [propertyName] + ); + } + function createObjectCreate(prototype: Expression) { return createCall( createPropertyAccess(createIdentifier("Object"), "create"), @@ -855,7 +891,7 @@ namespace ts { target, createIdentifier("name") ) - ) + ); } function createSeti(target: LeftHandSideExpression) { @@ -1014,8 +1050,8 @@ namespace ts { : cloneNode(memberName, location); } - // Utilities + /** * Wraps the operand to a BinaryExpression in parentheses if they are needed to preserve the intended * order of operations. diff --git a/src/compiler/printer.ts b/src/compiler/printer.ts index 8b3a69b104a..aef2c64513b 100644 --- a/src/compiler/printer.ts +++ b/src/compiler/printer.ts @@ -216,7 +216,7 @@ const _super = (function (geti, seti) { onAfterEmitNode = undefined; isUniqueName = undefined; temporaryVariables = undefined; - tempFlags = 0; + tempFlags = TempFlags.Auto; currentSourceFile = undefined; currentText = undefined; extendsEmitted = false; @@ -1838,7 +1838,11 @@ const _super = (function (geti, seti) { } } - function emitPrologueDirectives(statements: Node[], startWithNewLine?: boolean) { + /** + * Emits any prologue directives at the start of a Statement list, returning the + * number of prologue directives written to the output. + */ + function emitPrologueDirectives(statements: Node[], startWithNewLine?: boolean): number { for (let i = 0; i < statements.length; i++) { if (isPrologueDirective(statements[i])) { if (startWithNewLine || i > 0) { diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 089f53cf7c8..f10c327faa7 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -968,7 +968,8 @@ namespace ts { const start = new Date().getTime(); - const emitResult = (options.experimentalTransforms ? printFiles : emitFiles)( + const fileEmitter = options.experimentalTransforms ? printFiles : emitFiles; + const emitResult = fileEmitter( emitResolver, getEmitHost(writeFileCallback), sourceFile); diff --git a/src/compiler/transformer.ts b/src/compiler/transformer.ts index be220f07ed8..7d91fc7e474 100644 --- a/src/compiler/transformer.ts +++ b/src/compiler/transformer.ts @@ -1,50 +1,15 @@ /// -/// -/// -/// -/// -/// -/// -/// - /* @internal */ namespace ts { - const moduleTransformerMap: Map = { - [ModuleKind.ES6]: transformES6Module, - [ModuleKind.System]: transformSystemModule, - [ModuleKind.AMD]: transformModule, - [ModuleKind.CommonJS]: transformModule, - [ModuleKind.UMD]: transformModule, - [ModuleKind.None]: transformModule - }; - const enum SyntaxKindFeatureFlags { ExpressionSubstitution = 1 << 0, EmitNotifications = 1 << 1, } - export function getTransformers(compilerOptions: CompilerOptions) { - const jsx = compilerOptions.jsx; - const languageVersion = getEmitScriptTarget(compilerOptions); - const moduleKind = getEmitModuleKind(compilerOptions); const transformers: Transformer[] = []; - - transformers.push(transformTypeScript); - transformers.push(moduleTransformerMap[moduleKind]); - if (jsx === JsxEmit.React) { - transformers.push(transformJsx); - } - - if (languageVersion < ScriptTarget.ES7) { - transformers.push(transformES7); - } - - if (languageVersion < ScriptTarget.ES6) { - transformers.push(transformES6); - } - + // TODO(rbuckton): Add transformers return transformers; } @@ -63,7 +28,6 @@ namespace ts { const lexicalEnvironmentVariableDeclarationsStack: VariableDeclaration[][] = []; const lexicalEnvironmentFunctionDeclarationsStack: FunctionDeclaration[][] = []; const enabledSyntaxKindFeatures = new Array(SyntaxKind.Count); - let lexicalEnvironmentStackOffset = 0; let hoistedVariableDeclarations: VariableDeclaration[]; let hoistedFunctionDeclarations: FunctionDeclaration[]; @@ -322,12 +286,17 @@ namespace ts { } if (hoistedVariableDeclarations) { - statements = append(statements, - createVariableStatement( - /*modifiers*/ undefined, - createVariableDeclarationList(hoistedVariableDeclarations) - ) + const statement = createVariableStatement( + /*modifiers*/ undefined, + createVariableDeclarationList(hoistedVariableDeclarations) ); + + if (!statements) { + statements = [statement]; + } + else { + statements.push(statement); + } } } diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 613ee5031f3..87763f4be7d 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -659,7 +659,7 @@ namespace ts { ); } - function visitVariableDeclaration(node: VariableDeclaration): OneOrMore { + function visitVariableDeclaration(node: VariableDeclaration): OneOrMany { const name = node.name; if (isBindingPattern(name)) { return createNodeArrayNode( diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index f7e7e128746..66784a7b310 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -1795,7 +1795,7 @@ namespace ts { * * @param node The function node. */ - function visitFunctionDeclaration(node: FunctionDeclaration): OneOrMore { + function visitFunctionDeclaration(node: FunctionDeclaration): OneOrMany { if (shouldElideFunctionLikeDeclaration(node)) { return undefined; } @@ -2446,7 +2446,7 @@ namespace ts { * * @param node The import equals declaration node. */ - function visitImportEqualsDeclaration(node: ImportEqualsDeclaration): OneOrMore { + function visitImportEqualsDeclaration(node: ImportEqualsDeclaration): OneOrMany { Debug.assert(!isExternalModuleImportEqualsDeclaration(node)); if (shouldElideImportEqualsDeclaration(node)) { return undefined; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 47908d322a2..2348c4d2b03 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1126,7 +1126,7 @@ namespace ts { // @kind(SyntaxKind.Block) export interface Block extends Statement { statements: NodeArray; - multiLine?: boolean; + /*@internal*/ multiLine?: boolean; } // @kind(SyntaxKind.VariableStatement) @@ -2512,10 +2512,8 @@ namespace ts { ES3 = 0, ES5 = 1, ES6 = 2, - ES7 = 3, ES2015 = ES6, - ES2016 = ES7, - Latest = ES7, + Latest = ES6, } export const enum LanguageVariant { diff --git a/src/compiler/visitor.ts b/src/compiler/visitor.ts index 3292881e014..c0aef869a8d 100644 --- a/src/compiler/visitor.ts +++ b/src/compiler/visitor.ts @@ -2,7 +2,7 @@ /* @internal */ namespace ts { - export type OneOrMore = T | NodeArrayNode; + export type OneOrMany = T | NodeArrayNode; /** * Describes an edge of a Node, used when traversing a syntax tree. @@ -20,6 +20,7 @@ namespace ts { /** A callback used to lift a NodeArrayNode into a valid node. */ lift?: (nodes: NodeArray) => Node; + /** A callback used to parenthesize a node to preserve the intended order of operations. */ parenthesize?: (value: Node, parentNode: Node) => Node; }; @@ -531,7 +532,7 @@ namespace ts { // Visit each original node. for (let i = 0; i < count; i++) { const node = nodes[i + start]; - const visited = node && >visitor(node); + const visited = node && >visitor(node); if (updated !== undefined || visited === undefined || visited !== node) { if (updated === undefined) { // Ensure we have a copy of `nodes`, up to the current index. @@ -549,7 +550,7 @@ namespace ts { if (updated !== undefined) { return (isModifiersArray(nodes) ? createModifiersArray(updated, nodes) - : setHasTrailingComma(createNodeArray(updated, nodes), nodes.hasTrailingComma)); + : createNodeArray(updated, nodes, nodes.hasTrailingComma)); } return nodes; @@ -589,7 +590,8 @@ namespace ts { if (updated !== undefined || visited !== value) { if (updated === undefined) { - updated = cloneNode(node, /*location*/ node, node.flags & ~NodeFlags.Modifier, /*parent*/ undefined, /*original*/ node); + updated = getMutableNode(node); + updated.flags &= ~NodeFlags.Modifier; } if (modifiers) { @@ -624,17 +626,6 @@ namespace ts { return updated; } - /** - * Sets the value of an edge, adjusting the value as necessary for cases such as expression precedence. - */ - function setEdgeValue(parentNode: Node & Map, edge: NodeEdge, value: Node | NodeArray) { - if (value && edge.parenthesize && !isArray(value)) { - value = parenthesizeEdge(value, parentNode, edge.parenthesize, edge.test); - } - - parentNode[edge.name] = value; - } - /** * Visits a node edge. * @@ -648,6 +639,17 @@ namespace ts { : visitNode(value, visitor, !edge.parenthesize ? edge.test : undefined, edge.optional, edge.lift); } + /** + * Sets the value of an edge, adjusting the value as necessary for cases such as expression precedence. + */ + function setEdgeValue(parentNode: Node & Map, edge: NodeEdge, value: Node | NodeArray) { + if (value && edge.parenthesize && !isArray(value)) { + value = parenthesizeEdge(value, parentNode, edge.parenthesize, edge.test); + } + + parentNode[edge.name] = value; + } + /** * Applies parentheses to a node to ensure the correct precedence. */ @@ -660,7 +662,7 @@ namespace ts { /** * Flattens an array of nodes that could contain NodeArrayNodes. */ - export function flattenNodes(nodes: OneOrMore[]): T[] { + export function flattenNodes(nodes: OneOrMany[]): T[] { let result: T[]; if (nodes) { result = []; @@ -678,7 +680,7 @@ namespace ts { * @param to The destination array. * @param from The source Node or NodeArrayNode. */ - export function addNode(to: T[], from: OneOrMore, startOnNewLine?: boolean) { + export function addNode(to: T[], from: OneOrMany, startOnNewLine?: boolean) { addNodeWorker(to, from, startOnNewLine, /*test*/ undefined) } @@ -688,7 +690,7 @@ namespace ts { * @param to The destination NodeArray. * @param from The source array of Node or NodeArrayNode. */ - export function addNodes(to: T[], from: OneOrMore[], startOnNewLine?: boolean) { + export function addNodes(to: T[], from: OneOrMany[], startOnNewLine?: boolean) { addNodesWorker(to, from, startOnNewLine, /*test*/ undefined); } @@ -698,7 +700,7 @@ namespace ts { * @param to The destination array. * @param from The source Node or NodeArrayNode. */ - export function addLine(to: T[], from: OneOrMore) { + export function addLine(to: T[], from: OneOrMany) { addNodeWorker(to, from, /*addOnNewLine*/ true, /*test*/ undefined); } @@ -708,11 +710,11 @@ namespace ts { * @param to The destination NodeArray. * @param from The source array of Node or NodeArrayNode. */ - export function addLines(to: T[], from: OneOrMore[]) { + export function addLines(to: T[], from: OneOrMany[]) { addNodesWorker(to, from, /*addOnNewLine*/ true, /*test*/ undefined); } - function addNodeWorker(to: T[], from: OneOrMore, addOnNewLine: boolean, test: (node: Node) => boolean) { + function addNodeWorker(to: T[], from: OneOrMany, addOnNewLine: boolean, test: (node: Node) => boolean) { if (to && from) { if (isNodeArrayNode(from)) { addNodesWorker(to, from.nodes, addOnNewLine, test); @@ -728,7 +730,7 @@ namespace ts { } } - function addNodesWorker(to: T[], from: OneOrMore[], addOnNewLine: boolean, test: (node: Node) => boolean) { + function addNodesWorker(to: T[], from: OneOrMany[], addOnNewLine: boolean, test: (node: Node) => boolean) { if (to && from) { for (const node of from) { addNodeWorker(to, node, addOnNewLine, test); @@ -896,7 +898,7 @@ namespace ts { * * @param nodes The NodeArray. */ - function liftToBlock(nodes: NodeArray) { + export function liftToBlock(nodes: NodeArray) { Debug.assert(every(nodes, isStatement), "Cannot lift nodes to a Block."); return createBlock(>nodes); } diff --git a/src/server/protocol.d.ts b/src/server/protocol.d.ts index 3a669753323..19ede892daf 100644 --- a/src/server/protocol.d.ts +++ b/src/server/protocol.d.ts @@ -1,54 +1,54 @@ -/** - * Declaration module describing the TypeScript Server protocol +/** + * Declaration module describing the TypeScript Server protocol */ declare namespace ts.server.protocol { - /** - * A TypeScript Server message + /** + * A TypeScript Server message */ export interface Message { - /** - * Sequence number of the message + /** + * Sequence number of the message */ seq: number; /** - * One of "request", "response", or "event" + * One of "request", "response", or "event" */ type: string; } - /** - * Client-initiated request message + /** + * Client-initiated request message */ export interface Request extends Message { /** - * The command to execute + * The command to execute */ command: string; - /** - * Object containing arguments for the command + /** + * Object containing arguments for the command */ arguments?: any; } /** - * Request to reload the project structure for all the opened files + * Request to reload the project structure for all the opened files */ export interface ReloadProjectsRequest extends Message { } - /** - * Server-initiated event message + /** + * Server-initiated event message */ export interface Event extends Message { - /** - * Name of event + /** + * Name of event */ event: string; - /** - * Event-specific information + /** + * Event-specific information */ body?: any; } @@ -62,18 +62,18 @@ declare namespace ts.server.protocol { */ request_seq: number; - /** - * Outcome of the request. + /** + * Outcome of the request. */ success: boolean; - /** + /** * The command requested. */ command: string; - /** - * Contains error message if success === false. + /** + * Contains error message if success === false. */ message?: string; @@ -83,7 +83,7 @@ declare namespace ts.server.protocol { body?: any; } - /** + /** * Arguments for FileRequest messages. */ export interface FileRequestArgs { @@ -93,7 +93,7 @@ declare namespace ts.server.protocol { file: string; } - /** + /** * Arguments for ProjectInfoRequest request. */ export interface ProjectInfoRequestArgs extends FileRequestArgs { @@ -110,7 +110,7 @@ declare namespace ts.server.protocol { arguments: ProjectInfoRequestArgs; } - /** + /** * Response message body for "projectInfo" request */ export interface ProjectInfo { @@ -125,7 +125,7 @@ declare namespace ts.server.protocol { fileNames?: string[]; } - /** + /** * Response message for "projectInfo" request */ export interface ProjectInfoResponse extends Response { @@ -144,12 +144,12 @@ declare namespace ts.server.protocol { * (file, line, character offset), where line and character offset are 1-based. */ export interface FileLocationRequestArgs extends FileRequestArgs { - /** + /** * The line number for the request (1-based). */ line: number; - /** + /** * The character offset (on the line) for the request (1-based). */ offset: number; @@ -216,7 +216,7 @@ declare namespace ts.server.protocol { * Object found in response messages defining a span of text in a specific source file. */ export interface FileSpan extends TextSpan { - /** + /** * File containing text span. */ file: string; @@ -300,14 +300,14 @@ declare namespace ts.server.protocol { */ lineText: string; - /** + /** * True if reference is a write location, false otherwise. */ isWriteAccess: boolean; } /** - * The body of a "references" response message. + * The body of a "references" response message. */ export interface ReferencesResponseBody { /** @@ -325,7 +325,7 @@ declare namespace ts.server.protocol { */ symbolStartOffset: number; - /** + /** * The full display name of the symbol. */ symbolDisplayString: string; @@ -355,7 +355,7 @@ declare namespace ts.server.protocol { } /** - * Information about the item to be renamed. + * Information about the item to be renamed. */ export interface RenameInfo { /** @@ -373,7 +373,7 @@ declare namespace ts.server.protocol { */ displayName: string; - /** + /** * Full display name of item to be renamed. */ fullDisplayName: string; @@ -383,7 +383,7 @@ declare namespace ts.server.protocol { */ kind: string; - /** + /** * Optional modifiers for the kind (such as 'public'). */ kindModifiers: string; @@ -469,7 +469,7 @@ declare namespace ts.server.protocol { placeOpenBraceOnNewLineForControlBlocks?: boolean; /** Index operator */ - [key: string] : string | number | boolean; + [key: string]: string | number | boolean; } /** @@ -477,7 +477,7 @@ declare namespace ts.server.protocol { */ export interface ConfigureRequestArguments { - /** + /** * Information about the host, for example 'Emacs 24.4' or * 'Sublime Text version 3075' */ @@ -495,7 +495,7 @@ declare namespace ts.server.protocol { } /** - * Configure request; value of command field is "configure". Specifies + * Configure request; value of command field is "configure". Specifies * host information, such as host type, tab size, and indent size. */ export interface ConfigureRequest extends Request { @@ -514,8 +514,8 @@ declare namespace ts.server.protocol { */ export interface OpenRequestArgs extends FileRequestArgs { /** - * Used when a version of the file content is known to be more up to date than the one on disk. - * Then the known content will be used upon opening instead of the disk copy + * Used when a version of the file content is known to be more up to date than the one on disk. + * Then the known content will be used upon opening instead of the disk copy */ fileContent?: string; } @@ -751,7 +751,7 @@ declare namespace ts.server.protocol { * Optional modifiers for the kind (such as 'public'). */ kindModifiers: string; - /** + /** * A string that is used for comparing completion items so that they can be ordered. This * is often the same as the name but may be different in certain circumstances. */ @@ -794,7 +794,7 @@ declare namespace ts.server.protocol { } /** - * Signature help information for a single parameter + * Signature help information for a single parameter */ export interface SignatureHelpParameter { @@ -814,18 +814,18 @@ declare namespace ts.server.protocol { displayParts: SymbolDisplayPart[]; /** - * Whether the parameter is optional or not. + * Whether the parameter is optional or not. */ isOptional: boolean; } /** - * Represents a single signature to show in signature help. + * Represents a single signature to show in signature help. */ export interface SignatureHelpItem { /** - * Whether the signature accepts a variable number of arguments. + * Whether the signature accepts a variable number of arguments. */ isVariadic: boolean; @@ -845,7 +845,7 @@ declare namespace ts.server.protocol { separatorDisplayParts: SymbolDisplayPart[]; /** - * The signature helps items for the parameters. + * The signature helps items for the parameters. */ parameters: SignatureHelpParameter[]; @@ -861,17 +861,17 @@ declare namespace ts.server.protocol { export interface SignatureHelpItems { /** - * The signature help items. + * The signature help items. */ items: SignatureHelpItem[]; /** - * The span for which signature help should appear on a signature + * The span for which signature help should appear on a signature */ applicableSpan: TextSpan; /** - * The item selected in the set of available help items. + * The item selected in the set of available help items. */ selectedItemIndex: number; @@ -895,7 +895,7 @@ declare namespace ts.server.protocol { /** * Signature help request; value of command field is "signatureHelp". - * Given a file location (file, line, col), return the signature + * Given a file location (file, line, col), return the signature * help. */ export interface SignatureHelpRequest extends FileLocationRequest { @@ -926,8 +926,8 @@ declare namespace ts.server.protocol { } /** - * GeterrForProjectRequest request; value of command field is - * "geterrForProject". It works similarly with 'Geterr', only + * GeterrForProjectRequest request; value of command field is + * "geterrForProject". It works similarly with 'Geterr', only * it request for every file in this project. */ export interface GeterrForProjectRequest extends Request { @@ -997,7 +997,7 @@ declare namespace ts.server.protocol { diagnostics: Diagnostic[]; } - /** + /** * Event message for "syntaxDiag" and "semanticDiag" event types. * These events provide syntactic and semantic errors for a file. */ @@ -1033,7 +1033,7 @@ declare namespace ts.server.protocol { export interface ReloadResponse extends Response { } - /** + /** * Arguments for saveto request. */ export interface SavetoRequestArgs extends FileRequestArgs { @@ -1109,7 +1109,7 @@ declare namespace ts.server.protocol { */ kindModifiers?: string; - /** + /** * The file in which the symbol is found. */ file: string; @@ -1156,7 +1156,7 @@ declare namespace ts.server.protocol { /** * Change request message; value of command field is "change". - * Update the server's view of the file named by argument 'file'. + * Update the server's view of the file named by argument 'file'. * Server does not currently send a response to a change request. */ export interface ChangeRequest extends FileLocationRequest {