-
Notifications
You must be signed in to change notification settings - Fork 613
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Add annotations to generated classes, enums and typedefs so that Glean can index the mapping from generated to source entities (see linked task for context). This will be used to extend codehub navigation from c++ to thrift to types. This is follows on what has been done for service functions D55445267. Reviewed By: iahs Differential Revision: D60142167 fbshipit-source-id: 5096c866f96531b5bd20288f902cf47c49f8e85e
- Loading branch information
1 parent
f2390f7
commit ca04e10
Showing
74 changed files
with
632 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
thrift/compiler/generate/templates/cpp2/common/class_docblock.mustache
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,21 @@ | ||
{{! | ||
Copyright (c) Meta Platforms, Inc. and affiliates. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
}} | ||
{{! The glean annotation is used by Glean indexers to map generated functions to thrift exceptions/structs/unions. | ||
It can be moved within the docblock, as long as it stays on a single line }} | ||
/** Glean {"file": "{{program:autogen_path}}", "name": "{{struct:cpp_underlying_name}}", "kind": "{{#struct:exception?}}exception{{/struct:exception?}}{{^struct:exception?}}{{#struct:union?}}union{{/struct:union?}}{{^struct:union?}}struct{{/struct:union?}}{{/struct:exception?}}" } */ | ||
{{! enforce new line }} |
21 changes: 21 additions & 0 deletions
21
thrift/compiler/generate/templates/cpp2/common/enum_docblock.mustache
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,21 @@ | ||
{{! | ||
Copyright (c) Meta Platforms, Inc. and affiliates. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
}} | ||
{{! The glean annotation is used by Glean indexers to map generated functions to thrift enums. | ||
It can be moved within the docblock, as long as it stays on a single line }} | ||
/** Glean {"file": "{{program:autogen_path}}", "name": "{{enum:cpp_name}}", "kind": "enum" } */ | ||
{{! enforce new line }} |
21 changes: 21 additions & 0 deletions
21
thrift/compiler/generate/templates/cpp2/common/typedef_docblock.mustache
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,21 @@ | ||
{{! | ||
Copyright (c) Meta Platforms, Inc. and affiliates. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
}} | ||
{{! The glean annotation is used by Glean indexers to map generated functions to thrift typedefs. | ||
It can be moved within the docblock, as long as it stays on a single line }} | ||
/** Glean {"file": "{{program:autogen_path}}", "name": "{{typedef:name}}", "kind": "typedef" } */ | ||
{{! enforce new line }} |
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
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
73 changes: 73 additions & 0 deletions
73
thrift/compiler/test/fixtures/adapter/out/cpp2/gen-cpp2/module_types.h
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
Oops, something went wrong.