@@ -19,8 +19,11 @@ import {
19
19
isClass ,
20
20
normalizeTagType ,
21
21
logDocumentationError ,
22
- displayDocumentationErrors
22
+ displayDocumentationErrors ,
23
+ toKebabCase
23
24
} from "./utils.mjs" ;
25
+ import { generateCustomData } from "cem-plugin-vs-code-custom-data-generator" ;
26
+ import { customElementJetBrainsPlugin } from "custom-element-jet-brains-integration" ;
24
27
25
28
const packageJSON = JSON . parse ( fs . readFileSync ( "./package.json" ) ) ;
26
29
@@ -169,6 +172,23 @@ function processClass(ts, classNode, moduleDoc) {
169
172
member . _ui5noAttribute = propertyDecorator ?. expression ?. arguments [ 0 ] ?. properties ?. find ( property => property . name . text === "noAttribute" ) ?. initializer ?. kind === ts . SyntaxKind . TrueKeyword || undefined ;
170
173
}
171
174
175
+ if ( currClass . customElement && member . privacy === "public" && ! propertyDecorator ?. expression ?. arguments [ 0 ] ?. properties ?. find ( property => property . name . text === "multiple" ) && ! [ "object" ] . includes ( member . _ui5validator ?. toLowerCase ( ) ) ) {
176
+ const filename = classNode . getSourceFile ( ) . fileName ;
177
+ const sourceFile = typeProgram . getSourceFile ( filename ) ;
178
+ const tsProgramClassNode = sourceFile . statements . find ( statement => ts . isClassDeclaration ( statement ) && statement . name ?. text === classNode . name ?. text ) ;
179
+ const tsProgramMember = tsProgramClassNode . members . find ( m => ts . isPropertyDeclaration ( m ) && m . name ?. text === member . name ) ;
180
+ const attributeValue = typeChecker . typeToString ( typeChecker . getTypeAtLocation ( tsProgramMember ) , tsProgramMember ) ;
181
+
182
+ currClass . attributes . push ( {
183
+ description : member . description ,
184
+ name : toKebabCase ( member . name ) ,
185
+ default : member . default ,
186
+ fieldName : member . name ,
187
+ type : { text : attributeValue } ,
188
+ deprecated : member . deprecated
189
+ } )
190
+ }
191
+
172
192
if ( hasTag ( memberParsedJsDoc , "formProperty" ) ) {
173
193
member . _ui5formProperty = true ;
174
194
}
@@ -334,7 +354,7 @@ const processPublicAPI = object => {
334
354
if ( ( key === "privacy" && object [ key ] !== "public" ) || ( key === "_ui5privacy" && object [ key ] !== "public" ) ) {
335
355
return true ;
336
356
} else if ( typeof object [ key ] === "object" ) {
337
- if ( key === "cssParts" || key === "_ui5implements" ) {
357
+ if ( key === "cssParts" || key === "attributes" || key === " _ui5implements") {
338
358
continue ;
339
359
}
340
360
@@ -475,5 +495,7 @@ export default {
475
495
}
476
496
}
477
497
} ,
498
+ generateCustomData ( { outdir : "dist" , cssFileName : null , cssPropertiesDocs : false } ) ,
499
+ customElementJetBrainsPlugin ( { outdir : "dist" , cssFileName : null , cssPropertiesDocs : false } )
478
500
] ,
479
501
} ;
0 commit comments