-
Notifications
You must be signed in to change notification settings - Fork 13
[bug] roles: UNANNOTATED #24
Comments
Generated UAST: https://gist.github.com/juanjux/7e0e5c6531a821b30df3597398db9ac4 Looks like *Annotation internal types are not being annotated. Edit: also "ObjectProperty", "ObjectTypeProperty", and "TypeParameterInstantiation". |
One more file |
Updated driver: egor@egor-sourced:~/workspace/style-analyzer/lookout/style/format/research$ docker exec -it bblfshd bblfshctl driver install javascript docker://bblfsh/javascript-driver:v2.1.1
Installing javascript language driver from "docker://bblfsh/javascript-driver:v2.1.1"... Done It's not fixed yet. Example with the last file (#24 (comment)) still gives a lot of declare module.exports: { foo(): number; } and UAST:
|
One more file with broken roles: file. declare class A mixins B<T>, C {} |
Yes, looks like I missed a few when updating, we've a new PR ready. |
BTW - good way to check missed roles is to apply bblfsh on this repository: project = "/path/to/babel/**/*.js"
# collect filenames with full path
files = glob.glob(project, recursive=True)
# extract UASTs
client = bblfsh.BblfshClient("0.0.0.0:9432")
uasts = []
final_files = [] # only files where UAST can be extracted
for file in tqdm(files):
res = client.parse(file)
if res.status == 0:
uasts.append(res.uast)
final_files.append(file)
# some functionality to check
bad_files = []
for file, uast in zip(final_files, uasts):
if is_bad_uast(uast):
bad_files.append(file)
if len(bad_files) == 0:
print("VICTORY")
else:
print(len(bad_files)) |
Related more general issue: #28 |
Forgot to close this after the PRs above fixed the problem, just in case I reparsed that file and could not find any unannotated (also a lot of integration tests were added in those PRs to cover those types). |
Hi,
I noticed that JS driver produces a lot of
roles: UNANNOTATED
when extract UAST from https://github.com/babel/babel/blob/master/packages/babel-core/src/transformation/plugin-pass.js.If you need any other information - I will be glad to answer!
The text was updated successfully, but these errors were encountered: