1
1
mirror of https://github.com/github/semantic.git synced 2024-11-27 12:57:49 +03:00

Add edges from imports to their identifiers.

This commit is contained in:
Rob Rix 2022-03-14 10:07:33 -04:00
parent 97216d9eac
commit 506d41c73d
No known key found for this signature in database
GPG Key ID: 2BE643E01DC032AE

View File

@ -6,13 +6,6 @@
attr (@this.node) type = "module"
}
(import_statement name: (dotted_name (identifier)* @names)) @this
{
node @this.node
attr (@this.node) type = "import"
attr (@this.node) import = @names
}
(identifier) @this
{
node @this.node
@ -20,6 +13,18 @@
attr (@this.node) text = (source-text @this)
}
(import_statement) @this
{
node @this.node
attr (@this.node) type = "import"
}
(import_statement name: (dotted_name (identifier) @id)) @this
{
edge @this.node -> @id.node
attr (@this.node -> @id.node) index = (named-child-index @id)
}
(string) @this
{
node @this.node