Chris2011 commented on issue #3509: URL: https://github.com/apache/netbeans/issues/3509#issuecomment-1023417592
Hey @PashaTurok I think you mixed two different things here. One is comment support while hitting enter to add a new '*' and also the other thing to add at the end of the comment. And adding code generators for getter/setter in TypeScript. So next time, please create one ticket for each feature. Code generator for getter and setter has nothing todo with the comments that you requested. Anyway, I had a look into the code generation stuff and found this tutorial: https://netbeans.apache.org/tutorials/nbm-code-generator.html The problem with this tutorial is, that is is very coupled to the JavaSource class which can handle all the stuff inside a Java file to identify what is a member, what is a class, what is an interface etc. Such feature, afaik is not available for JavaScript nor TypeScript. TypeScript was the first language which was implemented with the textmate lexer and I dunno whether we already have a class where we can figure out what is a variable, class, (A parser) etc. I think also this comes from the Language Server of TypeScript, if we can get the info from the server, that could be easier to handle. There is a PHP implementation somehow but someone created an ASTNode and all other stuff directly for PHP. I jumped into this too to check what they did for PHP and maybe we can use it but I dunno. There is a global parser but the rest needs to be handled differently. I can have a look when NetBeans starts to build again. As an alternative, we can use a 3rd-party-lib called tree-sitter and the java impl by JetBrains: https://github.com/JetBrains/jsitter. To parse a language, which is supported by this parser: http://tree-sitter.github.io/tree-sitter/. So differnet approach as ANTLR or JavaCC because you don't need to create a lexer before, I mean someone already did this but we don't need to do this by our own. So it creates a concrete syntax tree for this language. That means for all the supported languages of this parser we can try to use this and make this by our own. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
