提交 3149ba26 编写于 作者: M Manish Vasani

Add some more AnalyzerConfigDocument functionality to the VisualStudio layer....

Add some more AnalyzerConfigDocument functionality to the VisualStudio layer. This includes the changes to enable Preview workspace and Preview changes functionality for analyzer config documents
上级 e9057807
......@@ -210,7 +210,8 @@ public TextDocument GetUpdatedDocument()
return _right.WithText(UpdateBufferText());
}
public bool IsAdditionalDocumentChange => !((_left ?? _right) is Document);
public bool IsAdditionalDocumentChange => !((_left ?? _right) is Document) && !IsAnalyzerConfigDocumentChange;
public bool IsAnalyzerConfigDocumentChange => (_left ?? _right) is AnalyzerConfigDocument;
internal override void GetDisplayData(VSTREEDISPLAYDATA[] pData)
{
......
......@@ -133,6 +133,15 @@ public int GetRootChangesList(out object ppIUnknownPreviewChangesList)
allDocumentsWithChanges.AddRange(addedAdditionalDocuments);
allDocumentsWithChanges.AddRange(removedAdditionalDocuments);
// AnalyzerConfig Documents
var changedAnalyzerConfigDocuments = projectChanges.SelectMany(p => p.GetChangedAnalyzerConfigDocuments());
var addedAnalyzerConfigDocuments = projectChanges.SelectMany(p => p.GetAddedAnalyzerConfigDocuments());
var removedAnalyzerConfigDocuments = projectChanges.SelectMany(p => p.GetRemovedAnalyzerConfigDocuments());
allDocumentsWithChanges.AddRange(changedAnalyzerConfigDocuments);
allDocumentsWithChanges.AddRange(addedAnalyzerConfigDocuments);
allDocumentsWithChanges.AddRange(removedAnalyzerConfigDocuments);
AppendFileChanges(allDocumentsWithChanges, builder);
// References (metadata/project/analyzer)
......
......@@ -25,25 +25,37 @@ public void UnregisterTextContainer(SourceTextContainer container)
public void CloseDocument(TextDocument document, SourceText text)
{
if (document is Document)
switch (document)
{
OnDocumentClosed(document.Id, new PreviewTextLoader(text));
}
else
{
OnAdditionalDocumentClosed(document.Id, new PreviewTextLoader(text));
case Document _:
OnDocumentClosed(document.Id, new PreviewTextLoader(text));
break;
case AnalyzerConfigDocument _:
OnAnalyzerConfigDocumentClosed(document.Id, new PreviewTextLoader(text));
break;
default:
OnAdditionalDocumentClosed(document.Id, new PreviewTextLoader(text));
break;
}
}
public void OpenDocument(TextDocument document)
{
if (document is Document)
{
OpenDocument(document.Id);
}
else
switch (document)
{
OpenAdditionalDocument(document.Id);
case Document _:
OpenDocument(document.Id);
break;
case AnalyzerConfigDocument _:
OpenAnalyzerConfigDocument(document.Id);
break;
default:
OpenAdditionalDocument(document.Id);
break;
}
}
......@@ -57,6 +69,11 @@ protected override void ApplyAdditionalDocumentTextChanged(DocumentId id, Source
OnAdditionalDocumentTextChanged(id, text, PreservationMode.PreserveIdentity);
}
protected override void ApplyAnalyzerConfigDocumentTextChanged(DocumentId id, SourceText text)
{
OnAnalyzerConfigDocumentTextChanged(id, text, PreservationMode.PreserveIdentity);
}
private class PreviewTextLoader : TextLoader
{
private readonly SourceText _text;
......
......@@ -82,7 +82,7 @@ private Solution ApplyFileChanges(Solution solution, IEnumerable<FileChange> fil
// Apply file change to document.
ApplyFileChangesCore(oldTextDocument, updatedTextDocument?.Id, updatedDocumentTextOpt,
fileChange.CheckState, fileChange.IsAdditionalDocumentChange);
fileChange.CheckState, fileChange.IsAdditionalDocumentChange, fileChange.IsAnalyzerConfigDocumentChange);
// Now apply file change to linked documents.
if (oldTextDocument is Document oldDocument)
......@@ -95,7 +95,7 @@ private Solution ApplyFileChanges(Solution solution, IEnumerable<FileChange> fil
var newLinkedDocumentIdOpt = updatedDocumentTextOpt != null ? oldLinkedDocument.Id : null;
ApplyFileChangesCore(oldLinkedDocument, newLinkedDocumentIdOpt, updatedDocumentTextOpt,
fileChange.CheckState, fileChange.IsAdditionalDocumentChange);
fileChange.CheckState, fileChange.IsAdditionalDocumentChange, fileChange.IsAnalyzerConfigDocumentChange);
}
}
else if (updatedTextDocument is Document updatedDocument)
......@@ -103,7 +103,7 @@ private Solution ApplyFileChanges(Solution solution, IEnumerable<FileChange> fil
foreach (var newLinkedDocumentId in updatedDocument.GetLinkedDocumentIds())
{
ApplyFileChangesCore(oldTextDocument, newLinkedDocumentId, updatedDocumentTextOpt,
fileChange.CheckState, fileChange.IsAdditionalDocumentChange);
fileChange.CheckState, fileChange.IsAdditionalDocumentChange, fileChange.IsAnalyzerConfigDocumentChange);
}
}
}
......@@ -116,10 +116,12 @@ private Solution ApplyFileChanges(Solution solution, IEnumerable<FileChange> fil
DocumentId updatedDocumentIdOpt,
SourceText updateDocumentTextOpt,
__PREVIEWCHANGESITEMCHECKSTATE checkState,
bool isAdditionalDoc)
bool isAdditionalDoc,
bool isAnalyzerConfigDoc)
{
Debug.Assert(oldDocument != null || updatedDocumentIdOpt != null);
Debug.Assert((updatedDocumentIdOpt != null) == (updateDocumentTextOpt != null));
Debug.Assert(!(isAdditionalDoc && isAnalyzerConfigDoc));
if (oldDocument == null)
{
......@@ -129,6 +131,8 @@ private Solution ApplyFileChanges(Solution solution, IEnumerable<FileChange> fil
{
solution = isAdditionalDoc ?
solution.RemoveAdditionalDocument(updatedDocumentIdOpt) :
isAnalyzerConfigDoc ?
solution.RemoveAnalyzerConfigDocument(updatedDocumentIdOpt) :
solution.RemoveDocument(updatedDocumentIdOpt);
}
}
......@@ -141,6 +145,8 @@ private Solution ApplyFileChanges(Solution solution, IEnumerable<FileChange> fil
var oldText = oldDocument.GetTextAsync().Result.ToString();
solution = isAdditionalDoc ?
solution.AddAdditionalDocument(oldDocument.Id, oldDocument.Name, oldText, oldDocument.Folders, oldDocument.FilePath) :
isAnalyzerConfigDoc ?
solution.AddAnalyzerConfigDocument(oldDocument.Id, oldDocument.Name, SourceText.From(oldText), oldDocument.Folders, oldDocument.FilePath) :
solution.AddDocument(oldDocument.Id, oldDocument.Name, oldText, oldDocument.Folders, oldDocument.FilePath);
}
}
......@@ -151,6 +157,8 @@ private Solution ApplyFileChanges(Solution solution, IEnumerable<FileChange> fil
// Changed document.
solution = isAdditionalDoc ?
solution.WithAdditionalDocumentText(updatedDocumentIdOpt, updateDocumentTextOpt) :
isAnalyzerConfigDoc ?
solution.WithAnalyzerConfigDocumentText(updatedDocumentIdOpt, updateDocumentTextOpt) :
solution.WithDocumentText(updatedDocumentIdOpt, updateDocumentTextOpt);
}
}
......
......@@ -526,6 +526,11 @@ private void OnBatchScopeDisposed()
_workspace.ApplyChangeToWorkspace(w => w.OnAdditionalDocumentOpened(documentId, textContainer));
}
foreach (var (documentId, textContainer) in analyzerConfigDocumentsToOpen)
{
_workspace.ApplyChangeToWorkspace(w => w.OnAnalyzerConfigDocumentOpened(documentId, textContainer));
}
// Check for those files being opened to start wire-up if necessary
_workspace.QueueCheckForFilesBeingOpen(documentFileNamesAdded.ToImmutable());
}
......
......@@ -6,6 +6,7 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.FindSymbols;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.VisualStudio.LanguageServices.Implementation.Library.ObjectBrowser.Lists;
using Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem;
using Microsoft.VisualStudio.Shell.Interop;
......@@ -84,11 +85,7 @@ protected override void OnDocumentClosing(DocumentId documentId)
internal abstract Guid GetProjectGuid(ProjectId projectId);
public virtual string GetFilePath(DocumentId documentId)
{
var solution = CurrentSolution;
return (solution.GetDocument(documentId) ?? solution.GetAdditionalDocument(documentId))?.FilePath;
}
=> CurrentSolution.GetTextDocument(documentId)?.FilePath;
/// <summary>
/// Given a document id, opens an invisible editor for the document.
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Text;
namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem
{
internal partial class VisualStudioWorkspaceImpl
{
private class AddAnalyzerConfigDocumentUndoUnit : AbstractAddDocumentUndoUnit
{
public AddAnalyzerConfigDocumentUndoUnit(
VisualStudioWorkspaceImpl workspace,
DocumentInfo docInfo,
SourceText text)
: base(workspace, docInfo, text)
{
}
protected override Project AddDocument(Project fromProject)
=> fromProject.AddAnalyzerConfigDocument(DocumentInfo.Name, Text, DocumentInfo.Folders, DocumentInfo.FilePath).Project;
}
}
}
......@@ -191,10 +191,8 @@ private void TryOpeningDocumentsForNewCookie(uint cookie)
}
else
{
// TODO: implement the ability for analyze config documents to be opened against
// a live text editor. This is tracked by
// https://devdiv.visualstudio.com/DevDiv/_workitems/edit/750120
Debug.Assert(w.CurrentSolution.ContainsAnalyzerConfigDocument(documentId));
w.OnAnalyzerConfigDocumentOpened(documentId, textContainer, isCurrentContext);
}
}
}
......@@ -366,10 +364,8 @@ private void TryClosingDocumentsForCookie(uint cookie)
}
else
{
// TODO: implement the ability for analyze config documents to be opened against
// a live text editor. This is tracked by
// https://devdiv.visualstudio.com/DevDiv/_workitems/edit/750120
Debug.Assert(w.CurrentSolution.ContainsAnalyzerConfigDocument(documentId));
w.OnAnalyzerConfigDocumentClosed(documentId, new FileTextLoader(moniker, defaultEncoding: null));
}
}
}
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using Microsoft.CodeAnalysis;
namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem
{
internal partial class VisualStudioWorkspaceImpl
{
private class RemoveAnalyzerConfigDocumentUndoUnit : AbstractRemoveDocumentUndoUnit
{
public RemoveAnalyzerConfigDocumentUndoUnit(
VisualStudioWorkspaceImpl workspace,
DocumentId documentId)
: base(workspace, documentId)
{
}
protected override IReadOnlyList<DocumentId> GetDocumentIds(Project fromProject)
=> fromProject.State.AnalyzerConfigDocumentIds.AsImmutable();
protected override TextDocument GetDocument(Solution currentSolution)
=> currentSolution.GetAnalyzerConfigDocument(this.DocumentId);
}
}
}
......@@ -14,6 +14,7 @@
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Shared.Utilities;
using Microsoft.CodeAnalysis.SolutionCrawler;
using Microsoft.CodeAnalysis.Text;
......@@ -313,11 +314,13 @@ public override EnvDTE.FileCodeModel GetFileCodeModel(DocumentId documentId)
foreach (var pc in projectChanges)
{
if (pc.GetAddedAdditionalDocuments().Any() ||
pc.GetAddedAnalyzerConfigDocuments().Any() ||
pc.GetAddedAnalyzerReferences().Any() ||
pc.GetAddedDocuments().Any() ||
pc.GetAddedMetadataReferences().Any() ||
pc.GetAddedProjectReferences().Any() ||
pc.GetRemovedAdditionalDocuments().Any() ||
pc.GetRemovedAnalyzerConfigDocuments().Any() ||
pc.GetRemovedAnalyzerReferences().Any() ||
pc.GetRemovedDocuments().Any() ||
pc.GetRemovedMetadataReferences().Any() ||
......@@ -433,6 +436,9 @@ public override bool CanApplyChange(ApplyChangesKind feature)
case ApplyChangesKind.ChangeCompilationOptions:
case ApplyChangesKind.ChangeParseOptions:
case ApplyChangesKind.ChangeDocumentInfo:
case ApplyChangesKind.AddAnalyzerConfigDocument:
case ApplyChangesKind.RemoveAnalyzerConfigDocument:
case ApplyChangesKind.ChangeAnalyzerConfigDocument:
return true;
default:
......@@ -712,16 +718,24 @@ private OleInterop.IOleUndoManager TryGetUndoManager()
protected override void ApplyDocumentAdded(DocumentInfo info, SourceText text)
{
AddDocumentCore(info, text, isAdditionalDocument: false);
AddDocumentCore(info, text, isAdditionalDocument: false, isAnalyzerConfigDocument: false);
}
protected override void ApplyAdditionalDocumentAdded(DocumentInfo info, SourceText text)
{
AddDocumentCore(info, text, isAdditionalDocument: true);
AddDocumentCore(info, text, isAdditionalDocument: true, isAnalyzerConfigDocument: false);
}
private void AddDocumentCore(DocumentInfo info, SourceText initialText, bool isAdditionalDocument)
protected override void ApplyAnalyzerConfigDocumentAdded(DocumentInfo info, SourceText text)
{
AddDocumentCore(info, text, isAdditionalDocument: false, isAnalyzerConfigDocument: true);
}
private void AddDocumentCore(DocumentInfo info, SourceText initialText, bool isAdditionalDocument, bool isAnalyzerConfigDocument)
{
Debug.Assert(!(isAdditionalDocument && isAnalyzerConfigDocument));
var isAdditionalOrAnalyzerConfigDocument = isAdditionalDocument || isAnalyzerConfigDocument;
GetProjectData(info.Id.ProjectId, out var hierarchy, out var project);
// If the first namespace name matches the name of the project, then we don't want to
......@@ -736,15 +750,15 @@ private void AddDocumentCore(DocumentInfo info, SourceText initialText, bool isA
if (IsWebsite(project))
{
AddDocumentToFolder(project, info.Id, SpecializedCollections.SingletonEnumerable(AppCodeFolderName), info.Name, info.SourceCodeKind, initialText, isAdditionalDocument: isAdditionalDocument, filePath: info.FilePath);
AddDocumentToFolder(project, info.Id, SpecializedCollections.SingletonEnumerable(AppCodeFolderName), info.Name, info.SourceCodeKind, initialText, info.FilePath, isAdditionalOrAnalyzerConfigDocument);
}
else if (folders.Any())
{
AddDocumentToFolder(project, info.Id, folders, info.Name, info.SourceCodeKind, initialText, isAdditionalDocument: isAdditionalDocument, filePath: info.FilePath);
AddDocumentToFolder(project, info.Id, folders, info.Name, info.SourceCodeKind, initialText, info.FilePath, isAdditionalOrAnalyzerConfigDocument);
}
else
{
AddDocumentToProject(project, info.Id, info.Name, info.SourceCodeKind, initialText, isAdditionalDocument: isAdditionalDocument, filePath: info.FilePath);
AddDocumentToProject(project, info.Id, info.Name, info.SourceCodeKind, initialText, info.FilePath, isAdditionalOrAnalyzerConfigDocument);
}
var undoManager = TryGetUndoManager();
......@@ -753,6 +767,10 @@ private void AddDocumentCore(DocumentInfo info, SourceText initialText, bool isA
{
undoManager?.Add(new RemoveAdditionalDocumentUndoUnit(this, info.Id));
}
else if (isAnalyzerConfigDocument)
{
undoManager?.Add(new RemoveAnalyzerConfigDocumentUndoUnit(this, info.Id));
}
else
{
undoManager?.Add(new RemoveDocumentUndoUnit(this, info.Id));
......@@ -823,7 +841,7 @@ protected override void AddExistingDocument(DocumentId documentId, string filePa
SourceCodeKind sourceCodeKind,
SourceText initialText = null,
string filePath = null,
bool isAdditionalDocument = false)
bool isAdditionalOrAnalyzerConfigDocument = false)
{
string folderPath = null;
if (filePath == null && !project.TryGetFullPath(out folderPath))
......@@ -832,7 +850,7 @@ protected override void AddExistingDocument(DocumentId documentId, string filePa
throw new Exception(ServicesVSResources.Could_not_find_location_of_folder_on_disk);
}
return AddDocumentToProjectItems(project.ProjectItems, documentId, folderPath, documentName, sourceCodeKind, initialText, filePath, isAdditionalDocument);
return AddDocumentToProjectItems(project.ProjectItems, documentId, folderPath, documentName, sourceCodeKind, initialText, filePath, isAdditionalOrAnalyzerConfigDocument);
}
private ProjectItem AddDocumentToFolder(
......@@ -843,7 +861,7 @@ protected override void AddExistingDocument(DocumentId documentId, string filePa
SourceCodeKind sourceCodeKind,
SourceText initialText = null,
string filePath = null,
bool isAdditionalDocument = false)
bool isAdditionalOrAnalyzerConfigDocument = false)
{
var folder = project.FindOrCreateFolder(folders);
......@@ -854,7 +872,7 @@ protected override void AddExistingDocument(DocumentId documentId, string filePa
throw new Exception(ServicesVSResources.Could_not_find_location_of_folder_on_disk);
}
return AddDocumentToProjectItems(folder.ProjectItems, documentId, folderPath, documentName, sourceCodeKind, initialText, filePath, isAdditionalDocument);
return AddDocumentToProjectItems(folder.ProjectItems, documentId, folderPath, documentName, sourceCodeKind, initialText, filePath, isAdditionalOrAnalyzerConfigDocument);
}
private ProjectItem AddDocumentToProjectItems(
......@@ -865,12 +883,12 @@ protected override void AddExistingDocument(DocumentId documentId, string filePa
SourceCodeKind sourceCodeKind,
SourceText initialText,
string filePath,
bool isAdditionalDocument)
bool isAdditionalOrAnalyzerConfigDocument)
{
if (filePath == null)
{
var baseName = Path.GetFileNameWithoutExtension(documentName);
var extension = isAdditionalDocument ? Path.GetExtension(documentName) : GetPreferredExtension(documentId, sourceCodeKind);
var extension = isAdditionalOrAnalyzerConfigDocument ? Path.GetExtension(documentName) : GetPreferredExtension(documentId, sourceCodeKind);
var uniqueName = projectItems.GetUniqueName(baseName, extension);
filePath = Path.Combine(folderPath, uniqueName);
}
......@@ -889,8 +907,10 @@ protected override void AddExistingDocument(DocumentId documentId, string filePa
}
private void RemoveDocumentCore(
DocumentId documentId, bool isAdditionalDocument)
DocumentId documentId, bool isAdditionalDocument, bool isAnalyzerConfigDocument)
{
Debug.Assert(!(isAdditionalDocument && isAnalyzerConfigDocument));
if (documentId == null)
{
throw new ArgumentNullException(nameof(documentId));
......@@ -919,6 +939,10 @@ protected override void AddExistingDocument(DocumentId documentId, string filePa
{
undoManager?.Add(new AddAdditionalDocumentUndoUnit(this, docInfo, text));
}
else if (isAnalyzerConfigDocument)
{
undoManager?.Add(new AddAnalyzerConfigDocumentUndoUnit(this, docInfo, text));
}
else
{
undoManager?.Add(new AddDocumentUndoUnit(this, docInfo, text));
......@@ -928,12 +952,17 @@ protected override void AddExistingDocument(DocumentId documentId, string filePa
protected override void ApplyDocumentRemoved(DocumentId documentId)
{
RemoveDocumentCore(documentId, isAdditionalDocument: false);
RemoveDocumentCore(documentId, isAdditionalDocument: false, isAnalyzerConfigDocument: false);
}
protected override void ApplyAdditionalDocumentRemoved(DocumentId documentId)
{
RemoveDocumentCore(documentId, isAdditionalDocument: true);
RemoveDocumentCore(documentId, isAdditionalDocument: true, isAnalyzerConfigDocument: false);
}
protected override void ApplyAnalyzerConfigDocumentRemoved(DocumentId documentId)
{
RemoveDocumentCore(documentId, isAdditionalDocument: false, isAnalyzerConfigDocument: true);
}
public override void OpenDocument(DocumentId documentId, bool activate = true)
......@@ -946,6 +975,11 @@ public override void OpenAdditionalDocument(DocumentId documentId, bool activate
OpenDocumentCore(documentId, activate);
}
public override void OpenAnalyzerConfigDocument(DocumentId documentId, bool activate = true)
{
OpenDocumentCore(documentId, activate);
}
public override void CloseDocument(DocumentId documentId)
{
CloseDocumentCore(documentId);
......@@ -956,6 +990,11 @@ public override void CloseAdditionalDocument(DocumentId documentId)
CloseDocumentCore(documentId);
}
public override void CloseAnalyzerConfigDocument(DocumentId documentId)
{
CloseDocumentCore(documentId);
}
public void OpenDocumentCore(DocumentId documentId, bool activate = true)
{
if (documentId == null)
......@@ -1057,6 +1096,11 @@ protected override void ApplyAdditionalDocumentTextChanged(DocumentId documentId
ApplyTextDocumentChange(documentId, newText);
}
protected override void ApplyAnalyzerConfigDocumentTextChanged(DocumentId documentId, SourceText newText)
{
ApplyTextDocumentChange(documentId, newText);
}
private void ApplyTextDocumentChange(DocumentId documentId, SourceText newText)
{
EnsureEditableDocuments(documentId);
......@@ -1070,7 +1114,7 @@ private void ApplyTextDocumentChange(DocumentId documentId, SourceText newText)
{
if (IsDocumentOpen(documentId))
{
var textBuffer = this.CurrentSolution.GetDocument(documentId).GetTextAsync(CancellationToken.None).WaitAndGetResult(CancellationToken.None).Container.TryGetTextBuffer();
var textBuffer = this.CurrentSolution.GetTextDocument(documentId).GetTextAsync(CancellationToken.None).WaitAndGetResult(CancellationToken.None).Container.TryGetTextBuffer();
if (textBuffer != null)
{
......
......@@ -52,7 +52,6 @@
<Compile Include="..\..\..\ExpressionEvaluator\Core\Source\ExpressionCompiler\DkmExceptionUtilities.cs" Link="Implementation\EditAndContinue\Interop\DkmExceptionUtilities.cs" />
<Compile Update="Implementation\MoveToNamespace\MoveToNamespaceDialog.xaml.cs">
<DependentUpon>MoveToNamespaceDialog.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Update="Implementation\PickMembers\PickMembersDialog.xaml.cs">
<DependentUpon>PickMembersDialog.xaml</DependentUpon>
......@@ -78,7 +77,7 @@
<ProjectReference Include="..\..\..\EditorFeatures\Text\Microsoft.CodeAnalysis.EditorFeatures.Text.csproj" />
<ProjectReference Include="..\..\..\Workspaces\Core\Portable\Microsoft.CodeAnalysis.Workspaces.csproj" />
<ProjectReference Include="..\..\..\Features\Core\Portable\Microsoft.CodeAnalysis.Features.csproj" />
<ProjectReference Include="..\..\..\Interactive\Host\Microsoft.CodeAnalysis.InteractiveHost.csproj" PrivateAssets="all" Aliases="InteractiveHost"/>
<ProjectReference Include="..\..\..\Interactive\Host\Microsoft.CodeAnalysis.InteractiveHost.csproj" PrivateAssets="all" Aliases="InteractiveHost" />
</ItemGroup>
<ItemGroup Label="File References">
<Reference Include="System.ComponentModel.Composition" />
......@@ -191,7 +190,7 @@
<PackageReference Include="Microsoft.VisualStudio.TextManager.Interop.12.1.DesignTime" Version="$(MicrosoftVisualStudioTextManagerInterop121DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.TextManager.Interop.16.0.DesignTime" Version="$(MicrosoftVisualStudioTextManagerInterop160DesignTimeVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="$(MicrosoftVisualStudioThreadingVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.VsInteractiveWindow" Version="$(MicrosoftVisualStudioVsInteractiveWindowVersion)" PrivateAssets="all"/>
<PackageReference Include="Microsoft.VisualStudio.VsInteractiveWindow" Version="$(MicrosoftVisualStudioVsInteractiveWindowVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Designer.Interfaces" Version="$(MicrosoftVisualStudioDesignerInterfacesVersion)" />
<PackageReference Include="Microsoft.DiaSymReader" Version="$(MicrosoftDiaSymReaderVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.MSXML" Version="$(MicrosoftMSXMLVersion)" />
......
......@@ -72,7 +72,7 @@ internal override IInvisibleEditor OpenInvisibleEditor(DocumentId documentId)
}
}
var document = this.CurrentSolution.GetDocument(documentId) ?? this.CurrentSolution.GetAdditionalDocument(documentId);
var document = this.CurrentSolution.GetTextDocument(documentId);
return new InvisibleEditor(ServiceProvider.GlobalProvider, document.FilePath, GetHierarchy(documentId.ProjectId), needsSave, needsUndoDisabled);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册