Move IDE off of SpecializedCollections.Singleton to using collectoin exprs#72899
Move IDE off of SpecializedCollections.Singleton to using collectoin exprs#72899CyrusNajmabadi merged 57 commits intodotnet:mainfrom
Conversation
|
I assume a lot of those SpecializedClasses are now kept around only to minimize churn in the compiler? Should we ban a bunch of those classes from use outside that context so they don't sneak their way back in? |
Works for me :) |
| OnTagsChangedForBuffer(SpecializedCollections.SingletonCollection( | ||
| new KeyValuePair<ITextBuffer, DiffResult>(buffer, difference)), | ||
| OnTagsChangedForBuffer( | ||
| [new KeyValuePair<ITextBuffer, DiffResult>(buffer, difference)], |
There was a problem hiding this comment.
OnTagsChangedForBuffer changes
|
|
||
| private static IList<SymbolDisplayPart> GetMethodGroupPostambleParts() | ||
| => SpecializedCollections.SingletonList(Punctuation(SyntaxKind.CloseParenToken)); | ||
| => [Punctuation(SyntaxKind.CloseParenToken)]; |
There was a problem hiding this comment.
| return SpecializedCollections.SingletonList( | ||
| Punctuation(SyntaxKind.CloseParenToken)); | ||
| } | ||
| => [Punctuation(SyntaxKind.CloseParenToken)]; |
There was a problem hiding this comment.
| return SpecializedCollections.SingletonList( | ||
| Punctuation(SyntaxKind.CloseParenToken)); | ||
| } | ||
| => [Punctuation(SyntaxKind.CloseParenToken)]; |
There was a problem hiding this comment.
| return SpecializedCollections.SingletonList( | ||
| Punctuation(SyntaxKind.CloseBracketToken)); | ||
| } | ||
| => [Punctuation(SyntaxKind.CloseBracketToken)]; |
There was a problem hiding this comment.
| // Since we're returning a single item, we can selected it as the "best one". | ||
| selectedItem = 0; | ||
|
|
||
| return SpecializedCollections.SingletonList(item); |
There was a problem hiding this comment.
| isOptional: false, | ||
| documentationFactory: null, | ||
| displayParts: parts)); | ||
| return [new SignatureHelpSymbolParameter( |
There was a problem hiding this comment.
| return SpecializedCollections.SingletonList( | ||
| Punctuation(SyntaxKind.CloseParenToken)); | ||
| } | ||
| => [Punctuation(SyntaxKind.CloseParenToken)]; |
There was a problem hiding this comment.
| return SpecializedCollections.SingletonList( | ||
| Punctuation(SyntaxKind.CloseParenToken)); | ||
| } | ||
| => [Punctuation(SyntaxKind.CloseParenToken)]; |
There was a problem hiding this comment.
| { | ||
| return SpecializedCollections.SingletonList(Punctuation(SyntaxKind.CloseParenToken)); | ||
| } | ||
| => [Punctuation(SyntaxKind.CloseParenToken)]; |
There was a problem hiding this comment.
Compiler has built in support for optimizing this case. If you have a singleton collection expr, you already get an optimal readonly compiler collection with space for just that single element.