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:
parent
97216d9eac
commit
506d41c73d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user