Move convert tuple to struct oop#43771
Conversation
| document, span, scope, cancellationToken).ConfigureAwait(false); | ||
| } | ||
|
|
||
| private async Task<Solution> AddRenameTokenAsync( |
There was a problem hiding this comment.
Hmm, so annotations get lost during serialization? Is it why we need to keep track of them here?
There was a problem hiding this comment.
Yes. We'd like to address that in a later change, but it will be a significant amount of work to support.
...es/Core/Portable/ConvertTupleToStruct/AbstractConvertTupleToStructCodeRefactoringProvider.cs
Show resolved
Hide resolved
| { | ||
| cancellationToken.ThrowIfCancellationRequested(); | ||
|
|
||
| using (Logger.LogBlock(FunctionId.AbstractConvertTupleToStructCodeRefactoringProvider_ConvertToStructAsync, cancellationToken)) |
| // in the concrete type we create. | ||
| var fields = tupleType.TupleElements; | ||
| var containsAnonymousType = fields.Any(p => p.Type.ContainsAnonymousType()); | ||
| var containsAnonymousType = fields.Any<IFieldSymbol>(p => p.Type.ContainsAnonymousType()); |
There was a problem hiding this comment.
I see here and in the rest of the file we're adding the type parameters to all the linq methods, what is the reason?
There was a problem hiding this comment.
see above. it's a bug we have in our complexificatin/simplificaiton system. have cleaned up in followup PR.
| } | ||
| } | ||
|
|
||
| return await ConvertToStructInCurrentProcessAsync( |
There was a problem hiding this comment.
do we need to keep around the in-proc one? And if we do, should we log any issues if we can't use the OOP version?
There was a problem hiding this comment.
we always need hte "in proc" one since when we call to OOP, OOP then runs the actual code "in proc" (of itself) :)
...es/Core/Portable/ConvertTupleToStruct/AbstractConvertTupleToStructCodeRefactoringProvider.cs
Show resolved
Hide resolved
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Log/FunctionId.cs
Show resolved
Hide resolved
| var document = solution.GetDocument(documentId); | ||
|
|
||
| var service = document.GetLanguageService<IConvertTupleToStructCodeRefactoringProvider>(); | ||
| var updatedSolution = await service.ConvertToStructAsync(document, span, scope, cancellationToken).ConfigureAwait(false); |
There was a problem hiding this comment.
should this call just return the serializable results by default? the inproc version and the oop version could convert back to sln as needed
This feature uses the SyntaxIndex type. So we want this to run OOP so that those indices are never produces in-proc.
Reviewing commit by commit may help.