Skip to content

Commit

Permalink
Merge pull request #167 from earloc/bug/operationCanceled
Browse files Browse the repository at this point in the history
Bug: operation canceled
  • Loading branch information
earloc authored Sep 19, 2023
2 parents ecb373d + 2a31f4d commit 5dd8159
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.5" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.11" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Playground.Common/Playground.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.5" />
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.11" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Playground.Console/Playground.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.5" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.11" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/TypealizR.CLI/TypealizR.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


<ItemGroup>
<PackageReference Include="Microsoft.Build.Locator" Version="1.5.5" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.6.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.3.1" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.3.1" />
Expand Down
14 changes: 7 additions & 7 deletions src/TypealizR.Tests/TypealizR.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NuGet.Frameworks" Version="6.6.0" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.23.1">
<PackageReference Include="NuGet.Frameworks" Version="6.7.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.24.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.5" />
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.11" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Verify.SourceGenerators" Version="2.1.0" />
<PackageReference Include="Verify.Xunit" Version="20.8.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Verify.Xunit" Version="21.1.4" />
<PackageReference Include="xunit" Version="2.5.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private static void TryAddProperties(CodeFirstClassBuilder builder, List<Diagnos
allTrivias = tree.GetCompilationUnitRoot(cancellationToken).GetLeadingTrivia().Where(x => x.HasStructure).ToArray();
}

var documentation = allTrivias.FirstOrDefault(x => x.IsKind(SyntaxKind.SingleLineDocumentationCommentTrivia));
var documentation = Array.Find(allTrivias, x => x.IsKind(SyntaxKind.SingleLineDocumentationCommentTrivia));

if (documentation.GetStructure() is not DocumentationCommentTriviaSyntax structure)
{
Expand Down
5 changes: 2 additions & 3 deletions src/TypealizR/Core/RessourceFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,15 @@ public static IEnumerable<RessourceFile> From(ImmutableArray<AdditionalTextWithO
&& !string.IsNullOrEmpty(useParamNamesInMethodNamesItemMetadataString)
&& bool.TryParse(useParamNamesInMethodNamesItemMetadataString, out var useParamNamesInMethodNamesItemMetadata))
{

useParamNamesInMethodNames = useParamNamesInMethodNamesItemMetadata;

}

var content = cancellationToken.IsCancellationRequested ? string.Empty : _.MainFile.Text.GetText()?.ToString() ?? string.Empty;

return new RessourceFile(
simpleName: _.Name,
fullPath: _.MainFile.Text.Path,
content: _.MainFile.Text.GetText(cancellationToken)?.ToString() ?? string.Empty,
content: content,
customToolNamespace: customToolNamespace,
useParamNamesInMethodNames: useParamNamesInMethodNames
);
Expand Down
4 changes: 2 additions & 2 deletions src/TypealizR/Core/ResxFileSourceGeneratorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public abstract class ResxFileSourceGeneratorBase : IIncrementalGenerator
{
public void Initialize(IncrementalGeneratorInitializationContext context)
{

var optionsProvider = context.AnalyzerConfigOptionsProvider
.Select((x, cancel) => GeneratorOptions.From(x.GlobalOptions)
);
Expand Down Expand Up @@ -42,6 +41,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
GenerateSourceFor(ctxt, options, compilation, file);
}
});

}

protected void GenerateSourceFor(SourceProductionContext ctxt, GeneratorOptions options, Compilation compilation, RessourceFile file)
Expand Down Expand Up @@ -104,7 +104,7 @@ private static (string, Accessibility) FindNameSpaceAndAccessabilityOf(Compilati
return (nameSpace.Trim('.', ' '), Accessibility.Internal);
}

var matchingMarkerType = possibleMarkerTypeSymbols.FirstOrDefault(x => x.ContainingNamespace.OriginalDefinition.ToDisplayString() == nameSpace);
var matchingMarkerType = Array.Find(possibleMarkerTypeSymbols, x => x.ContainingNamespace.OriginalDefinition.ToDisplayString() == nameSpace);

if (matchingMarkerType is null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/TypealizR/TypealizR.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" />
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.5" PrivateAssets="all" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.11" PrivateAssets="all" GeneratePathProperty="true" />
</ItemGroup>
<ItemGroup>
<XliffResource Include="MultilingualResources\TypealizR.de.xlf" />
Expand Down

0 comments on commit 5dd8159

Please sign in to comment.