Skip to content

Commit

Permalink
Upgrade everything
Browse files Browse the repository at this point in the history
  • Loading branch information
aelij committed Nov 22, 2022
1 parent d50856a commit 0a49820
Show file tree
Hide file tree
Showing 74 changed files with 462 additions and 1,241 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ dotnet_diagnostic.CA2007.severity = error
dotnet_diagnostic.IDE0042.severity = none
dotnet_diagnostic.IDE0058.severity = none
dotnet_diagnostic.VSTHRD100.severity = none
dotnet_diagnostic.VSTHRD110.severity = none
dotnet_diagnostic.VSTHRD200.severity = none

# XAML
Expand Down
28 changes: 6 additions & 22 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<DefaultTargetFramework>net6.0</DefaultTargetFramework>
<TargetFrameworks Condition=" $(MSBuildProjectName.EndsWith('Windows')) ">$(DefaultTargetFramework)-windows;net48</TargetFrameworks>
<TargetFramework Condition=" '$(TargetFrameworks)' == '' and $(MSBuildProjectName.Contains('Windows')) ">$(DefaultTargetFramework)-windows</TargetFramework>
<DefaultTargetFramework>net7.0</DefaultTargetFramework>
<LtsTargetFramework>net6.0</LtsTargetFramework>
<TargetFramework Condition=" $(MSBuildProjectName.Contains('Windows')) ">$(DefaultTargetFramework)-windows</TargetFramework>
<TargetFramework Condition=" '$(TargetFramework)' == '' and '$(TargetFrameworks)' == '' ">$(DefaultTargetFramework)</TargetFramework>
<Features>strict</Features>
<Deterministic>True</Deterministic>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<EditorPackageVersion>1.3.0</EditorPackageVersion>
<RoslynPackageVersion>4.0.1</RoslynPackageVersion>
<RoslynAssemblyVersion>4.0.1.0</RoslynAssemblyVersion>
<AvaloniaVersion>0.10.10</AvaloniaVersion>
<AvaloniaEditVersion>0.10.9</AvaloniaEditVersion>
<DotNetVersion>[6.0.*,6.0.0]</DotNetVersion>
<RxVersion>5.0.0</RxVersion>
<LangVersion>9.0</LangVersion>
<Version>4.4.0</Version>
<AvaloniaEditVersion>0.10.12.2</AvaloniaEditVersion>
<LangVersion>latest</LangVersion>
<Nullable>Enable</Nullable>
<IsPackable>false</IsPackable>
<Authors>Eli Arbel</Authors>
Expand All @@ -31,12 +23,4 @@
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<IncludePackageReferencesDuringMarkupCompilation>true</IncludePackageReferencesDuringMarkupCompilation>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
47 changes: 47 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<PropertyGroup>
<DotNetVersion>7.0.0</DotNetVersion>
<RoslynVersion>4.4.0</RoslynVersion>
<RoslynPrivateVersion>4.4.0-6.22561.11</RoslynPrivateVersion>
<AvaloniaVersion>0.10.18</AvaloniaVersion>
<RxVersion>5.0.0</RxVersion>
<NuGetVersion>6.4.0</NuGetVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="AvalonEdit" Version="6.1.3.50" />
<PackageVersion Include="Avalonia.AvaloniaEdit" Version="0.10.12.2" />
<PackageVersion Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)" />
<PackageVersion Include="AvalonLibrary" Version="3.0.0" />
<PackageVersion Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.0.0-beta.5" />
<PackageVersion Include="Dirkster.AvalonDock" Version="4.70.3" />
<PackageVersion Include="IgnoresAccessChecksToGenerator" Version="0.5.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Features" Version="$(RoslynVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="$(RoslynVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(RoslynVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="$(RoslynVersion)" />
<PackageVersion Include="Microsoft.DiaSymReader.Native" Version="1.7.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="$(DotnetVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="$(DotnetVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="$(DotnetVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="$(DotnetVersion)" />
<PackageVersion Include="Mono.Cecil" Version="0.11.4" />
<PackageVersion Include="Nerdbank.Streams" Version="2.9.112" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
<PackageVersion Include="NuGet.Commands" Version="$(NuGetVersion)" />
<PackageVersion Include="NuGet.Versioning" Version="$(NuGetVersion)" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.Reactive.Core" Version="$(RxVersion)" />
<PackageVersion Include="System.Reactive.Linq" Version="$(RxVersion)" />
<PackageVersion Include="System.Reflection.MetadataLoadContext" Version="$(DotnetVersion)" />
<PackageVersion Include="System.Reflection.Metadata" Version="$(DotnetVersion)" />
<PackageVersion Include="System.Composition" Version="$(DotnetVersion)" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageVersion Include="Xunit.StaFact" Version="1.1.11" />
<PackageVersion Include="xunit" Version="2.4.2" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ RoslynPad is also available as NuGet packages which allow you to use Roslyn serv

## Building

Open `src\RoslynPad.sln` in Visual Studio 2019.
Open `src\RoslynPad.sln` in Visual Studio 2022.

## Running the cross-platform .NET Core Avalonia version (on Mac or Linux)

* Install .NET Core SDK 6.0
* Install .NET Core SDK 7.0
* Download and unzip `RoslynPadNetCore.zip`.
* Run `dotnet RoslynPad.dll`

Expand Down
5 changes: 4 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"sdk": {
"version": "6.0.100"
"version": "7.0.100"
},
"msbuild-sdks": {
"Microsoft.Build.NoTargets": "3.4.0"
}
}
7 changes: 3 additions & 4 deletions samples/RoslynPadReplSample/RoslynPadReplSample.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<UseWPF>true</UseWPF>
<OutputType>WinExe</OutputType>
Expand All @@ -9,7 +8,7 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="RoslynPad.Editor.Windows" Version="1.2.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="3.6.0" />
<PackageReference Include="RoslynPad.Editor.Windows" VersionOverride="1.2.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" VersionOverride="3.6.0" />
</ItemGroup>
</Project>
5 changes: 0 additions & 5 deletions samples/global.json

This file was deleted.

5 changes: 3 additions & 2 deletions src/NuGet.Config
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
</configuration>
24 changes: 24 additions & 0 deletions src/RestoreHelper/RestoreHelper.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.Build.NoTargets">
<PropertyGroup>
<TargetFramework>$(LtsTargetFramework)</TargetFramework>
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
<RestoreSources>
https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json;
https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json;
https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json;
https://api.nuget.org/v3/index.json
</RestoreSources>
</PropertyGroup>
<!--
Unfortunately we can't use the public feed version because it doesn't contain `LanguageServer.Protocol`.
Must correlate its version using the Git commit ID.
-->
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.LanguageServer.Protocol" Version="$(RoslynPrivateVersion)" GeneratePathProperty="true" IncludeAssets="none" PrivateAssets="all" />
</ItemGroup>
<Target Name="GetLibReferences" Outputs="@(Reference)">
<ItemGroup>
<Reference Include="$(PkgMicrosoft_CodeAnalysis_LanguageServer_Protocol)/lib/netcoreapp3.1/*.dll" />
</ItemGroup>
</Target>
</Project>
15 changes: 3 additions & 12 deletions src/RoslynPad.Avalonia/Formatting/CodeActionToGlyphConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,10 @@ namespace RoslynPad.Formatting
{
internal sealed class CodeActionToGlyphConverter : MarkupExtension, IValueConverter
{
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
public override object ProvideValue(IServiceProvider serviceProvider) => this;

public object? Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return ((CodeAction)value).GetGlyph().ToImageSource();
}
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) => (value as CodeAction)?.GetGlyph().ToImageSource();

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => throw new NotSupportedException();
}
}
15 changes: 3 additions & 12 deletions src/RoslynPad.Avalonia/Formatting/CodeActionsConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,10 @@ namespace RoslynPad.Formatting
{
internal sealed class CodeActionsConverter : MarkupExtension, IValueConverter
{
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
public override object ProvideValue(IServiceProvider serviceProvider) => this;

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return ((CodeAction)value).GetCodeActions();
}
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) => (value as CodeAction)?.GetCodeActions();

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => throw new NotSupportedException();
}
}
8 changes: 5 additions & 3 deletions src/RoslynPad.Avalonia/OpenFileDialogAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public UI.FileDialogFilter Filter
{
set
{
if (_dialog.Filters == null) return;

_dialog.Filters.Clear();
if (value == null)
{
Expand All @@ -54,10 +56,10 @@ public string FileName
set => _dialog.InitialFileName = value;
}

public Task<string[]?> ShowAsync()
public async Task<string[]?> ShowAsync()
{
var active = (Application.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.Windows.First(w => w.IsActive);
return _dialog.ShowAsync(active!);
var active = (Application.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.Windows.FirstOrDefault(w => w.IsActive);
return active == null ? null : await _dialog.ShowAsync(active).ConfigureAwait(true);
}
}
}
6 changes: 3 additions & 3 deletions src/RoslynPad.Avalonia/RoslynPad.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<AvaloniaResource Include="Resources\RoslynPad.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="$(DotnetVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="$(DotnetVersion)" />
<PackageReference Include="Avalonia.Desktop" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RoslynPad.Common.UI\RoslynPad.Common.UI.csproj" />
Expand Down
8 changes: 5 additions & 3 deletions src/RoslynPad.Avalonia/SaveFileDialogAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public UI.FileDialogFilter Filter
{
set
{
if (_dialog.Filters == null) return;

_dialog.Filters.Clear();
if (value == null)
{
Expand All @@ -60,10 +62,10 @@ public string FileName
set => _dialog.InitialFileName = value;
}

public Task<string?> ShowAsync()
public async Task<string?> ShowAsync()
{
var active = (Application.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.Windows.First(w => w.IsActive);
return _dialog.ShowAsync(active!);
var active = (Application.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.Windows.FirstOrDefault(w => w.IsActive);
return active == null ? null : await _dialog.ShowAsync(active).ConfigureAwait(true);
}
}
}
2 changes: 1 addition & 1 deletion src/RoslynPad.Avalonia/TelemetryProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public override void Initialize(string version, IApplicationSettings settings)
// Application.Current.DispatcherUnhandledException += OnUnhandledDispatcherException;
}

//private void OnUnhandledDispatcherException(object sender, DispatcherUnhandledExceptionEventArgs args)
//private void OnUnhandledDispatcherException(object? sender, DispatcherUnhandledExceptionEventArgs args)
//{
// HandleException(args.Exception);
// args.Handled = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace RoslynPad.Converters
{
public class DoubleToPercentageTextConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
var percent = value as double? ?? 0;
if (percent <= 0) percent = 0;
Expand All @@ -15,9 +15,6 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
return ((int)Math.Round(percent * 100.0, 0)) + "%";
}

public object? ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => null;
}
}
11 changes: 5 additions & 6 deletions src/RoslynPad.Build/RoslynPad.Build.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<ProjectReference Include="..\RoslynPad.Roslyn\RoslynPad.Roslyn.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
<PackageReference Include="NuGet.Versioning" Version="5.11.0" />
<PackageReference Include="Nerdbank.Streams" Version="2.8.46" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="$(DotnetVersion)" />
<PackageReference Include="Mono.Cecil" />
<PackageReference Include="NuGet.Versioning" />
<PackageReference Include="Nerdbank.Streams" />
<PackageReference Include="Microsoft.Extensions.Logging" />
</ItemGroup>
</Project>
14 changes: 5 additions & 9 deletions src/RoslynPad.Common.UI/RoslynPad.Common.UI.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>RoslynPad.UI</RootNamespace>
</PropertyGroup>
Expand All @@ -11,12 +10,9 @@
<ProjectReference Include="..\RoslynPad.Roslyn\RoslynPad.Roslyn.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.18.0" />
<PackageReference Include="NuGet.Commands" Version="5.11.3" />
<PackageReference Include="System.ComponentModel" Version="4.3.0" />
<PackageReference Include="System.IO.FileSystem.Watcher" Version="4.3.0" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
<PackageReference Include="System.Reactive.Core" Version="$(RxVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="$(DotnetVersion)" />
<PackageReference Include="Azure.Monitor.OpenTelemetry.Exporter" />
<PackageReference Include="NuGet.Commands" />
<PackageReference Include="System.Reactive.Core" />
<PackageReference Include="Microsoft.Extensions.Logging" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/RoslynPad.Common.UI/Services/DocumentFileWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public string Path
}
}

private void OnChanged(object sender, FileSystemEventArgs e)
private void OnChanged(object? sender, FileSystemEventArgs e)
{
Publish(new DocumentFileChanged(ToDocumentFileChangeType(e.ChangeType), e.FullPath));
}
Expand All @@ -85,7 +85,7 @@ private DocumentFileChangeType ToDocumentFileChangeType(WatcherChangeTypes chang
}
}

private void OnRenamed(object sender, RenamedEventArgs e)
private void OnRenamed(object? sender, RenamedEventArgs e)
{
Publish(new DocumentFileChanged(ToDocumentFileChangeType(e.ChangeType), e.OldFullPath, e.FullPath));
}
Expand Down
Loading

0 comments on commit 0a49820

Please sign in to comment.