-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TypeSpec Definition for APIView TreeStyle Parser
- Loading branch information
1 parent
c9cad29
commit 172bfc3
Showing
11 changed files
with
459 additions
and
0 deletions.
There are no files selected for viewing
90 changes: 90 additions & 0 deletions
90
tools/apiview/parsers/apiview-treestyle-parser-schema/json-schema/APITreeNode.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "APITreeNode.json", | ||
"type": "object", | ||
"properties": { | ||
"Name": { | ||
"type": "string", | ||
"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", | ||
"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": { | ||
"anyOf": [ | ||
{ | ||
"type": "string", | ||
"const": "assembly" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "namespace" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "class" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "delegate" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "enum" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "interface" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "method" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "package" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "struct" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "type" | ||
} | ||
], | ||
"description": "The kind of node" | ||
}, | ||
"BottomTokens": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "StructuredToken.json" | ||
}, | ||
"description": "Tokens which are rendered after all child nodes. Depending on the language this would include the closing curly brace and/or empty lines." | ||
}, | ||
"Children": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "APITreeNode.json" | ||
}, | ||
"description": "The nodes immediate children. For a namespace this would be classes, for a class this would be the class constructors and methods. Children are rendered after TopTokens but before BottomTokens, and are automatically indented." | ||
}, | ||
"Properties": { | ||
"$ref": "APITreeNodeProperties.json", | ||
"description": "Properties of the APITreeNode." | ||
}, | ||
"Tags": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "APITreeNodeTags.json" | ||
}, | ||
"description": "Tags of the APITreeNode." | ||
} | ||
}, | ||
"required": [ | ||
"Name", | ||
"Id", | ||
"Kind" | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
tools/apiview/parsers/apiview-treestyle-parser-schema/json-schema/APITreeNodeProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "APITreeNodeProperties.json", | ||
"type": "object", | ||
"properties": { | ||
"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" | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
tools/apiview/parsers/apiview-treestyle-parser-schema/json-schema/APITreeNodeTags.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "APITreeNodeTags.json", | ||
"anyOf": [ | ||
{ | ||
"type": "string", | ||
"const": "Deprecated", | ||
"description": "Mark a token as deprecated." | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "Hidden", | ||
"description": "Mark a node as Hidden." | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "HideFromNav", | ||
"description": "Indicate that a node should be hidden from the page navigation." | ||
}, | ||
{ | ||
"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." | ||
} | ||
] | ||
} |
30 changes: 30 additions & 0 deletions
30
tools/apiview/parsers/apiview-treestyle-parser-schema/json-schema/CodeDiagnostic.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "CodeDiagnostic.json", | ||
"type": "object", | ||
"properties": { | ||
"DiagnosticId": { | ||
"type": "string" | ||
}, | ||
"Text": { | ||
"type": "string" | ||
}, | ||
"HelpLinkUri": { | ||
"type": "string" | ||
}, | ||
"TargetId": { | ||
"type": "string", | ||
"description": "Maps to the APITreeNode id" | ||
}, | ||
"Level": { | ||
"$ref": "CodeDiagnosticLevel.json" | ||
} | ||
}, | ||
"required": [ | ||
"DiagnosticId", | ||
"Text", | ||
"HelpLinkUri", | ||
"TargetId", | ||
"Level" | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
tools/apiview/parsers/apiview-treestyle-parser-schema/json-schema/CodeDiagnosticLevel.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "CodeDiagnosticLevel.json", | ||
"type": "string", | ||
"enum": [ | ||
"Default", | ||
"Info", | ||
"Warning", | ||
"Error", | ||
"Fatal" | ||
] | ||
} |
41 changes: 41 additions & 0 deletions
41
tools/apiview/parsers/apiview-treestyle-parser-schema/json-schema/StructuredToken.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "StructuredToken.json", | ||
"type": "object", | ||
"properties": { | ||
"Id": { | ||
"type": "string", | ||
"description": "Token Id. Previously known as DefinitionId." | ||
}, | ||
"Kind": { | ||
"$ref": "StructuredTokenKind.json", | ||
"description": "Represents the type of a structured token" | ||
}, | ||
"Value": { | ||
"type": "string", | ||
"description": "The token value which will be displayed. Spacing tokens (LineBreak, NonBreakingSpace, TabSpace, and ParameterSeparator) don't need to have value" | ||
}, | ||
"Properties": { | ||
"$ref": "StructuredTokenProperties.json", | ||
"description": "Properties of the StructuredToken." | ||
}, | ||
"Tags": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "StructuredTokenTags.json" | ||
}, | ||
"description": "Tags of the StructuredToken." | ||
}, | ||
"RenderClasses": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "StructuredTokenRenderClasses.json" | ||
}, | ||
"description": "Classes used to render the StructuredTokens." | ||
} | ||
}, | ||
"required": [ | ||
"Id", | ||
"Kind" | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
tools/apiview/parsers/apiview-treestyle-parser-schema/json-schema/StructuredTokenKind.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "StructuredTokenKind.json", | ||
"type": "string", | ||
"enum": [ | ||
"Content", | ||
"LineBreak", | ||
"NonBreakingSpace", | ||
"TabSpace", | ||
"ParameterSeparator" | ||
] | ||
} |
16 changes: 16 additions & 0 deletions
16
...piview/parsers/apiview-treestyle-parser-schema/json-schema/StructuredTokenProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "StructuredTokenProperties.json", | ||
"type": "object", | ||
"properties": { | ||
"GroupId": { | ||
"type": "string", | ||
"const": "doc", | ||
"description": "Group a sequence of consecutive StructuredTokens. doc indicates that the group of tokens is documentation." | ||
}, | ||
"NavigateToId": { | ||
"type": "string", | ||
"description": "Id to navigate to when StructuredToken is clicked." | ||
} | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...iew/parsers/apiview-treestyle-parser-schema/json-schema/StructuredTokenRenderClasses.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "StructuredTokenRenderClasses.json", | ||
"anyOf": [ | ||
{ | ||
"type": "string", | ||
"const": "comment" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "keyword" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "keyword" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "literal" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "sliteral", | ||
"description": "string literal" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "mname", | ||
"description": "member name" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "tname", | ||
"description": "type name" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "punc", | ||
"description": "punctuation" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "text" | ||
}, | ||
{ | ||
"type": "string" | ||
} | ||
], | ||
"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" | ||
} |
16 changes: 16 additions & 0 deletions
16
tools/apiview/parsers/apiview-treestyle-parser-schema/json-schema/StructuredTokenTags.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "StructuredTokenTags.json", | ||
"anyOf": [ | ||
{ | ||
"type": "string", | ||
"const": "Deprecated", | ||
"description": "Mark a token as deprecated" | ||
}, | ||
{ | ||
"type": "string", | ||
"const": "SkipDiff", | ||
"description": "Indicate that a Token should not be used in computing diff" | ||
} | ||
] | ||
} |
Oops, something went wrong.