-
Notifications
You must be signed in to change notification settings - Fork 391
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
GitHub/fix programmatic rename #6179
GitHub/fix programmatic rename #6179
Conversation
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.
How did you work around the CreatePkgDef issue?
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
....VisualStudio.ProjectSystem.Managed.VS.UnitTests/ProjectSystem/VS/Rename/RenamerTestsBase.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
....VisualStudio.ProjectSystem.Managed.VS.UnitTests/ProjectSystem/VS/Rename/RenamerTestsBase.cs
Show resolved
Hide resolved
ac8d14f
to
7304ec8
Compare
|
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Show resolved
Hide resolved
When we talked earlier in the week, updating Microsoft.VisualStudio.Threading caused a build error with CreatePkgDef I thought. If that has gone away, thats great! |
14d1a90
to
bd400fe
Compare
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
As we spoke offline, we played around this and we discovered the following issues:
|
|
The errors are not expected, we should be handling this correctly and not failing the rename of the file itself which we are doing. |
Not sure I follow, but may be missing context. The API isn't returning errors, is it errors that happen because an empty actionset is returned? |
I just grabbed his branch, installed it and started playing around with the behavior, we show dialogs with those errors when I perform those actions. I'm not referring to to what the API is returning. |
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
...alStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/RenamerProjectTreeActionHandler.cs
Outdated
Show resolved
Hide resolved
New APIs: - RenameDocumentAsync - UpdateSolutionAsync
The functionality is now implemented by RenamerProjectTreeActionHandler.cs which uses the new Roslyn APIs.
Updated Microsoft.CSharp to 4.7.0 and fixed null pointer warnings. Workaround for CreatePkgDef This change fixes the broken build. Microsoft.VisualStudio.Threading took a dependency on Bcl.Interfaces.
1) 'foo.cs' -> 'Foo.cs'. 2) File name doesn't match the name of type.
edc2c6d
to
1a24a92
Compare
Fixes #5139, #5436
What this PR does:
Microsoft.VisualStudio.LanguageServices
andMicrosoft.CodeAnalysis
to use the new Roslyn APIRenameDocumentAsync
andUpdateSolutionAsync
.Brief description of the changes:
The new Roslyn API does much of the work done in Renamer.cs like check if there are symbol to rename, rename symbols, and notify to other VS features. This helps dotnet Project System to move code to Roslyn and delete Renamer.cs.
Part of the code of Renamer.cs was moved RenamerProjectTreeActionHandler to be executed before CPS and before the file rename. At this point the api RenameDocumentAsync can get old document and can also check if the file rename is programmatic or not.
RenamerProjectTreeActionHandler does in chronological order:
RenameDocumentAsync
produces the actions.HandleRename
)UpdateSolutionAsync
What is missing:
Future work:
A new API is needed to have a cleaner mechanism to synchronize with Language Service.
Add an API that lets consumers wait on language service to be up-to-date with a given project version #3425
The API RenameDocumentAsync can generate actions to update the namespace
according to the logic folders.
Moving a file in the project should offer to move the type #1035
Microsoft Reviewers: Open in CodeFlow