Skip to content

Commit

Permalink
Port to .net core 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ohadApiiro committed Nov 23, 2021
1 parent 41149cd commit a070b65
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/Analysis/Ast/Impl/Microsoft.Python.Analysis.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Microsoft.Python.Analysis</RootNamespace>
<AssemblyName>Microsoft.Python.Analysis</AssemblyName>
<PackageId>Microsoft.Python.Analysis</PackageId>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<Authors>Apiiro</Authors>
<Company>Apiiro</Company>
<RepositoryUrl>https://github.com/apiiro/python-language-server</RepositoryUrl>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Microsoft.Python.Analysis.Tests</RootNamespace>
<AssemblyName>Microsoft.Python.Analysis.Tests</AssemblyName>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Analysis/Core/Impl/Microsoft.Python.Analysis.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Microsoft.Python.Analysis</RootNamespace>
<AssemblyName>Microsoft.Python.Analysis.Core</AssemblyName>
<PackageId>Microsoft.Python.Analysis.Core</PackageId>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<Authors>Apiiro</Authors>
<Company>Apiiro</Company>
<RepositoryUrl>https://github.com/apiiro/python-language-server</RepositoryUrl>
Expand Down
19 changes: 10 additions & 9 deletions src/Core/Impl/Extensions/EnumerableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,15 @@ public static IEnumerable<T> TraverseDepthFirst<T>(this T root, Func<T, IEnumera
}
}

public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> selector) {
var seen = new HashSet<TKey>();

foreach (var item in source) {
if (seen.Add(selector(item))) {
yield return item;
}
}
}
// this method is implemented is System.Linq in .net core 6
// public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> selector) {
// var seen = new HashSet<TKey>();
//
// foreach (var item in source) {
// if (seen.Add(selector(item))) {
// yield return item;
// }
// }
// }
}
}
4 changes: 2 additions & 2 deletions src/Core/Impl/Microsoft.Python.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Microsoft.Python.Core</RootNamespace>
<AssemblyName>Microsoft.Python.Core</AssemblyName>
<PackageId>Microsoft.Python.Core</PackageId>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<Authors>Apiiro</Authors>
<Company>Apiiro</Company>
<RepositoryUrl>https://github.com/apiiro/python-language-server</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Test/Microsoft.Python.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Microsoft.Python.Core.Tests</RootNamespace>
<AssemblyName>Microsoft.Python.Core.Tests</AssemblyName>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Microsoft.Python.LanguageServer</RootNamespace>
<AssemblyName>Microsoft.Python.LanguageServer</AssemblyName>
<PackageId>Microsoft.Python.LanguageServer</PackageId>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<Authors>Apiiro</Authors>
<Company>Apiiro</Company>
<PackageDescription>Apiiro Python Language Server</PackageDescription>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Microsoft.Python.LanguageServer.Tests</RootNamespace>
<AssemblyName>Microsoft.Python.LanguageServer.Tests</AssemblyName>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Parsing/Impl/Microsoft.Python.Parsing.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Microsoft.Python.Parsing</RootNamespace>
<AssemblyName>Microsoft.Python.Parsing</AssemblyName>
<PackageId>Microsoft.Python.Parsing</PackageId>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<Authors>Apiiro</Authors>
<Company>Apiiro</Company>
<RepositoryUrl>https://github.com/apiiro/python-language-server</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/Parsing/Test/Microsoft.Python.Parsing.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Microsoft.Python.Parsing.Tests</RootNamespace>
<AssemblyName>Microsoft.Python.Parsing.Tests</AssemblyName>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/UnitTests/Core/Impl/UnitTests.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Microsoft.Python.UnitTests.Core</RootNamespace>
<AssemblyName>Microsoft.Python.UnitTests.Core</AssemblyName>
</PropertyGroup>
Expand Down

0 comments on commit a070b65

Please sign in to comment.