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

Fix: More reliable comment attachment (fixes #76) #177

Merged
merged 1 commit into from
Mar 30, 2021
Merged

Fix: More reliable comment attachment (fixes #76) #177

merged 1 commit into from
Mar 30, 2021

Conversation

btmills
Copy link
Member

@btmills btmills commented Mar 1, 2021

Comment attachment was sensitive to whitespace around the code block and preceding comments. In some cases, the parser would place comments as descendants of code blocks' preceding sibling nodes. However, a depth-first traversal of the tree will still encounter the comments in linear order, which is sufficient for our purposes. This approach no longer traverses backwards from code blocks looking for preceding comments, so we no longer need to pass the parent node and index into its children.

Comment attachment was sensitive to whitespace around the code block and
preceding comments. In some cases, the parser would place comments as
descendants of code blocks' preceding sibling nodes. However, a
depth-first traversal of the tree will still encounter the comments in
linear order, which is sufficient for our purposes.
@btmills btmills requested a review from a team March 27, 2021 22:15
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@btmills btmills merged commit 79be776 into main Mar 30, 2021
@btmills btmills deleted the issue76 branch March 30, 2021 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants