提交 2b470697 编写于 作者: J Jason Malinowski

Remove virtual method that we can now write directly

VisualStudioWorkspace had a virtual method to send a call over to
the code model logic. Since we now have the requisite interface callable
directly, we should just call it directly. It also saves us the trouble
of passing a DocumentId only to re-decompose the type again.
上级 1373b3ed
......@@ -635,7 +635,7 @@ private void RenameFileCodeModelInstances(uint docCookie, string oldMoniker, str
{
if (document.Project.Workspace is VisualStudioWorkspace workspace)
{
workspace.RenameFileCodeModelInstance(document.Id, newMoniker);
document.Project.ProjectCodeModel?.OnSourceFileRenaming(document.FilePath, newMoniker);
}
}
}
......
......@@ -100,8 +100,6 @@ protected override void OnDocumentClosing(DocumentId documentId)
/// </summary>
public abstract EnvDTE.FileCodeModel GetFileCodeModel(DocumentId documentId);
internal abstract bool RenameFileCodeModelInstance(DocumentId documentId, string newFilePath);
internal abstract object GetBrowseObject(SymbolListItem symbolListItem);
public abstract bool TryGoToDefinition(ISymbol symbol, Project project, CancellationToken cancellationToken);
......
......@@ -75,30 +75,6 @@ public override EnvDTE.FileCodeModel GetFileCodeModel(DocumentId documentId)
return null;
}
internal override bool RenameFileCodeModelInstance(DocumentId documentId, string newFilePath)
{
if (documentId == null)
{
return false;
}
var project = DeferredState.ProjectTracker.GetProject(documentId.ProjectId);
if (project == null)
{
return false;
}
var document = project.GetDocumentOrAdditionalDocument(documentId);
if (document == null)
{
return false;
}
project.ProjectCodeModel?.OnSourceFileRenaming(document.FilePath, newFilePath);
return true;
}
internal override IInvisibleEditor OpenInvisibleEditor(DocumentId documentId)
{
var hostDocument = GetHostDocument(documentId);
......
......@@ -85,10 +85,6 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests
Friend Function GetFileCodeModelComHandle(id As DocumentId) As ComHandle(Of EnvDTE80.FileCodeModel2, FileCodeModel)
Return _fileCodeModels(id)
End Function
Friend Overrides Function RenameFileCodeModelInstance(documentId As DocumentId, newFilePath As String) As Boolean
Throw New NotImplementedException()
End Function
End Class
Public Class MockInvisibleEditor
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册