From 2f2066708730f0283e07e32790bd229741490f39 Mon Sep 17 00:00:00 2001 From: Jason Malinowski Date: Thu, 16 Mar 2017 17:42:16 -0700 Subject: [PATCH] Don't open an editable invisible editor when locating nodes We implement GetStartPoint in a two step process: locate the point directly from the tree, and then take that point and get an EnvDTE.TextPoint from it. In the first step we were opening an editable invisible editor for for no good reason, which was causing us to check out files from source control. The second step does require an invisible editor (since EnvDTE.TextPoint is implemented by the shims) but that we were already opting out of an editable editor for. Going through source control, we used to open an editor for the first step because at the time we were grabbing tab settings which required the editor to be open, but that's no longer the case. --- .../Impl/CodeModel/InternalElements/AbstractCodeElement.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VisualStudio/Core/Impl/CodeModel/InternalElements/AbstractCodeElement.cs b/src/VisualStudio/Core/Impl/CodeModel/InternalElements/AbstractCodeElement.cs index 06f5d8fa866..c426af31f8e 100644 --- a/src/VisualStudio/Core/Impl/CodeModel/InternalElements/AbstractCodeElement.cs +++ b/src/VisualStudio/Core/Impl/CodeModel/InternalElements/AbstractCodeElement.cs @@ -152,7 +152,7 @@ public EnvDTE.TextPoint StartPoint { get { - var point = FileCodeModel.EnsureEditor(() => CodeModelService.GetStartPoint(LookupNode())); + var point = CodeModelService.GetStartPoint(LookupNode()); if (point == null) { return null; @@ -178,7 +178,7 @@ public EnvDTE.TextPoint EndPoint public virtual EnvDTE.TextPoint GetStartPoint(EnvDTE.vsCMPart part) { - var point = FileCodeModel.EnsureEditor(() => CodeModelService.GetStartPoint(LookupNode(), part)); + var point = CodeModelService.GetStartPoint(LookupNode(), part); if (point == null) { return null; -- GitLab