Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APIView] update treestyle parser tsp for python codegen #9247

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@
},
"IsContextEndLine": {
"type": "boolean",
"description": "Set current line as context end line. For e.g. line with token } or empty line after the class to mark end of context."
"description": "Set current line as context end line. For e.g. line with token } or empty line after the class or function/method to mark end of context."
},
"RelatedToLine": {
"type": "string",
"description": "Set ID of related line to ensure current line is not visible when a related line is hidden.\nOne e.g. is a code line for class attribute should set class line's Line ID as related line ID."
"description": "Set ID of related line to ensure current line is not visible when a related line is hidden.\nOne e.g. is a code line for class attribute that should set class line's Line ID as related line ID.\nOR a method line decorator that should set method's line ID as related line ID."
}
},
"required": [
Expand Down Expand Up @@ -229,7 +229,7 @@
"SkipDiff": {
"type": "boolean",
"default": false,
"description": "set skipDiff to true if underlying token needs to be ignored from diff calculation. For e.g. package metadata or dependency versions \nare usually excluded when comparing two revisions to avoid reporting them as API changes"
"description": "Set skipDiff to true if underlying token needs to be ignored from diff calculation. For e.g. package metadata or dependency versions \nare usually excluded when comparing two revisions to avoid reporting them as API changes"
},
"IsDeprecated": {
"type": "boolean",
Expand All @@ -256,7 +256,7 @@
"items": {
"type": "string"
},
"description": "Language specific style css class names"
"description": "Language specific style css class names. To render navigation icons, one of the following must be specified:\n\"namespace\", \"class\", \"method\", \"enum\". If NavigationDisplayName is specified, then this field should be set."
}
},
"required": [
Expand Down Expand Up @@ -291,7 +291,8 @@
4,
5,
6,
7
7,
8
]
}
}
Expand Down
19 changes: 14 additions & 5 deletions tools/apiview/parsers/apiview-treestyle-parser-schema/main.tsp
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import "@typespec/json-schema";
import "@azure-tools/typespec-client-generator-core";

using Azure.ClientGenerator.Core;
using TypeSpec.JsonSchema;

@usage(Usage.input | Usage.output)
@service({title: "Schemas"})
namespace Schemas;

/** ReviewFile represents entire API review object. This will be processed to render review lines. */
Expand Down Expand Up @@ -41,10 +45,11 @@ model ReviewLine {
Children?: Array<ReviewLine>;
/** Set current line as hidden code line by default. .NET has hidden APIs and architects don't want to see them by default. */
IsHidden?: boolean;
/** Set current line as context end line. For e.g. line with token } or empty line after the class to mark end of context. */
/** Set current line as context end line. For e.g. line with token } or empty line after the class or function/method to mark end of context. */
IsContextEndLine?: boolean;
/** Set ID of related line to ensure current line is not visible when a related line is hidden.
* One e.g. is a code line for class attribute should set class line's Line ID as related line ID.
* One e.g. is a code line for class attribute that should set class line's Line ID as related line ID.
* OR a method line decorator that should set method's line ID as related line ID.
*/
RelatedToLine?: string;
}
Expand All @@ -60,7 +65,7 @@ model ReviewToken {
* For e.g. a param type which is class name in the same package
*/
NavigateToId?: string;
/** set skipDiff to true if underlying token needs to be ignored from diff calculation. For e.g. package metadata or dependency versions
/** Set skipDiff to true if underlying token needs to be ignored from diff calculation. For e.g. package metadata or dependency versions
* are usually excluded when comparing two revisions to avoid reporting them as API changes*/
SkipDiff?: boolean = false;
/** This is set if API is marked as deprecated */
Expand All @@ -71,7 +76,9 @@ model ReviewToken {
HasPrefixSpace?: boolean = false;
/** Set isDocumentation to true if current token is part of documentation */
IsDocumentation?: boolean = false;
/** Language specific style css class names */
/** Language specific style css class names. To render navigation icons, one of the following must be specified:
* "namespace", "class", "method", "enum". If NavigationDisplayName is specified, then this field should be set.
*/
RenderClasses?: Array<string>;
}

Expand Down Expand Up @@ -105,7 +112,9 @@ enum TokenKind {
Literal: 6,
/** Comment: Comment text within the code that's really a documentation.
* Few languages wants to show comments within API review that's not tagged as documentation **/
Comment: 7
Comment: 7,
/** External Url */
ExternalUrl: 8
}

enum CodeDiagnosticLevel {
Expand Down
Loading
Loading