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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current implementation (#264) has some drawbacks:
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.