Skip to content

Commit

Permalink
Update TreeStyleParser Schema
Browse files Browse the repository at this point in the history
  • Loading branch information
chidozieononiwu committed Jul 22, 2024
1 parent 172bfc3 commit c9a26c6
Show file tree
Hide file tree
Showing 13 changed files with 242 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"description": "The name of the tree node which will be used as label for the API Navigation. Generally this is the name of the module (class, method)."
},
"Id": {
"type": "string",
"$ref": "APITreeNodeId.json",
"description": "Id of the node, which should be unique at the node level. i.e. unique among its siblings. This was previously represented by the DefinitionId for the main Token of the node."
},
"Kind": {
Expand Down Expand Up @@ -54,7 +54,14 @@
"const": "type"
}
],
"description": "The kind of node"
"description": "Descriptor for the kind of the node. Currently used to select navigation icons"
},
"TopTokens": {
"type": "array",
"items": {
"$ref": "StructuredToken.json"
},
"description": "The main data of the node. This is all the tokens that actually define the node. When rendering, TopTokens are rendered first, followed by any Children, and then finally BottomTokens"
},
"BottomTokens": {
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "APITreeNodeId.json",
"type": "string"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"IconName": {
"type": "string",
"description": "Use this only if you are looking to add a custom icon different from language wide defaults set by APITreeNode kind"
},
"CrossLangDefId": {
"type": "string",
"description": "The cross language definitionId for the node."
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
"type": "string",
"const": "SkipDiff",
"description": "Indicate that a node should not be used in computation of diff."
},
{
"type": "string",
"const": "CrossLangDefId",
"description": "The cross language definitionId for the node."
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"type": "object",
"properties": {
"DiagnosticId": {
"type": "string"
"type": "string",
"description": "String associated with a given diagnostic usieally produced by an analyzer"
},
"Text": {
"type": "string"
Expand All @@ -13,7 +14,7 @@
"type": "string"
},
"TargetId": {
"type": "string",
"$ref": "APITreeNodeId.json",
"description": "Maps to the APITreeNode id"
},
"Level": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "CodeDiagnosticLevel.json",
"type": "string",
"type": "number",
"enum": [
"Default",
"Info",
"Warning",
"Error",
"Fatal"
1,
2,
3,
4
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "CodeFile.json",
"type": "object",
"properties": {
"VersionString": {
"type": "string",
"description": "The version of the parser"
},
"Name": {
"type": "string",
"description": "Name the ocde file. Usually just the package name and version"
},
"Language": {
"anyOf": [
{
"type": "string",
"const": "C"
},
{
"type": "string",
"const": "C#"
},
{
"type": "string",
"const": "C++"
},
{
"type": "string",
"const": "Go"
},
{
"type": "string",
"const": "Java"
},
{
"type": "string",
"const": "JavaScript"
},
{
"type": "string",
"const": "Json"
},
{
"type": "string",
"const": "Kotlin"
},
{
"type": "string",
"const": "Python"
},
{
"type": "string",
"const": "Swagger"
},
{
"type": "string",
"const": "Swift"
},
{
"type": "string",
"const": "TypeSpec"
},
{
"type": "string",
"const": "Xml"
}
]
},
"LanguageVariant": {
"anyOf": [
{
"type": "string",
"const": "Default"
},
{
"type": "string",
"const": "Spring"
},
{
"type": "string",
"const": "Android"
}
],
"default": "Default"
},
"PackageName": {
"type": "string"
},
"ServiceName": {
"type": "string"
},
"PackageVersion": {
"type": "string"
},
"CrossLanguagePackageId": {
"type": "string",
"description": "Maps related packages across Languages"
},
"APIForest": {
"type": "array",
"items": {
"$ref": "APITreeNode.json"
},
"description": "The API Tree(s)"
},
"Diagnostics": {
"type": "array",
"items": {
"$ref": "CodeDiagnostic.json"
}
}
},
"required": [
"VersionString",
"Name",
"Language",
"PackageName",
"PackageVersion",
"APIForest",
"Diagnostics"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "object",
"properties": {
"Id": {
"type": "string",
"$ref": "StructuredTokenId.json",
"description": "Token Id. Previously known as DefinitionId."
},
"Kind": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "StructuredTokenId.json",
"type": "string"
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "StructuredTokenKind.json",
"type": "string",
"type": "number",
"enum": [
"Content",
"LineBreak",
"NonBreakingSpace",
"TabSpace",
"ParameterSeparator"
0,
1,
2,
3,
4
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"description": "Group a sequence of consecutive StructuredTokens. doc indicates that the group of tokens is documentation."
},
"NavigateToId": {
"type": "string",
"$ref": "APITreeNodeId.json",
"description": "Id to navigate to when StructuredToken is clicked."
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
"type": "string",
"const": "keyword"
},
{
"type": "string",
"const": "keyword"
},
{
"type": "string",
"const": "literal"
Expand Down Expand Up @@ -43,7 +39,8 @@
"const": "text"
},
{
"type": "string"
"type": "string",
"description": "Contribute extra classes at https://github.com/Azure/azure-sdk-tools/blob/main/src/dotnet/APIView/ClientSPA/src/app/_components/code-panel/code-panel.component.scss"
}
],
"description": "Classes used to render the StructuredTokens. Extendable by contributing styles at https://github.com/Azure/azure-sdk-tools/blob/main/src/dotnet/APIView/ClientSPA/src/app/_components/code-panel/code-panel.component.scss"
Expand Down
Loading

0 comments on commit c9a26c6

Please sign in to comment.