• Home
  • Raw
  • Download

Lines Matching refs:node

49   public static isPropertyDeclarationNode(node: Node): boolean {
50 let parent: Node | undefined = node.parent;
57 return parent.name === node;
60 if (isComputedPropertyName(parent) && parent.expression === node) {
65 if (isBindingElement(parent) && parent.propertyName === node) {
70 if (isPropertySignature(parent) && parent.name === node) {
75 if (isMethodSignature(parent) && parent.name === node) {
80 if (isEnumMember(parent) && parent.name === node) {
85 if (isPropertyDeclaration(parent) && parent.name === node) {
90 if (isMethodDeclaration(parent) && parent.name === node) {
94 if (isSetAccessor(parent) && parent.name === node) {
98 return isGetAccessor(parent) && parent.name === node;
101 public static isPropertyOrElementAccessNode(node: Node): boolean {
102 return this.isPropertyAccessNode(node) || this.isElementAccessNode(node) || false;
105 public static isPropertyAccessNode(node: Node): boolean {
106 let parent: Node | undefined = node.parent;
112 if (isPropertyAccessExpression(parent) && parent.name === node) {
115 if (isPrivateIdentifier(node) && NodeUtils.isInClassDeclaration(parent)) {
118 return isQualifiedName(parent) && parent.right === node;
121 private static isInClassDeclaration(node: Node | undefined): boolean {
122 if (!node) {
126 if (isClassDeclaration(node) || isClassExpression(node)) {
130 return NodeUtils.isInClassDeclaration(node.parent);
133 public static isInClassDeclarationForTest(node: Node | undefined): boolean {
134 return NodeUtils.isInClassDeclaration(node);
137 private static isInExpression(node: Node | undefined): boolean {
138 return !!node && NodeUtils.isInOperator(node);
141 public static isInExpressionForTest(node: Node | undefined): boolean {
142 return NodeUtils.isInExpression(node);
145 private static isInOperator(node: Node): boolean {
146 return isBinaryExpression(node) && node.operatorToken.kind === SyntaxKind.InKeyword;
149 public static isInOperatorForTest(node: Node | undefined): boolean {
150 return NodeUtils.isInOperator(node);
153 public static isElementAccessNode(node: Node): boolean {
154 let parent: Node | undefined = node.parent;
159 return isElementAccessExpression(parent) && parent.argumentExpression === node;
162 public static isClassPropertyInConstructorParams(node: Node): boolean {
163 if (!isIdentifier(node)) {
167 if (!node.parent || !isParameter(node.parent)) {
171 const modifiers = getModifiers(node.parent);
176 return node.parent.parent && isConstructorDeclaration(node.parent.parent);
179 …public static isClassPropertyInConstructorBody(node: Node, constructorParams: Set<string>): boolea…
180 if (!isIdentifier(node)) {
184 const id: string = node.escapedText.toString();
185 let curNode: Node = node.parent;
197 public static isPropertyNode(node: Node): boolean {
198 if (this.isPropertyOrElementAccessNode(node)) {
202 return this.isPropertyDeclarationNode(node);
205 public static isObjectBindingPatternAssignment(node: ObjectBindingPattern): boolean {
206 if (!node || !node.parent || !isVariableDeclaration(node.parent)) {
210 const initializer: Expression = node.parent.initializer;
214 public static isDeclarationFile(node: SourceFile): boolean {
215 return node.isDeclarationFile;
218 public static getSourceFileOfNode(node: Node): SourceFile {
219 while (node && node.kind !== SyntaxKind.SourceFile) {
220 node = node.parent;
222 return <SourceFile>node;
225 public static isDETSFile(node: Node | undefined): boolean {
226 return !!node && NodeUtils.getSourceFileOfNode(node).fileName.endsWith(Extension.DETS);
229 public static isNewTargetNode(node: Identifier): boolean {
230 …if (isMetaProperty(node.parent) && node.parent.keywordToken === SyntaxKind.NewKeyword && node.esca…
236 public static findSymbolOfIdentifier(checker: TypeChecker, node: Identifier): Symbol | undefined {
237 let sym: Symbol | undefined = checker.getSymbolAtLocation(node);
245 let localSyms: Symbol[] = checker.getSymbolsInScope(node, sym.flags);
250 if (localSym && localSym.name === node.text && localSym.exportSymbol === sym) {