FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Rework comments support for pretty-printing by ondrejmirtes · Pull Request #266 · phpstan/phpdoc-parser · GitHub

Rework comments support for pretty-printing - #266

Draft
ondrejmirtes wants to merge 7 commits into
2.1.xfrom
comments-2
Draft

Rework comments support for pretty-printing#266
ondrejmirtes wants to merge 7 commits into
2.1.xfrom
comments-2

Conversation

Copy link
Copy Markdown
Member

The current implementation (#264) has some drawbacks:

  • Printing with preserving format is pretty broken. For example, it does not notice when a comment is removed from a node.
  • The comment indexes are wrong, they are often out of bounds of the associated node. For example startIndex of node is 5, but its comment can start earlier, which causes problems in Printer
  • Comments are often associated with a weird node, for example:
array{
	// a is for apple
	a: int,
}

Associates the comment with the item keyName, not item itself.

This PR tries to fix it but absence of these fixes doesn't prevent us from releasing phpdoc-parser 2.1.0.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

1 participant


Back | FazBrowse Home | New Git URL