Home
last modified time | relevance | path

Searched refs:node (Results 1 – 25 of 44) sorted by relevance

12

/interface/sdk-js/build-tools/collect_application_api/src/
Dcollect_application_api.js115 function judgeImportFile(node, importFiles) { argument
116 if (isImportFiles(node)) {
117 let importFileName = node.moduleSpecifier.text;
118 if (node.importClause && node.importClause.name !== undefined) {
121 importClass: node.importClause.name.escapedText,
123 } else if (node.importClause.namedBindings !== undefined &&
124 ts.isNamedImports(node.importClause.namedBindings)) {
125 node.importClause.namedBindings.elements.forEach(element => {
143 function collectApplicationApi(node, sourcefile, url, apiList) { argument
144 if (ts.isPropertyAccessExpression(node) && node.expression && ts.isIdentifier(node.name)) {
[all …]
Dapi_recognizer.js37 visitNode(node, fileName) { argument
38 if (this.isArkUIRenderMethod(node)) {
39 this.visitUIRenderNode(node.body, fileName);
41 this.visitNormalNode(node, fileName);
51 visitNormalNode(node, fileName) { argument
52 if (node) {
53 if (ts.isCallExpression(node)) {
54 this.recognizeNormalCallExpression(node, fileName);
56 this.recognizeNormal(node, fileName);
57 ts.forEachChild(node, (child) => {
[all …]
/interface/sdk-js/build-tools/api_check_plugin/src/
Dcheck_hump.js46 function getName(node) { argument
47 if (node.name.escapedText) {
48 return node.name.escapedText.toString();
49 } else if (node.name.text) {
50 return node.name.text.toString();
55 function isConstantDecorator(node, name) { argument
56 return hasAPINote(node) && getApiInfo(node).isConstant && !checkAllUppercaseHump(name);
59 function filterApiVersion(node, version) { argument
60 const apiVersion = getApiVersion(node);
64 function checkAPINameOfHump(node, sourcefile, fileName) { argument
[all …]
Dcheck_event_subscription.js22 function checkOnAndOffAppearInPair(node, sourcefile, fileName, onEventAllNames, onEventCheckNames, … argument
26 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.API_PAIR_ERRORS, checkErrorResult, LogT…
33 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.API_PAIR_ERRORS, checkErrorResult, LogT…
39 function checkTheFirstParameter(node, sourcefile, fileName) { argument
41 if (!checkVersionNeedCheck(node)) {
44 if (node.parameters && node.parameters.length > 0 && node.parameters[0].type) {
45 const firstParameterType = node.parameters[0].type;
53 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.PARAMETER_ERRORS, checkErrorResult, Log…
65 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.PARAMETER_ERRORS, checkErrorResult, Log…
71 function isBasicType(node) { argument
[all …]
Dapi_check_plugin.js77 return (node) => {
78 checkAPIFileName(node, fileName);
79 checkAllNode(node, node, fileName);
80 return node;
85 function checkAllNode(node, sourcefile, fileName) { argument
86 if (!ts.isImportDeclaration(node) && !ts.isSourceFile(node)) {
88 checkAPINameOfHump(node, sourcefile, fileName);
90 if (hasAPINote(node)) {
92 checkAPIDecorators(node, sourcefile, fileName);
94 checkSpelling(node, sourcefile, fileName);
[all …]
Dcheck_naming.js27 function checkNaming(node, sourcefile, fileName) { argument
29 const apiVersion = Number(getApiVersion(node));
35 checkApiNaming(node, sourcefile, fileName);
38 checkApiNaming(node, sourcefile, fileName);
45 function checkApiNaming(node, sourcefile, fileName) { argument
46 const lowIdentifier = node.getText().toLowerCase();
47 checkApiNamingWords(node, sourcefile, fileName, lowIdentifier);
48 checkApiNamingScenario(node, sourcefile, fileName, lowIdentifier);
51 function checkApiNamingWords(node, sourcefile, fileName, lowIdentifier) { argument
59 const internalWord = node.getText().substr(prohibitedWordIndex, key.length);
[all …]
Dcheck_legality.js24 function checkJsDocLegality(node, comments, checkInfoMap) { argument
26 legalityCheck(node, comments, commentNodeWhiteList, ['since'], true, checkInfoMap);
28 …legalityCheck(node, comments, getIllegalKinds([ts.SyntaxKind.ModuleDeclaration, ts.SyntaxKind.Clas…
31 legalityCheck(node, comments, [ts.SyntaxKind.VariableStatement], ['constant'], true, checkInfoMap,
37 legalityCheck(node, comments, [ts.SyntaxKind.EnumDeclaration], ['enum'], true, checkInfoMap);
39 legalityCheck(node, comments, [ts.SyntaxKind.ClassDeclaration], ['extends'], true, checkInfoMap,
54 …legalityCheck(node, comments, [ts.SyntaxKind.ModuleDeclaration], ['namespace'], true, checkInfoMap…
56 legalityCheck(node, comments, [ts.SyntaxKind.FunctionDeclaration, ts.SyntaxKind.MethodSignature,
67 legalityCheck(node, comments, [ts.SyntaxKind.FunctionDeclaration, ts.SyntaxKind.MethodSignature,
80 legalityCheck(node, comments, commentNodeWhiteList, ['useinstead'], true, checkInfoMap,
[all …]
Dcheck_any.js21 function checkAnyInAPI(node, sourcefile, fileName) { argument
22 if (node.kind === ts.SyntaxKind.AnyKeyword && checkVersionNeedCheck(node)) {
23 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.ILLEGAL_ANY, ErrorValueInfo.ILLEGAL_USE…
Dcheck_decorator.js23 function checkAPIDecorators(node, sourcefile, fileName) { argument
24 const apiNote = getAPINote(node);
25 if (API_ERROR_DECORATOR_POS.has(node.pos)) {
49 API_ERROR_DECORATOR_POS.add(node.pos);
51 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.UNKNOW_DECORATOR, errorInfo, FileType.J…
Dcompile_info.js29 function addAPICheckErrorLogs(node, sourcefile, fileName, errorType, errorInfo, type, level) { argument
37 const posOfNode = sourcefile.getLineAndCharacterOfPosition(node.getStart());
46 version: getApiInfo(node).version,
49 apiName: node.symbol ? node.symbol.escapedName : '',
50 apiFullText: node.getFullText(),
Dcheck_spelling.js30 function checkSpelling(node, sourcefile, fileName) { argument
31 if (ts.isIdentifier(node) && node.escapedText) {
32 checkWordSpelling(node.escapedText.toString(), node, sourcefile, fileName, FileType.API);
33 } else if (hasAPINote(node)) {
34 const apiNote = getAPINote(node);
37 checkWordSpelling(word, node, sourcefile, fileName, FileType.JSDOC);
43 function checkWordSpelling(nodeText, node, sourcefile, fileName, type) { argument
70 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.MISSPELL_WORDS, errorInfo, type, ErrorL…
Dcheck_diff_changes.js91 function checkApiChangeVersion(currentJSDoc, lastJSDoc, node) { argument
97 node: node, property
155 function checkCurrentJSDocChange(newNodeJSDocs, statusCode, node) { argument
162 checkApiChangeVersion(currentJSDoc, lastJSDoc, node);
168 node: node, property
192 node: node, property
229 node: change.newNode, property
236 node: change.newNode, property
242 node: change.newNode, property
292 node: change.newNode, property
[all …]
Dutils.js55 function getAPINote(node) { argument
56 const apiLength = node.getText().length;
57 const apiFullLength = node.getFullText().length;
58 return node.getFullText().substring(0, apiFullLength - apiLength);
62 function hasAPINote(node) { argument
63 if (!node) {
66 const apiNote = getAPINote(node).replace(/[\s]/g, '');
219 function getApiInfo(node) { argument
220 const notesStr = getAPINote(node);
270 function getApiVersion(node) { argument
[all …]
Dcheck_syscap.js20 function checkSyscap(node, sourcefile, fileName) { argument
22 const apiNote = getAPINote(node);
34 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.UNKNOW_SYSCAP, errorInfo, FileType.JSDO…
/interface/sdk-js/build-tools/
Ddelete_systemapi_plugin.js200 return (node) => {
201 sourceFile = node;
202 collectAllIdentifier(node); // 获取所有标识符
203 node = formatAllNodes(node); // 获取所有节点
204 if (!isEmptyFile(node)) {
206 let result = printer.printNode(ts.EmitHint.Unspecified, node, sourceFile);
211 copyrightMessage = node.getFullText().replace(node.getText(), '');
222 return node;
224 function collectAllIdentifier(node) { argument
225 if (ts.isSourceFile(node) && node.statements) {
[all …]
/interface/sdk-js/build-tools/jsdoc_format_plugin/src/core/
DapiSplitProcessor.ts43 onTransformNode(node: comment.CommentNode): ts.Node | undefined {
44 if (node.astNode === undefined) {
47 const nodeProcessor = nodeProcessorMap.get(node.astNode.kind);
48 return nodeProcessor ? nodeProcessor(node.astNode, this.context) : undefined;
57 static splitEventValues(node: ts.Node): string[] {
59 …if (ts.isFunctionDeclaration(node) || ts.isMethodDeclaration(node) || ts.isMethodSignature(node)) {
61 if (node.name && ts.isIdentifier(node.name)) {
62 functionName = node.name.getText();
67 if ((node.parameters[0].type) && (node.parameters[0].type.kind === ts.SyntaxKind.UnionType)) {
68 … const types: ts.NodeArray<ts.TypeNode> = (node.parameters[0].type as ts.UnionTypeNode).types;
[all …]
DmodificationProcessor.ts48 onVisitNode(node: comment.CommentNode): void {
49 if (node.astNode) {
50 const curNode: ts.Node = node.astNode;
52 …const checkResults = apiChecker.checkJSDoc(node.astNode, node.astNode?.getSourceFile(), this.conte…
54 … const newCommentInfos: comment.CommentInfo[] = node.commentInfos ? [...node.commentInfos] : [];
60 …this.addInheritTags(node, curNode, commentInfo, newCommentInfos, index === newCommentInfos.length …
64 if (newCommentIndexs.length > 0 && node.commentInfos) {
72 …this.addMissingTags(node, curNode, curCommentInfo, newCommentInfos, checkResult.missingTags, index…
88 CommentHelper.setComment(node.astNode, newCommentInfos);
91 addInheritTags(node: comment.CommentNode, curNode: ts.Node, commentInfo: comment.CommentInfo,
[all …]
DrawCodeProcessor.ts35 onVisitNode(node: comment.CommentNode): void {
36 if (node.astNode) {
37 const nodeSignature = AstNodeHelper.getNodeSignature(node.astNode);
41 const sourceFile = node.astNode.getSourceFile();
45 const { line, character } = sourceFile.getLineAndCharacterOfPosition(node.astNode.getStart());
46 this.rawSourceCodeInfo?.addRawNodeInfo(nodeSignature, node.astNode, line + 1, character);
DoutputProcessor.ts54 onVisitNode(node: comment.CommentNode): void {
55 if (node.astNode && node.commentInfos && node.commentInfos.length > 0) {
56 CommentHelper.addComment(node.astNode, node.commentInfos);
92 private nodeVisitor(node: ts.Node): void {
93 if (!ts.isNumericLiteral(node)) {
94 node.forEachChild((child) => {
98 const value = node.getText().trim();
114 this.content = StringUtils.replaceAt(this.content!, node.getStart(), replacement);
DasynchronousFunctionProcessor.ts47 logReportProcess(node: MethodNodeType, comments: Array<comment.CommentInfo>): void {
48 const apiName: string = node.name ? node.name.getText() : ''; constant
50 …const modifyLogResult: ModifyLogResult = LogResult.createModifyResult(node, comments, description,…
107 isAsynchronousFunction(node: MethodNodeType): boolean {
108 if (node.type && (node.type.kind === ts.SyntaxKind.TypeReference) &&
109 (node.type as ts.TypeReferenceNode).typeName.getText() === 'Promise') {
112 if (node.parameters.length !== 0) {
113 for (let i = node.parameters.length - 1; i >= 0; i--) {
114 const param: ts.ParameterDeclaration = node.parameters[i];
DcoreImpls.ts158 private shouldNotify(node: ts.Node): boolean {
160 return this.commentNodeWhiteList.includes(node.kind);
163 private shouldForEachChildren(node: ts.Node): boolean {
167 …private getCommentNode(node: ts.Node, parentNode: comment.CommentNode | undefined, sourceFile: ts.…
168 …const leadingComments: comment.CommentInfo[] = CommentHelper.getNodeLeadingComments(node, sourceFi…
170 astNode: node,
195 function visitor(node: ts.Node): ts.Node {
196 const commentNode = thiz.getCommentNode(node, undefined, transformSourceFile!);
198 return ts.visitEachChild(newNode ? newNode : node, visitor, context);
221 …function nodeVisitor(node: ts.Node, parentNode: comment.CommentNode | undefined, sourceFile: ts.So…
[all …]
/interface/sdk-js/build-tools/api_check_plugin/src/check_jsdoc_value/
Dcheck_order.js74 function checkAPITagName(tag, node, sourcefile, fileName, JSDocIndec) { argument
82 if (!decoratorRuleSet.has(tagName) && commentNodeWhiteList.includes(node.kind)) {
85 …addAPICheckErrorLogs(node, sourcefile, fileName, ErrorType.WRONG_SCENE, APITagNameResult.errorInfo,
92 function checkParentInheritTag(node, inheritTag, inheritResult, JSocIndex) { argument
94 if (ts.isSourceFile(node.parent)) {
97 if (!ts.isModuleBlock(node.parent)) {
98 const comments = parseJsDoc(node.parent);
107 checkParentInheritTag(node.parent, inheritTag, inheritResult, JSocIndex);
110 } else if (ts.isModuleBlock(node.parent)) {
111 checkParentInheritTag(node.parent, inheritTag, inheritResult, JSocIndex);
[all …]
Dcheck_rest_value.js21 function checkExtendsValue(tag, node, fileName) { argument
28 if (ts.isClassDeclaration(node) || ts.isInterfaceDeclaration(node)) {
29 const apiValue = node.heritageClauses ? node.heritageClauses[0].types[0].getText() : '';
39 function checkEnumValue(tag, node, fileName) { argument
57 function checkSinceValue(tag, node, fileName) { argument
64 if (!checkNumber && commentNodeWhiteList.includes(node.kind)) {
72 function checkReturnsValue(tag, node, fileName) { argument
79 if (!commentNodeWhiteList.includes(node.kind)) {
82 let apiReturnsValue = getDeclareValue(node.type);
100 function checkParamValue(tag, node, fileName, tagIndex) { argument
[all …]
/interface/sdk-js/build-tools/dts_parser/src/core/
DcoreImpl.ts60 static getNodeLeadingComments(node: ts.Node, sourceFile: ts.SourceFile): comment.CommentInfo[] {
62 …entRange[] | undefined = ts.getLeadingCommentRanges(sourceFile.getFullText(), node.getFullStart());
76 LogUtil.d('CommentHelper', `node(kind=${node.kind}) is created in memory.`);
241 …static getNodeInfo(node: ts.Node, jsDocInfo: JsDocInfo, options: Options): BasicApiInfo | undefine…
243 const nodeProcessor: NodeProcessorInterface | undefined = nodeProcessorMap.get(node.kind);
247 apiInfo = nodeProcessor(node, jsDocInfo, options);
251 static processNode(node: ts.Node, sourceFile: ts.SourceFile, parentVersion: number = -1,
253 …const allCommentInfos: comment.CommentInfo[] = CommentHelper.getNodeLeadingComments(node, sourceFi…
272 …const apiInfo: BasicApiInfo | undefined = NodeProcessorHelper.getNodeInfo(node, jsDocInfo, options…
276 …nst containerNodes: ts.NodeArray<ts.Node> | undefined = NodeProcessorHelper.getContainerNode(node);
[all …]
/interface/sdk-js/build-tools/api_diff/src/
Djsdoc_diff.js166 while (!syscap && !ts.isSourceFile(curApi.node)) {
169 if (!syscap && ts.isSourceFile(curApi.node)) {
170 const fileContent = curApi.node.getFullText();
188 while (curApi && !ts.isSourceFile(curApi.node)) {
289 oldApi.node,
290 newApi.node
318 oldApi.node,
319 newApi.node
349 oldApi.node,
350 newApi.node
[all …]

12