GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing github.com — List position based formatting by saschanaz · Pull Request #28340 · microsoft/TypeScript Conversation
Contributor
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
... and add explicit delta suppressor for list end tokens
Closed
Wesley Wigham (weswigham)
requested a review
from Sheetal Nandi (sheetalkamat)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. function getListIfVisualStartEndIsInListRange(list: NodeArray<Node> | undefined, start: number, end: number, node: Node, sourceFile: SourceFile): NodeArray<Node> | undefined { return list && rangeContainsStartEnd(getListRange(node, list, sourceFile), start, end) ? list : undefined; } function getListRange(node: Node, list: TextRange, sourceFile: SourceFile): TextRange { const children = node.getChildren(sourceFile); for (let i = 1; i < children.length - 1; i++) { if (children[i].pos === list.pos && children[i].end === list.end) { return { pos: children[i - 1].end, end: children[i + 1].getStart(sourceFile) }; } } return list; }
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NodeArray starts at the previous token's end positions and ends at the last list item's end position. So think about the following code: func( // visually the list starts at line 0 and ends in line 2, but actually it ends at line 0 ); func( 1, // visually the list starts at line 0 and ends in line 3, but actually it ends at line 1 // which means the position of these comments does not belong to the list range. );
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could create a closure so you don't have to repeat the arguments
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Sheetal Nandi (sheetalkamat)
approved these changes
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Reviewers+1 more reviewerUh oh!
There was an error while loading. Please reload this page. AssigneesLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Indentation issues on multiline call expressions unexpected chained "then" method indentation formatting problem with an object literal as an inlined result type of a function angle brackets formatting problem fluent api style method chain formatting problemUh oh!
There was an error while loading. Please reload this page. 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. | ||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |