Skip to content
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

Implicit usings #809

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<DebugType Condition="$(OS) == 'Windows_NT'">embedded</DebugType>
<LangVersion>latest</LangVersion>
<NoWarn>$(NoWarn);NU1701;CS8632</NoWarn>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

</Project>
3 changes: 1 addition & 2 deletions src/BinlogTool/BinlogToolCommandBase.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.IO;
using Microsoft.Build.Logging.StructuredLogger;
using Microsoft.Build.Logging.StructuredLogger;

namespace BinlogTool
{
Expand Down
1 change: 0 additions & 1 deletion src/BinlogTool/CompilerInvocations.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Linq;
using Microsoft.Build.Logging.StructuredLogger;

namespace BinlogTool
Expand Down
12 changes: 1 addition & 11 deletions src/BinlogTool/DumpRecords.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Build.Logging.StructuredLogger;
using Microsoft.Build.Logging;
using StructuredLogger.Utils;
using Microsoft.Build.Logging.StructuredLogger;

namespace BinlogTool
{
Expand Down
6 changes: 1 addition & 5 deletions src/BinlogTool/ListNuGet.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Build.Logging.StructuredLogger;
using Microsoft.Build.Logging.StructuredLogger;

namespace BinlogTool
{
Expand Down
7 changes: 2 additions & 5 deletions src/BinlogTool/ListTools.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Build.Logging.StructuredLogger;
using Microsoft.Build.Logging.StructuredLogger;
using Task = Microsoft.Build.Logging.StructuredLogger.Task;

namespace BinlogTool
{
Expand Down
4 changes: 1 addition & 3 deletions src/BinlogTool/Log.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace BinlogTool
{
public class Log
Expand Down Expand Up @@ -60,4 +58,4 @@ public static void WriteError(string message)
}
}
}
}
}
8 changes: 1 addition & 7 deletions src/BinlogTool/Program.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
using Microsoft.Build.Logging.StructuredLogger;
using Microsoft.Build.Logging.StructuredLogger;

