Skip to content
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

Fixed multiline nodes (see #65) #71

Merged
merged 1 commit into from Oct 5, 2021
Merged

Conversation

lyokha
Copy link
Contributor

@lyokha lyokha commented Oct 4, 2021

Note that the upper node gets matched against values from config.patterns.default using get_type_pattern() which returns a regexp (i.e. the original value, say function gets returned as %f[%w]function%f[^%w] having been wrapped with word_pattern()): this means that key ['function'] in last_types must be wrapped this same way (as [word_pattern('function')]) because its finally gets retrieved with last_types[type].

Note also that function_declaration may be deeply nested inside function_definition (at least, in C), and therefore a correct implementation requires a recursive traversal of nodes which is implemented with function find_node() introduced in this commit.

Closes #65

@romgrk romgrk merged commit e1f54e1 into nvim-treesitter:master Oct 5, 2021
@romgrk
Copy link
Collaborator

romgrk commented Oct 5, 2021

Cool, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi-line nodes are not working
2 participants