From f212118e92f431c0d855cc29e25a188f520ac28d Mon Sep 17 00:00:00 2001 From: Heejae Chang Date: Tue, 28 Nov 2017 17:17:20 -0800 Subject: [PATCH] =?UTF-8?q?Variable=20misuse=20ML=20model=20found=20a=20bu?= =?UTF-8?q?g=20where=20wrong=20variable=20is=20used=20to=20=E2=80=A6=20(#2?= =?UTF-8?q?3437)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Variable misuse ML model found a bug where wrong variable is used to call a method. * more variable misusage cases --- src/EditorFeatures/TestUtilities/Workspaces/TestHostProject.cs | 2 +- .../TableDataSource/AbstractTableEntriesSnapshot.cs | 2 +- .../Shared/Extensions/ISymbolExtensions_Accessibility.cs | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/EditorFeatures/TestUtilities/Workspaces/TestHostProject.cs b/src/EditorFeatures/TestUtilities/Workspaces/TestHostProject.cs index 480213b702c..3b24a0c4f1f 100644 --- a/src/EditorFeatures/TestUtilities/Workspaces/TestHostProject.cs +++ b/src/EditorFeatures/TestUtilities/Workspaces/TestHostProject.cs @@ -362,7 +362,7 @@ private string GetTestOutputFilePath(string filepath) try { - outputFilePath = Path.GetDirectoryName(_filePath); + outputFilePath = Path.GetDirectoryName(filepath); } catch (ArgumentException) { diff --git a/src/VisualStudio/Core/Def/Implementation/TableDataSource/AbstractTableEntriesSnapshot.cs b/src/VisualStudio/Core/Def/Implementation/TableDataSource/AbstractTableEntriesSnapshot.cs index 852f5c5f838..97f170e63e4 100644 --- a/src/VisualStudio/Core/Def/Implementation/TableDataSource/AbstractTableEntriesSnapshot.cs +++ b/src/VisualStudio/Core/Def/Implementation/TableDataSource/AbstractTableEntriesSnapshot.cs @@ -162,7 +162,7 @@ protected LinePosition GetTrackingLineColumn(Workspace workspace, DocumentId doc } var currentSnapshot = textBuffer.CurrentSnapshot; - return GetLinePosition(snapshot, trackingPoint); + return GetLinePosition(currentSnapshot, trackingPoint); } private LinePosition GetLinePosition(ITextSnapshot snapshot, ITrackingPoint trackingPoint) diff --git a/src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions_Accessibility.cs b/src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions_Accessibility.cs index bca1fb2a76f..424ba2ff9d6 100644 --- a/src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions_Accessibility.cs +++ b/src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions_Accessibility.cs @@ -87,8 +87,6 @@ internal static partial class ISymbolExtensions Contract.Requires(within is INamedTypeSymbol || within is IAssemblySymbol); failedThroughTypeCheck = false; - var withinAssembly = (within as IAssemblySymbol) ?? ((INamedTypeSymbol)within).ContainingAssembly; - switch (symbol.Kind) { case SymbolKind.Alias: -- GitLab