-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(flinksql): collect comment, type attribute for entity #319
Conversation
2c3cbd4
to
cb9a37a
Compare
this.pushEntity(ctx, EntityContextType.DATABASE_CREATE, { | ||
needCollectAttr: true, | ||
attrList: [attrName.comment], | ||
endContext: 'CreateDatabaseContext', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以用 CreateDatabaseContext.constructor.name 代替吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不可以哦,在这里CreateDatabaseContext.constructor.name 是Function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CreateDatabaseContext.name
@liuxy0551 @HaydenOrz 关于你们的comment,已经提交了新的commit,可以再次review一下 |
src/parser/common/entityCollector.ts
Outdated
return 'line' in value; | ||
} | ||
|
||
export function isColumnEntityContext(value: EntityContext): value is ColumnEntityContext { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
src/parser/common/entityCollector.ts
Outdated
return 'params' in value && 'returns' in value && 'relatedEntities' in value; | ||
} | ||
|
||
export function isWordRange(value: any): value is WordRange { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上,且参数类型应该是 TextSlice | WordRange
this.pushEntity(ctx, EntityContextType.DATABASE_CREATE, { | ||
needCollectAttr: true, | ||
attrList: [attrName.comment], | ||
endContext: 'CreateDatabaseContext', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CreateDatabaseContext.name
@HaydenOrz 优化的commit已提交,可再次review |
* feat(flinksql): collect comment, type attribute for entity * feat(flinksql): delete console log * fix(DTStack#305): delete function ctxToWord,using ctxToText instead of ctxToWord * feat: update attribute's type * feat(flinksql): update flinksql's entitycollect unit test * feat: optimize interface and update unit test * feat: update collect attr detail * feat: optimize interface and some function's arguments * feat: add comment and update params' name * feat: collect alias in select statement * feat: update collect attribute function and update unit test --------- Co-authored-by: zhaoge <>
* feat(flinksql): collect comment, type attribute for entity * feat(flinksql): delete console log * fix(#305): delete function ctxToWord,using ctxToText instead of ctxToWord * feat: update attribute's type * feat(flinksql): update flinksql's entitycollect unit test * feat: optimize interface and update unit test * feat: update collect attr detail * feat: optimize interface and some function's arguments * feat: add comment and update params' name * feat: collect alias in select statement * feat: update collect attribute function and update unit test --------- Co-authored-by: zhaoge <>
* feat(flinksql): collect comment, type attribute for entity * feat(flinksql): delete console log * fix(DTStack#305): delete function ctxToWord,using ctxToText instead of ctxToWord * feat: update attribute's type * feat(flinksql): update flinksql's entitycollect unit test * feat: optimize interface and update unit test * feat: update collect attr detail * feat: optimize interface and some function's arguments * feat: add comment and update params' name * feat: collect alias in select statement * feat: update collect attribute function and update unit test --------- Co-authored-by: zhaoge <>
* feat(flinksql): collect comment, type attribute for entity * feat(flinksql): delete console log * fix(DTStack#305): delete function ctxToWord,using ctxToText instead of ctxToWord * feat: update attribute's type * feat(flinksql): update flinksql's entitycollect unit test * feat: optimize interface and update unit test * feat: update collect attr detail * feat: optimize interface and some function's arguments * feat: add comment and update params' name * feat: collect alias in select statement * feat: update collect attribute function and update unit test --------- Co-authored-by: zhaoge <>
* feat(flinksql): collect comment, type attribute for entity * feat(flinksql): delete console log * fix(#305): delete function ctxToWord,using ctxToText instead of ctxToWord * feat: update attribute's type * feat(flinksql): update flinksql's entitycollect unit test * feat: optimize interface and update unit test * feat: update collect attr detail * feat: optimize interface and some function's arguments * feat: add comment and update params' name * feat: collect alias in select statement * feat: update collect attribute function and update unit test --------- Co-authored-by: zhaoge <>
Feature
Fix
Description
_
取属性名,antlr4ng目前解析出来属性名都是带_
,是公有的。甚至以type
命名前后都有下划线,应该是以防重名,无关私有公有findAttributeChildren
方法里的child
类型,因为antlr4ng 的ParserRuleContext
里,children
并未重申类型,导致children类型为ParseTree[]
,需要和三方提PR修改isAlias
属性和alias
、reference
、comment
几个可选属性,alias
为别名,reference
为被引用的实体。