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
dc50d93
Slice source text instead of copying it line by line for outlining
xperiandri 282c97f
Track comment lines by number instead of storing their text
xperiandri 314ef9e
Link the outlining release note to its PR
xperiandri 1f05242
Format illib.fsi and add the VisualStudio release note
xperiandri a9dcfd8
Scope the System.Memory pin to the net472 test build
xperiandri 74b65c1
Address review: XML doc structure and shorthand lambda
xperiandri 6454dee
Drop the span IndexOfOrdinal overloads that take a start index
xperiandri c80ab0a
Report an absolute index from the span IndexOfOrdinal overloads
xperiandri 5430f55
Wrap the IndexOfOrdinal startIndex overloads' doc text in summary
xperiandri 8322e51
Use a struct tuple for the comment-scan accumulator
xperiandri d75d5ee
Keep getOutliningRanges taking string[] and add a slice entry beside it
xperiandri 04799c0
Keep only the span StartsWithOrdinal the outlining scan calls, and mo…
xperiandri f983cc4
Cover the outlining scan's slice entry point with a parity test
xperiandri dc81e75
Drop the outlining note from the shipped 11.0.100 release notes
xperiandri 38e1298
Remove the comments the outlining slices added
xperiandri bcfe441
Cover GetLinesAsMemory with a test
xperiandri aa2a9d8
Slice a pooled copy of the text for outlining instead of one big string
xperiandri 6138028
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)