Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

Commit dc69398

Browse files
author
Lakshmi Priya Sekar
committed
Some improvements
1. Adding test framework to Codeformatter. 2. Adding new private field name guideline around static and thread static fields.
1 parent 5ab1e54 commit dc69398

File tree

8 files changed

+335
-3
lines changed

8 files changed

+335
-3
lines changed

src/BuildToolsInternal.sln

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.30723.0
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.22129.1
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.CodeFormatting", "Microsoft.DotNet.CodeFormatting\Microsoft.DotNet.CodeFormatting.csproj", "{D535641F-A2D7-481C-930D-96C02F052B95}"
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeFormatter", "CodeFormatter\CodeFormatter.csproj", "{B0E1A988-F762-459D-AD0D-56A3CF4FFF3F}"
99
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.CodeFormatting.Tests", "Microsoft.DotNet.CodeFormatting.Tests\Microsoft.DotNet.CodeFormatting.Tests.csproj", "{D4D6FF88-0586-43C7-BDE4-D336EB25E7AA}"
11+
EndProject
12+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{34034F12-9FB5-4154-91DA-7914B7D013BD}"
13+
ProjectSection(SolutionItems) = preProject
14+
.nuget\packages.config = .nuget\packages.config
15+
EndProjectSection
16+
EndProject
1017
Global
1118
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1219
Debug|Any CPU = Debug|Any CPU
@@ -21,6 +28,10 @@ Global
2128
{B0E1A988-F762-459D-AD0D-56A3CF4FFF3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
2229
{B0E1A988-F762-459D-AD0D-56A3CF4FFF3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
2330
{B0E1A988-F762-459D-AD0D-56A3CF4FFF3F}.Release|Any CPU.Build.0 = Release|Any CPU
31+
{D4D6FF88-0586-43C7-BDE4-D336EB25E7AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
32+
{D4D6FF88-0586-43C7-BDE4-D336EB25E7AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
33+
{D4D6FF88-0586-43C7-BDE4-D336EB25E7AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
34+
{D4D6FF88-0586-43C7-BDE4-D336EB25E7AA}.Release|Any CPU.Build.0 = Release|Any CPU
2435
EndGlobalSection
2536
GlobalSection(SolutionProperties) = preSolution
2637
HideSolutionNode = FALSE

src/CodeFormatter/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="Microsoft.CodeAnalysis" version="1.0.0-beta1-20141031-01" targetFramework="net45" />
34
<package id="Microsoft.CodeAnalysis.Common" version="1.0.0-beta1-20141031-01" targetFramework="net45" />
45
<package id="Microsoft.CodeAnalysis.CSharp" version="1.0.0-beta1-20141031-01" targetFramework="net45" />
56
<package id="Microsoft.CodeAnalysis.CSharp.Workspaces" version="1.0.0-beta1-20141031-01" targetFramework="net45" />
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading;
6+
using System.Threading.Tasks;
7+
using Microsoft.CodeAnalysis;
8+
using Microsoft.CodeAnalysis.Text;
9+
using Microsoft.DotNet.CodeFormatting;
10+
using Xunit;
11+
12+
namespace Microsoft.DotNet.CodeFormatting.Tests
13+
{
14+
public abstract class CodeFormattingTestBase
15+
{
16+
private static readonly MetadataReference CorlibReference = MetadataReference.CreateFromAssembly(typeof(object).Assembly);
17+
private static readonly MetadataReference SystemCoreReference = MetadataReference.CreateFromAssembly(typeof(Enumerable).Assembly);
18+
private static readonly MetadataReference CodeFormatterReference = MetadataReference.CreateFromAssembly(typeof(IFormattingEngine).Assembly);
19+
20+
private const string FileNamePrefix = "Test";
21+
private const string CSharpFileExtension = ".cs";
22+
private const string VBFileExtension = ".vb";
23+
private const string TestProjectName = "TestProject";
24+
25+
internal abstract IFormattingRule GetFormattingRule();
26+
27+
internal static IFormattingRule GetDefaultVSFormatter()
28+
{
29+
return new Rules.IsFormattedFormattingRule();
30+
}
31+
32+
internal static Solution CreateSolution(string[] sources, string language = LanguageNames.CSharp)
33+
{
34+
string fileExtension = language == LanguageNames.CSharp ? CSharpFileExtension : VBFileExtension;
35+
var projectId = ProjectId.CreateNewId(TestProjectName);
36+
37+
var solution = new CustomWorkspace()
38+
.CurrentSolution
39+
.AddProject(projectId, TestProjectName, TestProjectName, language)
40+
.AddMetadataReference(projectId, CorlibReference)
41+
.AddMetadataReference(projectId, SystemCoreReference)
42+
.AddMetadataReference(projectId, CodeFormatterReference);
43+
44+
int count = 0;
45+
foreach(var source in sources)
46+
{
47+
var fileName = FileNamePrefix + count + fileExtension;
48+
var documentId = DocumentId.CreateNewId(projectId, fileName);
49+
solution = solution.AddDocument(documentId, fileName, SourceText.From(source));
50+
}
51+
52+
return solution;
53+
}
54+
55+
internal static async Task<Solution> Format(Solution solution, IFormattingRule rule)
56+
{
57+
var documentIds = solution.Projects.SelectMany(p => p.DocumentIds);
58+
59+
foreach (var id in documentIds)
60+
{
61+
var document = solution.GetDocument(id);
62+
var newDocument = await RewriteDocumentAsync(document, rule);
63+
solution = newDocument.Project.Solution;
64+
}
65+
66+
return solution;
67+
}
68+
69+
internal static async Task<Document> RewriteDocumentAsync(Document document, IFormattingRule rule)
70+
{
71+
document = await rule.ProcessAsync(document, CancellationToken.None);
72+
return await GetDefaultVSFormatter().ProcessAsync(document, CancellationToken.None);
73+
}
74+
75+
internal static void AssertSolutionEqual(Solution expectedSolution, Solution actualSolution)
76+
{
77+
var expectedDocuments = expectedSolution.Projects.SelectMany(p => p.Documents);
78+
var actualDocuments = actualSolution.Projects.SelectMany(p => p.Documents);
79+
80+
foreach (var expected in expectedDocuments)
81+
{
82+
var actual = actualDocuments.Where(d => d.Name == expected.Name).Single();
83+
var aText = actual.GetTextAsync().Result.ToString();
84+
var eText = expected.GetTextAsync().Result.ToString();
85+
if (eText != aText)
86+
{
87+
Assert.False(true, "Document " + expected.Name + " did not match.\nActual:\n" + aText + "\nExpected:\n" + eText);
88+
}
89+
}
90+
}
91+
92+
internal void Verify(string[] sources, string[] expected, IFormattingRule rule)
93+
{
94+
var inputSolution = CreateSolution(sources);
95+
var expectedSolution = CreateSolution(expected);
96+
var actualSolution = Format(inputSolution, rule).Result;
97+
98+
if (actualSolution == null)
99+
Assert.False(true, "Solution is null. Test Failed.");
100+
101+
AssertSolutionEqual(expectedSolution, actualSolution);
102+
}
103+
104+
internal void Verify(string[] source, string[] expected)
105+
{
106+
Verify(source, expected, GetFormattingRule());
107+
}
108+
109+
internal void Verify(string source, string expected)
110+
{
111+
Verify(new string[] { source }, new string[] { expected });
112+
}
113+
}
114+
}
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\packages\xunit.runner.visualstudio.0.99.9-build1021\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.0.99.9-build1021\build\net20\xunit.runner.visualstudio.props')" />
4+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
5+
<PropertyGroup>
6+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8+
<ProjectGuid>{D4D6FF88-0586-43C7-BDE4-D336EB25E7AA}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>Microsoft.DotNet.CodeFormatting.Tests</RootNamespace>
12+
<AssemblyName>Microsoft.DotNet.CodeFormatting.Tests</AssemblyName>
13+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="Microsoft.CodeAnalysis">
35+
<HintPath>..\packages\Microsoft.CodeAnalysis.Common.1.0.0-beta1-20141031-01\lib\net45\Microsoft.CodeAnalysis.dll</HintPath>
36+
</Reference>
37+
<Reference Include="Microsoft.CodeAnalysis.CSharp">
38+
<HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.1.0.0-beta1-20141031-01\lib\net45\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
39+
</Reference>
40+
<Reference Include="Microsoft.CodeAnalysis.CSharp.Desktop">
41+
<HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.1.0.0-beta1-20141031-01\lib\net45\Microsoft.CodeAnalysis.CSharp.Desktop.dll</HintPath>
42+
</Reference>
43+
<Reference Include="Microsoft.CodeAnalysis.CSharp.Workspaces">
44+
<HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.1.0.0-beta1-20141031-01\lib\net45\Microsoft.CodeAnalysis.CSharp.Workspaces.dll</HintPath>
45+
</Reference>
46+
<Reference Include="Microsoft.CodeAnalysis.CSharp.Workspaces.Desktop">
47+
<HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.1.0.0-beta1-20141031-01\lib\net45\Microsoft.CodeAnalysis.CSharp.Workspaces.Desktop.dll</HintPath>
48+
</Reference>
49+
<Reference Include="Microsoft.CodeAnalysis.Desktop">
50+
<HintPath>..\packages\Microsoft.CodeAnalysis.Common.1.0.0-beta1-20141031-01\lib\net45\Microsoft.CodeAnalysis.Desktop.dll</HintPath>
51+
</Reference>
52+
<Reference Include="Microsoft.CodeAnalysis.VisualBasic">
53+
<HintPath>..\packages\Microsoft.CodeAnalysis.VisualBasic.1.0.0-beta1-20141031-01\lib\net45\Microsoft.CodeAnalysis.VisualBasic.dll</HintPath>
54+
</Reference>
55+
<Reference Include="Microsoft.CodeAnalysis.VisualBasic.Desktop">
56+
<HintPath>..\packages\Microsoft.CodeAnalysis.VisualBasic.1.0.0-beta1-20141031-01\lib\net45\Microsoft.CodeAnalysis.VisualBasic.Desktop.dll</HintPath>
57+
</Reference>
58+
<Reference Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces">
59+
<HintPath>..\packages\Microsoft.CodeAnalysis.VisualBasic.Workspaces.1.0.0-beta1-20141031-01\lib\net45\Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll</HintPath>
60+
</Reference>
61+
<Reference Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces.Desktop">
62+
<HintPath>..\packages\Microsoft.CodeAnalysis.VisualBasic.Workspaces.1.0.0-beta1-20141031-01\lib\net45\Microsoft.CodeAnalysis.VisualBasic.Workspaces.Desktop.dll</HintPath>
63+
</Reference>
64+
<Reference Include="Microsoft.CodeAnalysis.Workspaces">
65+
<HintPath>..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0-beta1-20141031-01\lib\net45\Microsoft.CodeAnalysis.Workspaces.dll</HintPath>
66+
</Reference>
67+
<Reference Include="Microsoft.CodeAnalysis.Workspaces.Desktop">
68+
<HintPath>..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0-beta1-20141031-01\lib\net45\Microsoft.CodeAnalysis.Workspaces.Desktop.dll</HintPath>
69+
</Reference>
70+
<Reference Include="System" />
71+
<Reference Include="System.Collections.Immutable, Version=1.1.32.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
72+
<SpecificVersion>False</SpecificVersion>
73+
<HintPath>..\packages\System.Collections.Immutable.1.1.32-beta\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
74+
</Reference>
75+
<Reference Include="System.Composition.AttributedModel">
76+
<HintPath>..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll</HintPath>
77+
</Reference>
78+
<Reference Include="System.Composition.Convention">
79+
<HintPath>..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.Convention.dll</HintPath>
80+
</Reference>
81+
<Reference Include="System.Composition.Hosting">
82+
<HintPath>..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.Hosting.dll</HintPath>
83+
</Reference>
84+
<Reference Include="System.Composition.Runtime">
85+
<HintPath>..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.Runtime.dll</HintPath>
86+
</Reference>
87+
<Reference Include="System.Composition.TypedParts">
88+
<HintPath>..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll</HintPath>
89+
</Reference>
90+
<Reference Include="System.Core" />
91+
<Reference Include="System.Reflection.Metadata">
92+
<HintPath>..\packages\System.Reflection.Metadata.1.0.17-beta\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath>
93+
</Reference>
94+
<Reference Include="System.Xml.Linq" />
95+
<Reference Include="System.Data.DataSetExtensions" />
96+
<Reference Include="Microsoft.CSharp" />
97+
<Reference Include="System.Data" />
98+
<Reference Include="System.Xml" />
99+
<Reference Include="xunit">
100+
<HintPath>..\packages\xunit.1.9.2\lib\net20\xunit.dll</HintPath>
101+
</Reference>
102+
</ItemGroup>
103+
<ItemGroup>
104+
<Compile Include="CodeFormattingTestBase.cs" />
105+
<Compile Include="Rules\HasPrivateAccessorOnFieldNamesFormattingRuleTests.cs" />
106+
</ItemGroup>
107+
<ItemGroup>
108+
<Folder Include="Properties\" />
109+
</ItemGroup>
110+
<ItemGroup>
111+
<None Include="packages.config" />
112+
</ItemGroup>
113+
<ItemGroup>
114+
<ProjectReference Include="..\Microsoft.DotNet.CodeFormatting\Microsoft.DotNet.CodeFormatting.csproj">
115+
<Project>{d535641f-a2d7-481c-930d-96c02f052b95}</Project>
116+
<Name>Microsoft.DotNet.CodeFormatting</Name>
117+
</ProjectReference>
118+
</ItemGroup>
119+
<ItemGroup>
120+
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
121+
</ItemGroup>
122+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
123+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
124+
<PropertyGroup>
125+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
126+
</PropertyGroup>
127+
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.0.99.9-build1021\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.0.99.9-build1021\build\net20\xunit.runner.visualstudio.props'))" />
128+
</Target>
129+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
130+
Other similar extension points exist, see Microsoft.Common.targets.
131+
<Target Name="BeforeBuild">
132+
</Target>
133+
<Target Name="AfterBuild">
134+
</Target>
135+
-->
136+
</Project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using Microsoft.DotNet.CodeFormatting;
7+
using Xunit;
8+
9+
namespace Microsoft.DotNet.CodeFormatting.Tests
10+
{
11+
public class CodeFormatterTests : CodeFormattingTestBase
12+
{
13+
[Fact]
14+
public void TestStatic()
15+
{
16+
var text = @"
17+
using System;
18+
class T
19+
{
20+
static int x;
21+
}";
22+
var expected = @"
23+
using System;
24+
class T
25+
{
26+
private static int x;
27+
}";
28+
Verify(text, expected);
29+
}
30+
31+
internal override IFormattingRule GetFormattingRule()
32+
{
33+
return new Rules.HasPrivateAccessorOnFieldNamesFormattingRule();
34+
}
35+
}
36+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Microsoft.CodeAnalysis" version="1.0.0-beta1-20141031-01" targetFramework="net45" />
4+
<package id="Microsoft.CodeAnalysis.Common" version="1.0.0-beta1-20141031-01" targetFramework="net45" />
5+
<package id="Microsoft.CodeAnalysis.CSharp" version="1.0.0-beta1-20141031-01" targetFramework="net45" />
6+
<package id="Microsoft.CodeAnalysis.CSharp.Workspaces" version="1.0.0-beta1-20141031-01" targetFramework="net45" />
7+
<package id="Microsoft.CodeAnalysis.VisualBasic" version="1.0.0-beta1-20141031-01" targetFramework="net45" />
8+
<package id="Microsoft.CodeAnalysis.VisualBasic.Workspaces" version="1.0.0-beta1-20141031-01" targetFramework="net45" />
9+
<package id="Microsoft.CodeAnalysis.Workspaces.Common" version="1.0.0-beta1-20141031-01" targetFramework="net45" />
10+
<package id="Microsoft.Composition" version="1.0.27" targetFramework="net45" />
11+
<package id="System.Collections.Immutable" version="1.1.32-beta" targetFramework="net45" />
12+
<package id="System.Reflection.Metadata" version="1.0.17-beta" targetFramework="net45" />
13+
<package id="xunit" version="1.9.2" targetFramework="net45" />
14+
<package id="xunit.runner.visualstudio" version="0.99.9-build1021" targetFramework="net45" />
15+
</packages>

src/Microsoft.DotNet.CodeFormatting/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
[assembly: AssemblyCopyright("Copyright © 2014")]
1616
[assembly: AssemblyTrademark("")]
1717
[assembly: AssemblyCulture("")]
18+
[assembly: InternalsVisibleTo("Microsoft.DotNet.CodeFormatting.Tests")]
1819

1920
// Setting ComVisible to false makes the types in this assembly not visible
2021
// to COM components. If you need to access a type in this assembly from

src/Microsoft.DotNet.CodeFormatting/Rules/HasUnderScoreInPrivateFieldNamesFormattingRule.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,31 @@ private async Task<Solution> RenameFields(Solution solution, DocumentId document
7676
var model = await solution.GetDocument(documentId).GetSemanticModelAsync(cancellationToken);
7777
var root = await model.SyntaxTree.GetRootAsync(cancellationToken) as CSharpSyntaxNode;
7878
var symbol = model.GetDeclaredSymbol(root.GetAnnotatedNodes(AnnotationMarker).ElementAt(i), cancellationToken);
79-
var newName = "_" + symbol.Name;
79+
var newName = GetNewSymbolName(symbol);
8080
solution = await Renamer.RenameSymbolAsync(solution, symbol, newName, solution.Workspace.Options, cancellationToken).ConfigureAwait(false);
8181
}
8282

8383
return solution;
8484
}
8585

86+
private static string GetNewSymbolName(ISymbol symbol)
87+
{
88+
if (symbol.IsStatic)
89+
{
90+
if (symbol.GetType().Equals(typeof(Thread)))
91+
{
92+
if (!symbol.Name.StartsWith("t_"))
93+
return "t_" + symbol.Name;
94+
}
95+
else if (!symbol.Name.StartsWith("s_"))
96+
return "s_" + symbol.Name;
97+
98+
return symbol.Name;
99+
}
100+
101+
return "_" + symbol.Name;
102+
}
103+
86104
private async Task<Solution> CleanSolutionAsync(Solution solution, CancellationToken cancellationToken)
87105
{
88106
var documentIdsToProcess = new List<DocumentId>();

0 commit comments

Comments
 (0)