/third_party/typescript/src/services/formatting/ |
D | rules.ts | 10 const allTokens: SyntaxKind[] = []; 11 for (let token = SyntaxKind.FirstToken; token <= SyntaxKind.LastToken; token++) { 12 if (token !== SyntaxKind.EndOfFileToken) { 16 function anyTokenExcept(...tokens: SyntaxKind[]): TokenRange { 21 …const anyTokenIncludingMultilineComments = tokenRangeFrom([...allTokens, SyntaxKind.MultiLineComme… 22 const anyTokenIncludingEOF = tokenRangeFrom([...allTokens, SyntaxKind.EndOfFileToken]); 23 const keywords = tokenRangeFromRange(SyntaxKind.FirstKeyword, SyntaxKind.LastKeyword); 24 …const binaryOperators = tokenRangeFromRange(SyntaxKind.FirstBinaryOperator, SyntaxKind.LastBinaryO… 25 …aryKeywordOperators = [SyntaxKind.InKeyword, SyntaxKind.InstanceOfKeyword, SyntaxKind.OfKeyword, S… constant 26 …const unaryPrefixOperators = [SyntaxKind.PlusPlusToken, SyntaxKind.MinusMinusToken, SyntaxKind.Til… constant [all …]
|
D | smartIndenter.ts | 39 … if (enclosingCommentRange && enclosingCommentRange.kind === SyntaxKind.MultiLineCommentTrivia) { 62 …if (precedingToken.kind === SyntaxKind.CommaToken && precedingToken.parent.kind !== SyntaxKind.Bin… 276 (parent.kind === SyntaxKind.SourceFile || !parentAndChildShareLine); 297 if (nextToken.kind === SyntaxKind.OpenBraceToken) { 301 else if (nextToken.kind === SyntaxKind.CloseBraceToken) { 333 … if (parent.kind === SyntaxKind.IfStatement && (<IfStatement>parent).elseStatement === child) { 334 const elseKeyword = findChildOfKind(parent, SyntaxKind.ElseKeyword, sourceFile)!; 417 case SyntaxKind.TypeReference: 419 case SyntaxKind.ObjectLiteralExpression: 421 case SyntaxKind.ArrayLiteralExpression: [all …]
|
/third_party/typescript/src/linter/ |
D | TypeScriptLinterConfig.ts | 137 static terminalTokens: Set<SyntaxKind> = new Set([ 138 SyntaxKind.OpenBraceToken, SyntaxKind.CloseBraceToken, SyntaxKind.OpenParenToken, 139 SyntaxKind.CloseParenToken, SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken, 140 … SyntaxKind.DotToken, SyntaxKind.DotDotDotToken, SyntaxKind.SemicolonToken, SyntaxKind.CommaToken, 141 SyntaxKind.QuestionDotToken, SyntaxKind.LessThanToken, SyntaxKind.LessThanSlashToken, 142 SyntaxKind.GreaterThanToken, SyntaxKind.LessThanEqualsToken, SyntaxKind.GreaterThanEqualsToken, 143 …SyntaxKind.EqualsEqualsToken, SyntaxKind.ExclamationEqualsToken, SyntaxKind.EqualsEqualsEqualsToke… 144 … SyntaxKind.ExclamationEqualsEqualsToken, SyntaxKind.EqualsGreaterThanToken, SyntaxKind.PlusToken, 145 SyntaxKind.MinusToken, SyntaxKind.AsteriskToken, SyntaxKind.AsteriskAsteriskToken, 146 …SyntaxKind.SlashToken, SyntaxKind.PercentToken, SyntaxKind.PlusPlusToken, SyntaxKind.MinusMinusTok… [all …]
|
/third_party/typescript/src/compiler/factory/ |
D | nodeTests.ts | 5 return node.kind === SyntaxKind.NumericLiteral; 9 return node.kind === SyntaxKind.BigIntLiteral; 13 return node.kind === SyntaxKind.StringLiteral; 17 return node.kind === SyntaxKind.JsxText; 21 return node.kind === SyntaxKind.RegularExpressionLiteral; 25 return node.kind === SyntaxKind.NoSubstitutionTemplateLiteral; 31 return node.kind === SyntaxKind.TemplateHead; 35 return node.kind === SyntaxKind.TemplateMiddle; 39 return node.kind === SyntaxKind.TemplateTail; 45 return node.kind === SyntaxKind.Identifier; [all …]
|
D | parenthesizerRules.ts | 5 cachedLiteralKind: SyntaxKind; 38 …function binaryOperandNeedsParentheses(binaryOperator: SyntaxKind, operand: Expression, isLeftSide… 56 …const binaryOperatorPrecedence = getOperatorPrecedence(SyntaxKind.BinaryExpression, binaryOperator… 57 …const binaryOperatorAssociativity = getOperatorAssociativity(SyntaxKind.BinaryExpression, binaryOp… 59 …if (!isLeftSideOfBinary && operand.kind === SyntaxKind.ArrowFunction && binaryOperatorPrecedence >… 71 && operand.kind === SyntaxKind.YieldExpression) { 112 if (binaryOperator === SyntaxKind.PlusToken) { 113 …const leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : SyntaxKind.Unknown; 140 function operatorHasAssociativeProperty(binaryOperator: SyntaxKind) { 149 return binaryOperator === SyntaxKind.AsteriskToken [all …]
|
/third_party/typescript/src/services/ |
D | breakpoints.ts | 71 case SyntaxKind.VariableStatement: 75 case SyntaxKind.VariableDeclaration: 76 case SyntaxKind.PropertyDeclaration: 77 case SyntaxKind.PropertySignature: 80 case SyntaxKind.Parameter: 83 case SyntaxKind.FunctionDeclaration: 84 case SyntaxKind.MethodDeclaration: 85 case SyntaxKind.MethodSignature: 86 case SyntaxKind.GetAccessor: 87 case SyntaxKind.SetAccessor: [all …]
|
D | preProcess.ts | 16 let lastToken: SyntaxKind; 17 let currentToken: SyntaxKind; 26 if (currentToken === SyntaxKind.OpenBraceToken) { 29 else if (currentToken === SyntaxKind.CloseBraceToken) { 65 if (token === SyntaxKind.DeclareKeyword) { 68 if (token === SyntaxKind.ModuleKeyword) { 70 if (token === SyntaxKind.StringLiteral) { 84 if (lastToken === SyntaxKind.DotToken) { 88 if (token === SyntaxKind.ImportKeyword) { 90 if (token === SyntaxKind.OpenParenToken) { [all …]
|
D | classifier.ts | 13 let token = SyntaxKind.Unknown; 14 let lastNonTriviaToken = SyntaxKind.Unknown; 36 const templateStack: SyntaxKind[] = []; 42 templateStack.push(SyntaxKind.TemplateHead); 85 } while (token !== SyntaxKind.EndOfFileToken); 89 case SyntaxKind.SlashToken: 90 case SyntaxKind.SlashEqualsToken: 91 …f (!noRegexTable[lastNonTriviaToken] && scanner.reScanSlashToken() === SyntaxKind.RegularExpressio… 92 token = SyntaxKind.RegularExpressionLiteral; 95 case SyntaxKind.LessThanToken: [all …]
|
D | utilities.ts | 27 case SyntaxKind.VariableDeclaration: 30 case SyntaxKind.Parameter: 31 case SyntaxKind.BindingElement: 32 case SyntaxKind.PropertyDeclaration: 33 case SyntaxKind.PropertySignature: 34 case SyntaxKind.PropertyAssignment: 35 case SyntaxKind.ShorthandPropertyAssignment: 36 case SyntaxKind.MethodDeclaration: 37 case SyntaxKind.MethodSignature: 38 case SyntaxKind.Constructor: [all …]
|
D | documentHighlights.ts | 54 case SyntaxKind.IfKeyword: 55 case SyntaxKind.ElseKeyword: 57 case SyntaxKind.ReturnKeyword: 59 case SyntaxKind.ThrowKeyword: 61 case SyntaxKind.TryKeyword: 62 case SyntaxKind.CatchKeyword: 63 case SyntaxKind.FinallyKeyword: 64 … const tryStatement = node.kind === SyntaxKind.CatchKeyword ? node.parent.parent : node.parent; 66 case SyntaxKind.SwitchKeyword: 68 case SyntaxKind.CaseKeyword: [all …]
|
D | completions.ts | 184 …ontextToken.kind === SyntaxKind.BreakKeyword || contextToken.kind === SyntaxKind.ContinueKeyword |… 215 … return location?.kind === SyntaxKind.Identifier ? createTextSpanFromNode(location) : undefined; 243 …const hasClosingAngleBracket = !!findChildOfKind(location.parent, SyntaxKind.GreaterThanToken, sou… 405 const dot = findChildOfKind(propertyAccessToConvert, SyntaxKind.DotToken, sourceFile) || 406 findChildOfKind(propertyAccessToConvert, SyntaxKind.QuestionDotToken, sourceFile); 814 case SyntaxKind.Identifier: 816 case SyntaxKind.EqualsToken: 818 case SyntaxKind.VariableDeclaration: 820 case SyntaxKind.BinaryExpression: 822 case SyntaxKind.JsxAttribute: [all …]
|
D | outliningElementsCollector.ts | 29 …createOutliningSpanFromBounds(findChildOfKind(statements[firstImport], SyntaxKind.ImportKeyword, s… 37 … if (isDeclaration(n) || isVariableStatement(n) || n.kind === SyntaxKind.EndOfFileToken) { 112 case SyntaxKind.SingleLineCommentTrivia: 129 case SyntaxKind.MultiLineCommentTrivia: 154 case SyntaxKind.Block: 162 case SyntaxKind.DoStatement: 163 case SyntaxKind.ForInStatement: 164 case SyntaxKind.ForOfStatement: 165 case SyntaxKind.ForStatement: 166 case SyntaxKind.IfStatement: [all …]
|
D | symbolDisplay.ts | 14 return getDeclarationOfKind(symbol, SyntaxKind.ClassExpression) ? 44 if (location.kind === SyntaxKind.ThisKeyword && isExpression(location)) { 89 case SyntaxKind.JsxOpeningElement: 90 case SyntaxKind.JsxElement: 91 case SyntaxKind.JsxSelfClosingElement: 92 …return location.kind === SyntaxKind.Identifier ? ScriptElementKind.memberVariableElement : ScriptE… 93 case SyntaxKind.JsxAttribute: 158 …const isThisExpression = location.kind === SyntaxKind.ThisKeyword && isInExpressionContext(locatio… 165 if (location.kind === SyntaxKind.ThisKeyword && !isThisExpression) { 166 …return { displayParts: [keywordPart(SyntaxKind.ThisKeyword)], documentation: [], symbolKind: Scrip… [all …]
|
D | jsDoc.ts | 104 case SyntaxKind.JSDocParameterTag: 105 case SyntaxKind.JSDocPropertyTag: 107 case SyntaxKind.JSDocCallbackTag: 108 case SyntaxKind.JSDocTypedefTag: 129 case SyntaxKind.JSDocImplementsTag: 131 case SyntaxKind.JSDocAugmentsTag: 133 case SyntaxKind.JSDocTemplateTag: 135 case SyntaxKind.JSDocTypeTag: 137 case SyntaxKind.JSDocTypedefTag: 138 case SyntaxKind.JSDocCallbackTag: [all …]
|
D | navigationBar.ts | 89 function navigationBarNodeKind(n: NavigationBarNode): SyntaxKind { 206 case SyntaxKind.Constructor: 219 case SyntaxKind.MethodDeclaration: 220 case SyntaxKind.GetAccessor: 221 case SyntaxKind.SetAccessor: 222 case SyntaxKind.MethodSignature: 228 case SyntaxKind.PropertyDeclaration: 233 case SyntaxKind.PropertySignature: 239 case SyntaxKind.ImportClause: 252 if (namedBindings.kind === SyntaxKind.NamespaceImport) { [all …]
|
/third_party/typescript/src/compiler/ |
D | parser.ts | 17 let NodeConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node; 18 let TokenConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node; 19 let IdentifierConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node; 20 let PrivateIdentifierConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node; 21 let SourceFileConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node; 77 if (!node || node.kind <= SyntaxKind.LastToken) { 81 case SyntaxKind.QualifiedName: 84 case SyntaxKind.TypeParameter: 89 case SyntaxKind.ShorthandPropertyAssignment: 97 case SyntaxKind.SpreadAssignment: [all …]
|
D | utilitiesPublic.ts | 247 if (d && d.kind === SyntaxKind.TypeParameter) { 249 …if (isFunctionLike(current) || isClassLike(current) || current.kind === SyntaxKind.InterfaceDeclar… 258 …cModifier(node, ModifierFlags.ParameterPropertyModifier) && parent.kind === SyntaxKind.Constructor; 288 if (node.kind === SyntaxKind.VariableDeclaration) { 291 if (node && node.kind === SyntaxKind.VariableDeclarationList) { 295 if (node && node.kind === SyntaxKind.VariableStatement) { 513 case SyntaxKind.VariableStatement: 518 case SyntaxKind.ExpressionStatement: 520 …if (expr.kind === SyntaxKind.BinaryExpression && (expr as BinaryExpression).operatorToken.kind ===… 524 case SyntaxKind.PropertyAccessExpression: [all …]
|
D | scanner.ts | 5 export function tokenIsIdentifierOrKeyword(token: SyntaxKind): boolean { 6 return token >= SyntaxKind.Identifier; 10 export function tokenIsIdentifierOrKeywordOrGreaterThan(token: SyntaxKind): boolean { 11 return token === SyntaxKind.GreaterThanToken || tokenIsIdentifierOrKeyword(token); 16 getToken(): SyntaxKind; 35 reScanGreaterToken(): SyntaxKind; 36 reScanSlashToken(): SyntaxKind; 37 reScanAsteriskEqualsToken(): SyntaxKind; 38 reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind; 39 reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind; [all …]
|
D | utilities.ts | 261 while (node && node.kind !== SyntaxKind.SourceFile) { 275 …if (decorator.expression.kind === SyntaxKind.Identifier && (<Identifier>(decorator.expression)).es… 283 while (node && node.kind !== SyntaxKind.EtsComponentExpression) { 284 if (node.kind === SyntaxKind.CallExpression) { 287 else if (node.kind === SyntaxKind.PropertyAccessExpression) { 303 …CallExpression>getAncestor(isCallExpression(node) ? node.parent : node, SyntaxKind.CallExpression); 315 … const ancestor = <ObjectLiteralExpression>getAncestor(node, SyntaxKind.ObjectLiteralExpression); 323 if (decorator.expression.kind === SyntaxKind.CallExpression) { 326 …if (identifier.kind === SyntaxKind.Identifier && extendDecorator?.includes((<Identifier>identifier… 328 if (args[0].kind === SyntaxKind.Identifier) { [all …]
|
D | binder.ts | 42 case SyntaxKind.InterfaceDeclaration: 43 case SyntaxKind.TypeAliasDeclaration: 46 case SyntaxKind.EnumDeclaration: 52 case SyntaxKind.ImportDeclaration: 53 case SyntaxKind.ImportEqualsDeclaration: 59 case SyntaxKind.ExportDeclaration: 61 …xportDeclaration.exportClause && exportDeclaration.exportClause.kind === SyntaxKind.NamedExports) { 76 case SyntaxKind.ModuleBlock: { 98 case SyntaxKind.ModuleDeclaration: 100 case SyntaxKind.Identifier: [all …]
|
D | types.ts | 21 export const enum SyntaxKind { enum 453 | SyntaxKind.SingleLineCommentTrivia 454 | SyntaxKind.MultiLineCommentTrivia 455 | SyntaxKind.NewLineTrivia 456 | SyntaxKind.WhitespaceTrivia 457 | SyntaxKind.ShebangTrivia 458 | SyntaxKind.ConflictMarkerTrivia 462 | SyntaxKind.NumericLiteral 463 | SyntaxKind.BigIntLiteral 464 | SyntaxKind.StringLiteral [all …]
|
/third_party/typescript/src/compiler/transformers/ |
D | utilities.ts | 32 … return node.kind === SyntaxKind.SourceFile ? transformSourceFile(node) : transformBundle(node); 82 case SyntaxKind.ImportDeclaration: 96 case SyntaxKind.ImportEqualsDeclaration: 97 … if ((<ImportEqualsDeclaration>node).moduleReference.kind === SyntaxKind.ExternalModuleReference) { 104 case SyntaxKind.ExportDeclaration: 136 case SyntaxKind.ExportAssignment: 143 case SyntaxKind.VariableStatement: 151 case SyntaxKind.FunctionDeclaration: 172 case SyntaxKind.ClassDeclaration: 261 expression.kind === SyntaxKind.NumericLiteral || [all …]
|
D | ts.ts | 59 context.enableSubstitution(SyntaxKind.PropertyAccessExpression); 60 context.enableSubstitution(SyntaxKind.ElementAccessExpression); 92 if (node.kind === SyntaxKind.Bundle) { 100 if (prepend.kind === SyntaxKind.InputFiles) { 161 case SyntaxKind.SourceFile: 162 case SyntaxKind.CaseBlock: 163 case SyntaxKind.ModuleBlock: 164 case SyntaxKind.Block: 170 case SyntaxKind.ClassDeclaration: 171 case SyntaxKind.FunctionDeclaration: [all …]
|
/third_party/typescript/tests/baselines/reference/ |
D | enums.types | 2 enum SyntaxKind { 3 >SyntaxKind : SyntaxKind 6 >ImportClause : SyntaxKind.ImportClause 9 >ExportDeclaration : SyntaxKind.ExportDeclaration 24 export type { SyntaxKind }; 25 >SyntaxKind : SyntaxKind 31 import type { SyntaxKind, SymbolFlags } from './a'; 32 >SyntaxKind : SyntaxKind 35 SyntaxKind.ImportClause; 36 >SyntaxKind.ImportClause : SyntaxKind.ImportClause [all …]
|
D | APISample_linter.js | 26 case ts.SyntaxKind.ForStatement: 27 case ts.SyntaxKind.ForInStatement: 28 case ts.SyntaxKind.WhileStatement: 29 case ts.SyntaxKind.DoStatement: 30 if ((<ts.IterationStatement>node).statement.kind !== ts.SyntaxKind.Block) { 35 case ts.SyntaxKind.IfStatement: 37 if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) { 41 ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && 42 ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { 47 case ts.SyntaxKind.BinaryExpression: [all …]
|