-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for lambda syntax that allows to specify parameter name. …
…Fix doc generation for lambdas. (#1546) Signed-off-by: Nazar Kacharaba <[email protected]>
- Loading branch information
1 parent
1c36362
commit 92e6a51
Showing
29 changed files
with
1,678 additions
and
32 deletions.
There are no files selected for viewing
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
38 changes: 38 additions & 0 deletions
38
gluecodium/src/main/resources/templates/cpp/CppLambdaDoc.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,38 @@ | ||
{{!! | ||
! | ||
! Copyright (C) 2016-2023 HERE Europe B.V. | ||
! | ||
! 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. | ||
! | ||
! SPDX-License-Identifier: Apache-2.0 | ||
! License-Filename: LICENSE | ||
! | ||
!}} | ||
{{#ifPredicate "hasAnyComment"}} | ||
/** | ||
{{#unless comment.isEmpty}}{{!! | ||
}}{{#resolveName comment}}{{prefix this " * "}}{{/resolveName}}{{!! | ||
}}{{#parameters}}{{#set self=this}}{{#resolveName comment}}{{#unless this.isEmpty}} | ||
* \param[in] {{self.parameterName}} {{prefix this " * " skipFirstLine=true}}{{!! | ||
}}{{/unless}}{{/resolveName}}{{/set}}{{/parameters}}{{!! | ||
}}{{#unless returnType.isVoid}} | ||
{{#resolveName returnType.comment}}{{#unless this.isEmpty}} | ||
* \return {{#ifPredicate returnType.typeRef "needsNotNullComment"}}@NotNull {{/ifPredicate}}{{!! | ||
}}{{prefix this " * " skipFirstLine=true}}{{!! | ||
}}{{/unless}}{{/resolveName}}{{/unless}}{{/unless}}{{#if comment.isExcluded}} | ||
* \private | ||
{{/if}}{{#if attributes.deprecated}} | ||
* \deprecated {{#resolveName attributes.deprecated.message}}{{!! | ||
}}{{prefix this " * " skipFirstLine=true}}{{/resolveName}}{{/if}} | ||
*/ | ||
{{/ifPredicate}} |
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
38 changes: 38 additions & 0 deletions
38
gluecodium/src/main/resources/templates/dart/DartLambdaDocs.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,38 @@ | ||
{{!! | ||
! | ||
! Copyright (C) 2016-2023 HERE Europe B.V. | ||
! | ||
! 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. | ||
! | ||
! SPDX-License-Identifier: Apache-2.0 | ||
! License-Filename: LICENSE | ||
! | ||
!}} | ||
{{#resolveName comment}}{{#unless this.isEmpty}}{{prefix this "/// "}} | ||
{{/unless}}{{/resolveName}}{{!! | ||
}}{{#ifPredicate "needsNoDoc"}} | ||
/// @nodoc | ||
{{/ifPredicate}}{{!! | ||
}}{{#parameters}}{{#set self=this}}{{#resolveName comment}}{{#unless this.isEmpty}} | ||
/// | ||
/// [{{self.parameterName}}] {{prefix this "/// " skipFirstLine=true}} | ||
{{/unless}}{{/resolveName}}{{/set}}{{/parameters}} | ||
{{#if attributes.deprecated}} | ||
@Deprecated("{{#resolveName attributes.deprecated.message}}{{escape this}}{{/resolveName}}") | ||
{{/if}} | ||
{{#unless returnType.isVoid}}{{!! | ||
}}{{#resolveName returnType.comment}}{{#unless this.isEmpty}} | ||
/// | ||
/// Returns {{prefix this "/// " skipFirstLine=true}} | ||
{{/unless}}{{/resolveName}}{{!! | ||
}}{{/unless}} |
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
33 changes: 33 additions & 0 deletions
33
gluecodium/src/main/resources/templates/swift/SwiftLambdaComment.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,33 @@ | ||
{{!! | ||
! | ||
! Copyright (C) 2016-2023 HERE Europe B.V. | ||
! | ||
! 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. | ||
! | ||
! SPDX-License-Identifier: Apache-2.0 | ||
! License-Filename: LICENSE | ||
! | ||
!}} | ||
{{#ifPredicate "hasAnyComment"}} | ||
{{#resolveName comment}}{{#unless this.isEmpty}}{{prefix this "/// "}}{{/unless}}{{/resolveName}}{{!! | ||
}}{{#parameters}}{{#set self=this}}{{#resolveName comment}}{{#unless this.isEmpty}} | ||
/// - Parameter {{self.parameterName}}: {{prefix this "/// " skipFirstLine=true}}{{!! | ||
}}{{/unless}}{{/resolveName}}{{/set}}{{/parameters}}{{!! | ||
}}{{#unless returnType.isVoid}}{{!! | ||
}}{{#resolveName returnType.comment}}{{#unless this.isEmpty}} | ||
/// - Returns: {{prefix this "/// " skipFirstLine=true}}{{!! | ||
}}{{/unless}}{{/resolveName}}{{!! | ||
}}{{/unless}}{{#if comment.isExcluded}} | ||
/// :nodoc:{{/if}}{{#attributes.deprecated}} | ||
@available(*, deprecated{{#if message}}, message: "{{#resolveName message}}{{escape this}}{{/resolveName}}"{{/if}}){{/attributes.deprecated}} | ||
{{/ifPredicate}} |
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
42 changes: 42 additions & 0 deletions
42
gluecodium/src/test/resources/smoke/comments/input/CommentsLambda.lime
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,42 @@ | ||
# Copyright (C) 2016-2019 HERE Europe B.V. | ||
# | ||
# 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. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# License-Filename: LICENSE | ||
|
||
package smoke | ||
|
||
class LambdaComments { | ||
|
||
// The first line of the doc. | ||
// @param[p0] The first input parameter | ||
lambda WithNoNamedParameters = (String) -> String | ||
|
||
// The first line of the doc. | ||
lambda WithNoDocsForParameters = (String) -> String | ||
|
||
// The first line of the doc. | ||
// @param[inputParameter] The first input parameter. The second sentence of the first input parameter. | ||
// @return The string. | ||
lambda WithNamedParameters = (inputParameter: String) -> String | ||
|
||
// The first line of the doc. | ||
// @param[p0] The first input parameter. | ||
// @return The string. | ||
lambda MixedDocNameParameters = (inputParameter: String, secondInputParameter: String) -> String | ||
|
||
lambda NoCommentsNoNamedParams = (String, String) -> String | ||
|
||
lambda NoCommentsWithNamedParams = (first: String, second: String) -> String | ||
} |
Oops, something went wrong.