-
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
Turn on language-service integration rewrite #4419
Merged
Merged
Conversation
This file contains 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 lets consumers (error list, edit & continue, etc) run code against context while protecting against being disposed.
Rename ILanguageServiceHost -> IActiveWorkspaceProjectContextHost
Add IWorkspaceProjectContextHost
Unneeded dependency here, just parent the files with the current project file.
Unneeded dependency here, just parent the files with the current project file.
Provides access to IWorkspaceProjectContext and associated services.
Add IWorkspaceProjectContextAccessor to let services use error list/edit & continue services under a lock.
…Host This moves all consumers of the old language service APIs over to the new APIs and shims the old language service under them.
Stop using IWorkspaceProjectContext version of the project file name
Merge IActiveWorkspaceProjectContextHost and IWorkspaceProjectContextHost
This class needs to be made async, which prevents lock from being used in async methods. It does not need to be thread-safe as the only consumer of it, WorkspaceContextHostInstance, prevents overlap.
In preparation of making IWorkspaceProjectContext async, plumb through async in ApplyChangesToWorkspaceContext. Handlers will come next.
Remove thread-safeness from ApplyChangesToWorkspaceContext
Make IApplyChangesToWorkspaceContext async
Fixes: https://github.com/dotnet/project-system/issues/353. Note, creation is still UI thread based.
We can use the new IWorkspaceProjectContext.Id property.
Populate/Dispose context on a background thread
Roslyn will avoid updating VisualStudioWorkspace until after a batch has finished.
Remove usage of AbstractProject
Wrap context usage in a batch
Roslyn will avoid updating VisualStudioWorkspace until after a batch has finished.
IWorkspaceProjectContext.Dispose is not actually free-threaded: Microsoft.CodeAnalysis.Workspaces.dll!Roslyn.Utilities.Contract.ThrowIfFalse(bool condition, string message) Unknown Microsoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Shared.Utilities.ForegroundThreadAffinitizedObject.AssertIsForeground() Unknown Microsoft.VisualStudio.LanguageServices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.SetDocumentContext(Microsoft.CodeAnalysis.DocumentId documentId) Unknown Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.Workspace.ClearOpenDocument(Microsoft.CodeAnalysis.DocumentId documentId, bool isSolutionClosing) Unknown Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.Workspace.ClearOpenDocuments(Microsoft.CodeAnalysis.ProjectId projectId) Unknown Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.Workspace.ClearProjectData(Microsoft.CodeAnalysis.ProjectId projectId) Unknown Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.Workspace.OnProjectRemoved(Microsoft.CodeAnalysis.ProjectId projectId) Unknown Microsoft.VisualStudio.LanguageServices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.OnProjectRemoved(Microsoft.CodeAnalysis.ProjectId projectId) Unknown Microsoft.VisualStudio.LanguageServices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProject.RemoveFromWorkspace.AnonymousMethod__86_0(Microsoft.CodeAnalysis.Workspace w) Unknown Microsoft.VisualStudio.LanguageServices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.ApplyChangeToWorkspace(System.Action<Microsoft.CodeAnalysis.Workspace> action) Unknown Microsoft.VisualStudio.LanguageServices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProject.RemoveFromWorkspace() Unknown Microsoft.VisualStudio.LanguageServices.Implementation.dll!Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.CPS.CPSProject.Dispose() Unknown
Components that were calling through accessor where hitting the UI-thread check.
This ensures that the project is loaded before project load has completed. This brings back the original experience of the previous language-service integration.
Add an implemention of IActiveWorkspaceProjectContext for new language service
We weren't waiting for changes to be applied before we closed the batch. This path is currently synchronous so it's just by change that this currently works.
…Dev16 Allow design-time build logging to be turned on Dev16/suffixes
Make sure to apply changes under batch
ClearAllErrors was the only method calling this method and would never break out.
This is blocked by dotnet/roslyn#31365. |
davidwengier
approved these changes
Dec 29, 2018
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.
Nice work 👍
This was referenced Jan 4, 2019
davidwengier
reviewed
Jan 4, 2019
...tSystem.Managed.VS/ProjectSystem/VS/LanguageServices/ActiveWorkspaceProjectContextTracker.cs
Outdated
Show resolved
Hide resolved
davidwengier
approved these changes
Jan 4, 2019
When we've never been set an active editor context, just return the one based on the active configuration. This combined with dotnet/roslyn#32153, unblocks Razor.
e0cf5a5
to
196a145
Compare
jasonmalinowski
pushed a commit
to dotnet/roslyn
that referenced
this pull request
Jan 4, 2019
CPS-based projects have moved from a "fake" IVsHierarchy being passed to the Roslyn to returning the "real" hiearchy representing the project. This results in GetItemContext actually returning a real implementation of "IWebApplicationCtxSvc" instead of previously failing. This implementation returns S_OK and an "empty" project name - to indicate that it doesn't actually handle the call (with a giant TODO). Handle that situation and treated it as failed, so that we proceed onto IVsContainedLanguageProjectNameProvider which provides the real underlying value. This is blocking dotnet/project-system#4419.
@davkean I assume you are asleep but I plan to merge this in the next 15 minutes unless I hear from you |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This merges the language-service integration rewrite into master and makes it replace the existing integration. All of these changes have already been reviewed or are out for review, with exception to e4b0c17 and a7e646f.
This fixes: #2733.
Currently broken in Preview 2 bits (unrelated to this change):
Roslyn
Roslyn leaking AbstractProjects
Project Context switch icon changes when moving caret
Multi-targeting context is broken in 16.0 Preview 1
With "Full Solution Analysis" turned on, certain syntax errors get duplicated
Analyzers warning/errors/messages are not correctly grouped for multi-targeting projects
Project System
Build warnings & errors from build always get applied to the first TFM in the project
Testing done
Performance
Error List
Project manipulation
Features