File tree 6 files changed +33
-10
lines changed
6 files changed +33
-10
lines changed Original file line number Diff line number Diff line change 13
13
build :
14
14
runs-on : windows-latest
15
15
steps :
16
- - uses : actions/checkout@v2
16
+ - uses : actions/checkout@v4
17
17
- name : Setup .NET Core
18
- uses : actions/setup-dotnet@v1
18
+ uses : actions/setup-dotnet@v4
19
19
with :
20
20
dotnet-version : ${{ env.DOTNET_CORE_VERSION }}
21
21
- name : Restore
27
27
- name : Publish
28
28
run : dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_WEBAPP_PACKAGE_PATH }}"
29
29
- name : Publish Artifacts
30
- uses : actions/upload-artifact@v1.0.0
30
+ uses : actions/upload-artifact@v4
31
31
with :
32
32
name : webapp
33
33
path : ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
36
36
needs : build
37
37
steps :
38
38
- name : Download artifact from build job
39
- uses : actions/download-artifact@v4.1.7
39
+ uses : actions/download-artifact@v4
40
40
with :
41
41
name : webapp
42
42
path : ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
Original file line number Diff line number Diff line change 21
21
# Roslyn cache directories
22
22
* .vs /
23
23
24
+ # Rider
25
+ .idea /
26
+
24
27
# MSTest test Results
25
28
[Tt ]est [Rr ]esult * /
26
29
[Bb ]uild [Ll ]og. *
Original file line number Diff line number Diff line change 6
6
</PropertyGroup >
7
7
8
8
<ItemGroup >
9
- <PackageReference Include =" xunit" Version =" 2.4 .2" />
10
- <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.4.5 " >
9
+ <PackageReference Include =" xunit" Version =" 2.9 .2" />
10
+ <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.8.2 " >
11
11
<PrivateAssets >all</PrivateAssets >
12
12
<IncludeAssets >runtime;build;native;contentFiles;analyzers</IncludeAssets >
13
13
</PackageReference >
Original file line number Diff line number Diff line change @@ -867,6 +867,13 @@ public void TestRecordStruct()
867
867
nodeKind : NodeKind . MemberDeclaration ) ;
868
868
}
869
869
870
+ [ Fact ]
871
+ public void TestIssue85 ( )
872
+ {
873
+ Test ( "using Foo = object;" ) ;
874
+ Test ( "using Foo = (int foo, int bar);" ) ;
875
+ }
876
+
870
877
private void Test (
871
878
string sourceText ,
872
879
string expected ,
Original file line number Diff line number Diff line change @@ -1044,12 +1044,25 @@ private MethodInfo PickFactoryMethodToCreateNode(SyntaxNode node)
1044
1044
return candidates . First ( ) ;
1045
1045
}
1046
1046
1047
- var usingDirectiveSyntax = node as UsingDirectiveSyntax ;
1048
- if ( usingDirectiveSyntax != null )
1047
+ if ( node is UsingDirectiveSyntax usingDirectiveSyntax )
1049
1048
{
1050
1049
if ( usingDirectiveSyntax . Alias == null )
1051
1050
{
1052
- candidates = candidates . Where ( m => m . ToString ( ) != "Microsoft.CodeAnalysis.CSharp.Syntax.UsingDirectiveSyntax UsingDirective(Microsoft.CodeAnalysis.CSharp.Syntax.NameEqualsSyntax, Microsoft.CodeAnalysis.CSharp.Syntax.NameSyntax)" ) ;
1051
+ const string signatureWithNameSyntax = "Microsoft.CodeAnalysis.CSharp.Syntax.UsingDirectiveSyntax UsingDirective(Microsoft.CodeAnalysis.CSharp.Syntax.NameEqualsSyntax, Microsoft.CodeAnalysis.CSharp.Syntax.NameSyntax)" ;
1052
+ const string signatureWithTypeSyntax = "Microsoft.CodeAnalysis.CSharp.Syntax.UsingDirectiveSyntax UsingDirective(Microsoft.CodeAnalysis.CSharp.Syntax.NameEqualsSyntax, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax)" ;
1053
+
1054
+ candidates = candidates . Where ( m => m . ToString ( ) is not ( signatureWithNameSyntax or signatureWithTypeSyntax ) ) ;
1055
+ }
1056
+ else
1057
+ {
1058
+ var preferredSignature = usingDirectiveSyntax . NamespaceOrType is NameSyntax
1059
+ ? "Microsoft.CodeAnalysis.CSharp.Syntax.UsingDirectiveSyntax UsingDirective(Microsoft.CodeAnalysis.CSharp.Syntax.NameSyntax)"
1060
+ : "Microsoft.CodeAnalysis.CSharp.Syntax.UsingDirectiveSyntax UsingDirective(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax)" ;
1061
+
1062
+ if ( candidates . FirstOrDefault ( m => m . ToString ( ) == preferredSignature ) is { } preferredMethod )
1063
+ {
1064
+ return preferredMethod ;
1065
+ }
1053
1066
}
1054
1067
}
1055
1068
Original file line number Diff line number Diff line change 26
26
</ItemGroup >
27
27
28
28
<ItemGroup >
29
- <PackageReference Include =" Microsoft.CodeAnalysis.CSharp.Scripting" Version =" 4.11 .0" />
29
+ <PackageReference Include =" Microsoft.CodeAnalysis.CSharp.Scripting" Version =" 4.12 .0" />
30
30
</ItemGroup >
31
31
32
32
</Project >
You can’t perform that action at this time.
0 commit comments