Skip to content

Commit bd103ea

Browse files
Delete TreeTokenCodeFile
1 parent 1b675ef commit bd103ea

File tree

5 files changed

+10
-52
lines changed

5 files changed

+10
-52
lines changed

src/dotnet/APIView/APIView/Model/CodeFile.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT License.
33

44
using APIView;
5+
using csharp_api_parser.TreeToken;
56
using System;
67
using System.Collections.Generic;
78
using System.IO;
@@ -51,6 +52,8 @@ public string VersionString
5152
public string CrossLanguagePackageId { get; set; }
5253

5354
public CodeFileToken[] Tokens { get; set; } = Array.Empty<CodeFileToken>();
55+
public List<APITreeNode> APIForest { get; set; } = new List<APITreeNode>();
56+
5457

5558
public List<CodeFileToken[]> LeafSections { get; set; }
5659

src/dotnet/APIView/APIView/Model/TokenTreeModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ public enum StructuredTokenKind
1717
Url = 5
1818
}
1919

20+
/// <summary>
21+
/// Used to represent a APIView token its properties and tags for APIView parsers.
22+
/// </summary>
2023
[JsonObject("st")]
2124
public class StructuredToken
2225
{
@@ -76,10 +79,7 @@ public static StructuredToken CreateLineBreakToken()
7679
public static StructuredToken CreateEmptyToken(string id = null)
7780
{
7881
var token = new StructuredToken();
79-
if (!string.IsNullOrEmpty(id))
80-
{
81-
token.Id = id;
82-
}
82+
token.Id = id;
8383
token.Kind = StructuredTokenKind.Content;
8484
return token;
8585
}

src/dotnet/APIView/APIView/Model/TreeTokenCodeFile.cs

Lines changed: 0 additions & 46 deletions
This file was deleted.

tools/apiview/parsers/CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,6 @@ Serialize the generated code file to JSON. Try to make the json as small as poss
8484
- LINE_ID_MARKER : You can add a empty token. `Kind = Content` and `Value = ""` then give it an `Id` to make it commentable.
8585
- EXTERNAL_LINK : Create a single token set `Kind = Url`, `Value = link` then add the link text as a properties `LinkText`;
8686
- Common Tags: `Deprecated`, `Hidden`, `HideFromNav`, `SkipDiff`
87+
- Cross Language Id: Use `CrossLangId` as key with value in the node properties.
8788

8889
Please reach out at [APIView Teams Channel](https://teams.microsoft.com/l/channel/19%3A3adeba4aa1164f1c889e148b1b3e3ddd%40thread.skype/APIView?groupId=3e17dcb0-4257-4a30-b843-77f47f1d4121&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47) if you need more infomation.

tools/apiview/parsers/csharp-api-parser/TreeToken/CodeFileBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private IEnumerable<INamespaceSymbol> EnumerateNamespaces(IAssemblySymbol assemb
6565
}
6666
}
6767

68-
public TreeTokenCodeFile Build(IAssemblySymbol assemblySymbol, bool runAnalysis, List<DependencyInfo>? dependencies)
68+
public CodeFile Build(IAssemblySymbol assemblySymbol, bool runAnalysis, List<DependencyInfo>? dependencies)
6969
{
7070
_assembly = assemblySymbol;
7171
var analyzer = new Analyzer();
@@ -104,7 +104,7 @@ public TreeTokenCodeFile Build(IAssemblySymbol assemblySymbol, bool runAnalysis,
104104
// Sort API Tree by name
105105
apiTreeNode.SortChildren();
106106

107-
var treeTokenCodeFile = new TreeTokenCodeFile()
107+
var treeTokenCodeFile = new CodeFile()
108108
{
109109
Name = $"{assemblySymbol.Name} ({assemblySymbol.Identity.Version})",
110110
Language = "C#",

0 commit comments

Comments
 (0)