Skip to content

Commit

Permalink
Migrate to .NET7; create x64 and ARM64 packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jbe2277 committed Nov 26, 2022
1 parent 5cd763d commit b47e211
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/DotNetPad/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Product>Waf DotNetPad</Product>
<Company>Waf</Company>
<Copyright>Copyright © 2016-2022 jbe2277</Copyright>
<Version>6.1.1.100</Version>
<Version>7.0.0.100</Version>
<NeutralLanguage>en-US</NeutralLanguage>

<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public DocumentId AddProjectWithDocument(string documentFileName, string text)
var projectId = ProjectId.CreateNewId();

var references = defaultReferences.Distinct().Select(CreateReference).ToList();
references.Add(CreateReference(Assembly.Load("System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")));
references.Add(CreateReference(Assembly.Load("System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")));
if (language == LanguageNames.VisualBasic) { references.Add(CreateReference(typeof(VBMath).Assembly)); }
else if (language == LanguageNames.CSharp) { references.Add(CreateReference(typeof(RuntimeBinderException).Assembly)); }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<AssemblyName>Waf.DotNetPad.Applications</AssemblyName>
<RootNamespace>Waf.DotNetPad.Applications</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Waf.Wpf" Version="6.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="4.2.0" />
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.Features" Version="4.2.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="4.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.Features" Version="4.4.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/DotNetPad/DotNetPad.Domain/DotNetPad.Domain.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<AssemblyName>Waf.DotNetPad.Domain</AssemblyName>
<RootNamespace>Waf.DotNetPad.Domain</RootNamespace>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/DotNetPad/DotNetPad.Packaging/DotNetPad.Packaging.wapproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<GenerateTestArtifacts>False</GenerateTestArtifacts>
<AppxBundlePlatforms>neutral</AppxBundlePlatforms>
<AppxBundlePlatforms>x64|arm64</AppxBundlePlatforms>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
Expand Down Expand Up @@ -155,7 +155,7 @@
</ItemGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
<ItemGroup>
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DotNetPad.Presentation\DotNetPad.Presentation.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion src/DotNetPad/DotNetPad.Packaging/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Identity
Name="50628JuergenBerchtel.WafDotNetPad"
Publisher="CN=3C8CBF61-934D-4358-AA07-F08013E88454"
Version="6.1.1.0" />
Version="7.0.0.0" />

<Properties>
<DisplayName>Waf DotNetPad</DisplayName>
Expand Down
11 changes: 6 additions & 5 deletions src/DotNetPad/DotNetPad.Presentation/Controls/CodeEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,11 @@ private async Task ShowCompletionAsync(char? triggerChar)
if (completionWindow == null && (triggerChar == null || triggerChar == '.' || IsAllowedLanguageLetter(triggerChar.Value)))
{
var position = CaretOffset;
var word = GetWord(position);
var (wordStart, text) = GetWord(position);

var document = WorkspaceService.GetDocument(DocumentFile);
var completionService = CompletionService.GetService(document);
if (completionService is null) return;

var completionList = await Task.Run(async () => await completionService.GetCompletionsAsync(document, position, cancellationToken: cancellationToken), cancellationToken);
if (completionList == null) return;
Expand All @@ -114,16 +115,16 @@ private async Task ShowCompletionAsync(char? triggerChar)
};
completionWindow.MaxWidth = completionWindow.Width = 340;
completionWindow.MaxHeight = completionWindow.Height = 206;
foreach (var completionItem in completionList.Items)
foreach (var completionItem in completionList.ItemsList)
{
completionWindow.CompletionList.CompletionData.Add(new CodeCompletionData(completionItem.DisplayText,
() => GetDescriptionAsync(completionService, document, completionItem), completionItem.Tags));
}

if (triggerChar == null || IsAllowedLanguageLetter(triggerChar.Value))
{
completionWindow.StartOffset = word.wordStart;
completionWindow.CompletionList.SelectItem(word.text);
completionWindow.StartOffset = wordStart;
completionWindow.CompletionList.SelectItem(text);
}
completionWindow.Show();
completionWindow.Closed += (s2, e2) => completionWindow = null;
Expand All @@ -135,7 +136,7 @@ private async Task ShowCompletionAsync(char? triggerChar)

private static async Task<ImmutableArray<TaggedText>> GetDescriptionAsync(CompletionService completionService, Document document, CompletionItem completionItem)
{
return (await Task.Run(async () => await completionService.GetDescriptionAsync(document, completionItem))).TaggedParts;
return (await Task.Run(async () => await completionService.GetDescriptionAsync(document, completionItem)))?.TaggedParts ?? default;
}

private (int wordStart, string text) GetWord(int position)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<RootNamespace>Waf.DotNetPad.Presentation</RootNamespace>
<AssemblyName>DotNetPad</AssemblyName>
<AssemblyTitle>Waf DotNetPad</AssemblyTitle>
<ApplicationIcon>Resources\Images\DotNetPad.ico</ApplicationIcon>
<Platforms>AnyCPU;x64;ARM64</Platforms>
</PropertyGroup>

<PropertyGroup Condition=" '$(Platform)' == 'x64' ">
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'ARM64' ">
<PlatformTarget>ARM64</PlatformTarget>
</PropertyGroup>

<ItemGroup>
Expand Down
16 changes: 8 additions & 8 deletions src/DotNetPad/DotNetPad.sln
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,20 @@ Global
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Debug|Any CPU.Build.0 = Debug|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Debug|ARM.ActiveCfg = Debug|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Debug|ARM.Build.0 = Debug|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Debug|ARM64.Build.0 = Debug|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Debug|x64.ActiveCfg = Debug|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Debug|x64.Build.0 = Debug|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Debug|ARM64.ActiveCfg = Debug|ARM64
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Debug|ARM64.Build.0 = Debug|ARM64
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Debug|x64.ActiveCfg = Debug|x64
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Debug|x64.Build.0 = Debug|x64
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Debug|x86.ActiveCfg = Debug|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Debug|x86.Build.0 = Debug|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Release|Any CPU.ActiveCfg = Release|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Release|Any CPU.Build.0 = Release|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Release|ARM.ActiveCfg = Release|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Release|ARM.Build.0 = Release|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Release|ARM64.ActiveCfg = Release|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Release|ARM64.Build.0 = Release|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Release|x64.ActiveCfg = Release|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Release|x64.Build.0 = Release|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Release|ARM64.ActiveCfg = Release|ARM64
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Release|ARM64.Build.0 = Release|ARM64
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Release|x64.ActiveCfg = Release|x64
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Release|x64.Build.0 = Release|x64
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Release|x86.ActiveCfg = Release|Any CPU
{27BC0A1B-0E66-4F47-B6D1-A6EDE5211184}.Release|x86.Build.0 = Release|Any CPU
{45949512-174B-4A6B-ABFE-A9BAF241057C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down

0 comments on commit b47e211

Please sign in to comment.