Repository navigation
Slice source text instead of copying it line by line for outlining #20443
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
Open
xperiandri
wants to merge
18
commits into
dotnet:main
Choose a base branch
from
xperiandri:outlining-line-slices
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
b5fd85b
Slice source text instead of copying it line by line for outlining
xperiandri b549dd0
Track comment lines by number instead of storing their text
xperiandri 4b992a3
Link the outlining release note to its PR
xperiandri 03f06da
Format illib.fsi and add the VisualStudio release note
xperiandri 289e701
Scope the System.Memory pin to the net472 test build
xperiandri a57c033
Address review: XML doc structure and shorthand lambda
xperiandri 19ecef0
Drop the span IndexOfOrdinal overloads that take a start index
xperiandri 044a454
Report an absolute index from the span IndexOfOrdinal overloads
xperiandri d7a638a
Wrap the IndexOfOrdinal startIndex overloads' doc text in summary
xperiandri 90aba9d
Use a struct tuple for the comment-scan accumulator
xperiandri 2f0d11e
Keep getOutliningRanges taking string[] and add a slice entry beside it
xperiandri 4038417
Keep only the span StartsWithOrdinal the outlining scan calls, and mo…
xperiandri 1b3d0ed
Cover the outlining scan's slice entry point with a parity test
xperiandri 41b9b54
Drop the outlining note from the shipped 11.0.100 release notes
xperiandri 5a9e592
Remove the comments the outlining slices added
xperiandri 594dc04
Cover GetLinesAsMemory with a test
xperiandri b22790f
Slice a pooled copy of the text for outlining instead of one big string
xperiandri 9d0f1f9
Compare outlining ranges with collection asserts
xperiandri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 20b6c0e:
Line slices of one string give the same ranges as a string per lineinStructureTests.fscuts one string into non-zero-offset slices (mixed\r\nand\n, a whitespace-only line between two opens, indented comment groups with trailing whitespace, a directive section whose last line ends in whitespace), passes them togetOutliningRangesFromLineSlicesand compares every range withgetOutliningRangesover a string per line. It also pins the ranges that are read off the line text (theopengroup, both directive sections, the comment and the doc comment group).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The editor entry point has its own test now.
WithLinesAsMemory slices the same lines as LinesinRoslynSourceTextTests.fscompares its slices withSourceText.Linesfor\n,\r\nand\rline breaks, an empty text and a lone\r\n. (The entry point wasGetLinesAsMemorywhen you wrote this; it is a callback API now.)StructureTests.fsalso hasOutlining ranges do not read the line slices once the call has returned, which overwrites the buffer behind the slices after the call, because the editor gives the buffer back to a pool.The measurement on a real VS snapshot is in the thread on
Extensions.fs: #20443 (comment)