You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "AtarisMio (GitHub)" <gi...@apache.org> on 2019/11/04 04:05:27 UTC
[GitHub] [dubbo-js] AtarisMio opened pull request #149: update
ts-simple-ast to ts-morph
ts-simple-ast版本太老了,而且已经被deprecated了
[ Full content available at: https://github.com/apache/dubbo-js/pull/149 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [dubbo-js] hufeng commented on issue #149: update
ts-simple-ast to ts-morph
Posted by "hufeng (GitHub)" <gi...@apache.org>.
+1
[ Full content available at: https://github.com/apache/dubbo-js/pull/149 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [dubbo-js] creasy2010 commented on pull request #149: update
ts-simple-ast to ts-morph
Posted by "creasy2010 (GitHub)" <gi...@apache.org>.
注释信息放在文件结尾

```typescript
this.sourceFile.insertText(this.sourceFile.getFullText().length,'\n//generate by interpret-cli dubbo2.js');
```
[ Full content available at: https://github.com/apache/dubbo-js/pull/149 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [dubbo-js] hufeng commented on issue #149: update
ts-simple-ast to ts-morph
Posted by "hufeng (GitHub)" <gi...@apache.org>.
@sunchuanleihit @hsiaosiyuan0 please help review
[ Full content available at: https://github.com/apache/dubbo-js/pull/149 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [dubbo-js] creasy2010 commented on issue #149: update
ts-simple-ast to ts-morph
Posted by "creasy2010 (GitHub)" <gi...@apache.org>.
It looks very good. After testing the 2000+ file, I only found two small details.

The order of the fields changes, we seem to have no way to modify
The reference information is as follows:
https://ts-morph.com/details/classes
https://ts-morph.com/details/source-files#save
[ Full content available at: https://github.com/apache/dubbo-js/pull/149 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [dubbo-js] AtarisMio commented on issue #149: update
ts-simple-ast to ts-morph
Posted by "AtarisMio (GitHub)" <gi...@apache.org>.
@creasy2010
https://github.com/dsherret/ts-morph/blob/c68d8e2d0770bdcbfb2b614a623900c5fd468fca/src/structurePrinters/class/ClassDeclarationStructurePrinter.ts#L25-L34
this is the reason why the fields are printed before the constructor. If we wanna the code fully consistent, maybe there is only way that is using insert api to do that.
[ Full content available at: https://github.com/apache/dubbo-js/pull/149 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [dubbo-js] AtarisMio commented on issue #149: update
ts-simple-ast to ts-morph
Posted by "AtarisMio (GitHub)" <gi...@apache.org>.
> It looks great. Besides deprecated, does the `ts-simple-ast` mess up the translator? If not, I'd like to mark this PR as pending until I've done the refactor of translator
@hsiaosiyuan0 sorry, I don't compare it, I upgrade to `ts-morph` because I translate the code meets error when I use `ts-simple-ast`. I cannot find the reason for this error. And when I upgrade to the `ts-morph` the error dispaired.
```shell
为com.qf58.client.support.DtoResult,{"classPath":"com.qf58.client.support.DtoResult","packagePath":"com.qf58.client.support.","className":"DtoResult","isEnum":false,"isAbstract":false,"isInterface":false,"isClass":true,"isProvider":false} 添加内容出错, Error: Error replacing tree: Should not have more children left over.
at DefaultParentHandler.handleNode (/builds/fes/dubbo_service/dubbo-ci/node_modules/ts-simple-ast/dist/manipulation/tree/nodeHandlers/DefaultParentHandler.js:59:19)
at ParentFinderReplacementNodeHandler.handleNode (/builds/fes/dubbo_service/dubbo-ci/node_modules/ts-simple-ast/dist/manipulation/tree/nodeHandlers/ParentFinderReplacementNodeHandler.js:31:36)
at NodeHandlerHelper.handleForValues (/builds/fes/dubbo_service/dubbo-ci/node_modules/ts-simple-ast/dist/manipulation/tree/nodeHandlers/NodeHandlerHelper.js:10:21)
at ParentFinderReplacementNodeHandler.StraightReplacementNodeHandler.handleNode (/builds/fes/dubbo_service/dubbo-ci/node_modules/ts-simple-ast/dist/manipulation/tree/nodeHandlers/StraightReplacementNodeHandler.js:32:29)
at ParentFinderReplacementNodeHandler.handleNode (/builds/fes/dubbo_service/dubbo-ci/node_modules/ts-simple-ast/dist/manipulation/tree/nodeHandlers/ParentFinderReplacementNodeHandler.js:34:41)
at NodeHandlerHelper.handleForValues (/builds/fes/dubbo_service/dubbo-ci/node_modules/ts-simple-ast/dist/manipulation/tree/nodeHandlers/NodeHandlerHelper.js:10:21)
at ParentFinderReplacementNodeHandler.StraightReplacementNodeHandler.handleNode (/builds/fes/dubbo_service/dubbo-ci/node_modules/ts-simple-ast/dist/manipulation/tree/nodeHandlers/StraightReplacementNodeHandler.js:32:29)
at ParentFinderReplacementNodeHandler.handleNode (/builds/fes/dubbo_service/dubbo-ci/node_modules/ts-simple-ast/dist/manipulation/tree/nodeHandlers/ParentFinderReplacementNodeHandler.js:34:41)
at NodeHandlerHelper.handleForValues (/builds/fes/dubbo_service/dubbo-ci/node_modules/ts-simple-ast/dist/manipulation/tree/nodeHandlers/NodeHandlerHelper.js:10:21)
at ParentFinderReplacementNodeHandler.StraightReplacementNodeHandler.handleNode (/builds/fes/dubbo_service/dubbo-ci/node_modules/ts-simple-ast/dist/manipulation/tree/nodeHandlers/StraightReplacementNodeHandler.js:32:29)
```
[ Full content available at: https://github.com/apache/dubbo-js/pull/149 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [dubbo-js] creasy2010 commented on issue #149: update
ts-simple-ast to ts-morph
Posted by "creasy2010 (GitHub)" <gi...@apache.org>.
It looks very good. After testing the 2000+ file, I only found two small details. Don't worry that I have submitted the changes.

[ Full content available at: https://github.com/apache/dubbo-js/pull/149 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [dubbo-js] creasy2010 commented on issue #149: update
ts-simple-ast to ts-morph
Posted by "creasy2010 (GitHub)" <gi...@apache.org>.
It looks very good. After testing the 2000+ file, I only found two small details.
x

The order of the fields changes, we seem to have no way to modify
The reference information is as follows:
https://ts-morph.com/details/classes
https://ts-morph.com/details/source-files#save
[ Full content available at: https://github.com/apache/dubbo-js/pull/149 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org