-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Cache internal objects used by the formatting engine. #73487
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,16 +18,12 @@ internal abstract class TriviaData | |
{ | ||
protected const int TokenPairIndexNotNeeded = int.MinValue; | ||
|
||
private readonly string _language; | ||
|
||
protected TriviaData(SyntaxFormattingOptions options, string language) | ||
protected TriviaData(LineFormattingOptions options) | ||
{ | ||
Options = options; | ||
_language = language; | ||
} | ||
|
||
protected SyntaxFormattingOptions Options { get; } | ||
protected string Language => _language; | ||
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. Never used. Removed. |
||
protected LineFormattingOptions Options { get; } | ||
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. all consumers only need the limited amount of info exposed by LineFormattingOPtions, not the full info in SyntaxFormattingOptions. |
||
|
||
public int LineBreaks { get; protected set; } | ||
public int Spaces { get; protected set; } | ||
|
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.
Does this need to be sent in now?
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.
I'll check. But it is exposed as a property on this type.
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.
Ah, yes, that is used by the derived factories.