namespace BinlogTool
{
Expand Down
5 changes: 1 addition & 4 deletions src/BinlogTool/Redact.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Diagnostics;
using StructuredLogger.Utils;

namespace BinlogTool
Expand Down
5 changes: 1 addition & 4 deletions src/BinlogTool/SaveFiles.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Diagnostics;
using System.Xml.Linq;
using Microsoft.Build.Logging.StructuredLogger;

Expand Down
3 changes: 1 addition & 2 deletions src/BinlogTool/SaveStrings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Linq;
using Microsoft.Build.Logging.StructuredLogger;
using Microsoft.Build.Logging.StructuredLogger;

namespace BinlogTool
{
Expand Down
9 changes: 2 additions & 7 deletions src/BinlogTool/Search.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using Microsoft.Build.Logging.StructuredLogger;
using Microsoft.Build.Logging.StructuredLogger;
using StructuredLogViewer;

namespace BinlogTool
Expand Down Expand Up @@ -71,7 +66,7 @@ private void SearchInFile(string binlogFilePath, string searchText)
{
var build = this.ReadBuild(binlogFilePath);
BuildAnalyzer.AnalyzeBuild(build);

var search = new Search(
new[] { build },
build.StringTable.Instances,
Expand Down
6 changes: 1 addition & 5 deletions src/ResourcesGenerator/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.IO;
using System.Linq;

namespace ResourcesGenerator
namespace ResourcesGenerator
{
class Program
{
Expand Down
3 changes: 0 additions & 3 deletions src/ResourcesGenerator/ResourceCreator.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using Newtonsoft.Json;
Expand Down
6 changes: 2 additions & 4 deletions src/StructuredLogViewer.Avalonia/BuildParametersScreen.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Collections.ObjectModel;
using System.Windows.Input;
using Microsoft.Build.Logging.StructuredLogger;
using StructuredLogViewer.Core;
Expand Down Expand Up @@ -79,4 +77,4 @@ public async System.Threading.Tasks.Task BrowseForMSBuildAsync()
UpdateMSBuildLocations();
}
}
}
}
12 changes: 4 additions & 8 deletions src/StructuredLogViewer.Avalonia/Controls/BuildControl.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Collections;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Xml;
using Avalonia;
using Avalonia.Controls;
Expand All @@ -17,6 +12,7 @@
using Avalonia.Threading;
using Microsoft.Build.Logging.StructuredLogger;
using Microsoft.Language.Xml;
using Task = Microsoft.Build.Logging.StructuredLogger.Task;

namespace StructuredLogViewer.Avalonia.Controls
{
Expand Down Expand Up @@ -232,7 +228,7 @@ Style GetTreeViewItemStyle()
var text =
@"This log contains the full text of projects and imported files used during the build.
You can use the 'Files' tab in the bottom left to view these files and the 'Find in Files' tab for full-text search.
For many nodes in the tree (Targets, Tasks, Errors, Projects, etc) pressing SPACE or ENTER or double-clicking
For many nodes in the tree (Targets, Tasks, Errors, Projects, etc) pressing SPACE or ENTER or double-clicking
on the node will navigate to the corresponding source code associated with the node.

More functionality is available from the right-click context menu for each node.
Expand Down Expand Up @@ -868,7 +864,7 @@ private void BuildControl_Loaded(object sender, RoutedEventArgs e)
public void SelectItem(BaseNode item)
{
var parentChain = item.GetParentChainExcludingThis();

foreach (var node in parentChain)
{
if (node is TreeNode treeNode)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives.PopupPositioning;
using Avalonia.Input;
Expand All @@ -11,7 +8,6 @@
using AvaloniaEdit.Document;
using AvaloniaEdit.Rendering;
using Microsoft.Build.Logging.StructuredLogger;
using FontStyle = Avalonia.Media.FontStyle;

namespace StructuredLogViewer.Avalonia.Controls
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Microsoft.Build.Logging.StructuredLogger;
using Microsoft.Build.Logging.StructuredLogger;

namespace StructuredLogViewer.Avalonia.Controls
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Globalization;
using Avalonia.Data.Converters;
using Avalonia.Media;
Expand All @@ -15,7 +14,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
return Brushes.Black;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> throw new NotSupportedException();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Globalization;
using Avalonia.Data.Converters;

Expand All @@ -8,7 +7,7 @@ public class NodeLowRelevanceToOpacityConverter : IValueConverter
{
private static readonly object boxedLowRelevance = 0.25;
private static readonly object boxedHighRelevance = 1.0;

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool isLowRelevance)
Expand All @@ -17,7 +16,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
return boxedHighRelevance;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> throw new NotSupportedException();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using Avalonia;
using Avalonia.Data.Converters;
Expand All @@ -17,16 +15,16 @@ public DrawingGroup ProjectExtensionToIcon(string projectExtension)
{
case ".sln":
return GetIcon("SlnIcon");

case ".csproj":
return GetIcon("CSProjIcon");

case ".vbproj":
return GetIcon("VBProjIcon");

case ".fsproj":
return GetIcon("FSProjIcon");

default:
return GetIcon("GenericProjectIcon");
}
Expand All @@ -46,10 +44,10 @@ private DrawingGroup GetIcon(string resourceName)
return icon;
}

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
=> ProjectExtensionToIcon(value as string);

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> throw new NotSupportedException();
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Globalization;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Shapes;
using Avalonia.Data.Converters;
using Avalonia.Media;
using Microsoft.Build.Logging.StructuredLogger;
using Task = Microsoft.Build.Logging.StructuredLogger.Task;

namespace StructuredLogViewer.Avalonia.Controls
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Avalonia.Threading;
using System;
using System.Collections;
using System.Threading;
using Avalonia;
using Avalonia.Controls.Presenters;
using System.Linq;

namespace StructuredLogViewer.Avalonia.Controls
{
Expand Down Expand Up @@ -73,7 +70,7 @@ public void TriggerSearch(string text, int maxResults)
{
typingConcurrentOperation.TriggerSearch(text, maxResults);
}

private void searchTextBox_TextChanged(object sender, AvaloniaPropertyChangedEventArgs e)
{
if (e.Property != TextBox.TextProperty) return;
Expand All @@ -86,7 +83,7 @@ private void searchTextBox_TextChanged(object sender, AvaloniaPropertyChangedEve
typingConcurrentOperation.Reset();

// only clear the contents when we have a search function defined.
// if the text input is handled externally, don't mess with the
// if the text input is handled externally, don't mess with the
// content
if (ExecuteSearch != null)
{
Expand Down
6 changes: 2 additions & 4 deletions src/StructuredLogViewer.Avalonia/Controls/SourceFileTab.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.IO;
using Microsoft.Build.Logging.StructuredLogger;
using Microsoft.Build.Logging.StructuredLogger;

namespace StructuredLogViewer.Avalonia.Controls
{
Expand All @@ -10,7 +8,7 @@ public class SourceFileTab
public string FilePath { get; set; }

public TextViewerControl Content { get; set; }

public Command Close { get; }
public event Action<SourceFileTab> CloseRequested;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Globalization;
using System.Globalization;
using Avalonia.Data.Converters;

namespace StructuredLogViewer.Avalonia.Controls
Expand Down
Loading