From d10e61c2180d15cee0c6dcb951a4b9342c64a501 Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 2 Oct 2024 17:08:00 +0200 Subject: [PATCH 1/6] Add a note about an open issue with code generation and SourceKit-LSP Following the discussion on Slack, this adds a note for users of SourceKit-LSP that the default code generation might not work as expected. https://swift-open-source.slack.com/archives/C02PV8T5HQD/p1726815970093299 --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 5c934926..1d30b475 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,10 @@ Swift OpenAPI Generator and integrate with other packages in the ecosystem. Or if you prefer to watch a video, check out [Meet Swift OpenAPI Generator](https://developer.apple.com/wwdc23/10171) from WWDC23. +> [!NOTE] +> When using Visual Studio Code or other editors that rely on [SourceKit-LSP](https://github.com/swiftlang/sourcekit-lsp), the editor may not correctly recognize generated code within same module. As a workaround, consider creating a separate target for code generation and importing this module into your application code. For more details, see the discussion in [swiftlang/sourcekit-lsp#665](https://github.com/swiftlang/sourcekit-lsp/issues/665#issuecomment-2093169169). + + [openapi]: https://openapis.org [repo-generator]: https://github.com/apple/swift-openapi-generator [docs-generator]: https://swiftpackageindex.com/apple/swift-openapi-generator/documentation From 1e3dcf479cc5d2dd3c35b7b3439d1016818d08c4 Mon Sep 17 00:00:00 2001 From: Tobias Date: Fri, 22 Nov 2024 22:16:58 +0100 Subject: [PATCH 2/6] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1d30b475..f7800e0d 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,9 @@ platforms, listed below. | Generator plugin and CLI | ✅ 10.15+ | ✅ | ✖️ | ✖️ | ✖️ | ✖️ | | Generated code and runtime library | ✅ 10.15+ | ✅ | ✅ 13+ | ✅ 13+ | ✅ 6+ | ✅ 1+ | +> [!NOTE] +> When using Visual Studio Code or other editors that rely on [SourceKit-LSP](https://github.com/swiftlang/sourcekit-lsp), the editor may not correctly recognize generated code within the same module. As a workaround, consider creating a separate target for code generation and importing this from another module. For more details, see the discussion in [swiftlang/sourcekit-lsp#665](https://github.com/swiftlang/sourcekit-lsp/issues/665#issuecomment-2093169169). + ## Documentation and example projects To get started, check out the [documentation][docs-generator], which contains @@ -120,9 +123,6 @@ Swift OpenAPI Generator and integrate with other packages in the ecosystem. Or if you prefer to watch a video, check out [Meet Swift OpenAPI Generator](https://developer.apple.com/wwdc23/10171) from WWDC23. -> [!NOTE] -> When using Visual Studio Code or other editors that rely on [SourceKit-LSP](https://github.com/swiftlang/sourcekit-lsp), the editor may not correctly recognize generated code within same module. As a workaround, consider creating a separate target for code generation and importing this module into your application code. For more details, see the discussion in [swiftlang/sourcekit-lsp#665](https://github.com/swiftlang/sourcekit-lsp/issues/665#issuecomment-2093169169). - [openapi]: https://openapis.org [repo-generator]: https://github.com/apple/swift-openapi-generator From e1a6c1ce19672203cc11391959a62cc1593996ef Mon Sep 17 00:00:00 2001 From: Tobias Date: Fri, 22 Nov 2024 22:17:34 +0100 Subject: [PATCH 3/6] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index f7800e0d..bd0acd9d 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,6 @@ Swift OpenAPI Generator and integrate with other packages in the ecosystem. Or if you prefer to watch a video, check out [Meet Swift OpenAPI Generator](https://developer.apple.com/wwdc23/10171) from WWDC23. - [openapi]: https://openapis.org [repo-generator]: https://github.com/apple/swift-openapi-generator [docs-generator]: https://swiftpackageindex.com/apple/swift-openapi-generator/documentation From c68d7b2d6017892537790722c0683fee94493f55 Mon Sep 17 00:00:00 2001 From: Tobias Date: Fri, 22 Nov 2024 22:23:07 +0100 Subject: [PATCH 4/6] update docc --- .../Documentation.docc/Swift-OpenAPI-Generator.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md b/Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md index 79ef2abd..952f220c 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md +++ b/Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md @@ -107,6 +107,9 @@ The generated code, runtime library, and transports are supported on more platfo | Generator plugin and CLI | ✅ 10.15+ | ✅ | ✖️ | ✖️ | ✖️ | ✖️ | | Generated code and runtime library | ✅ 10.15+ | ✅ | ✅ 13+ | ✅ 13+ | ✅ 6+ | ✅ 1+ | +> [!NOTE] +> When using Visual Studio Code or other editors that rely on [SourceKit-LSP](https://github.com/swiftlang/sourcekit-lsp), the editor may not correctly recognize generated code within the same module. As a workaround, consider creating a separate target for code generation and importing this from another module. For more details, see the discussion in [swiftlang/sourcekit-lsp#665](https://github.com/swiftlang/sourcekit-lsp/issues/665#issuecomment-2093169169). + ### Documentation and example projects To get started, check out the topics below, or one of the tutorials. From 56bd8f83ef3708fd0cf273625a791ed5a09691c3 Mon Sep 17 00:00:00 2001 From: Tobias Date: Fri, 22 Nov 2024 21:29:35 +0000 Subject: [PATCH 5/6] improve language --- README.md | 2 +- .../Documentation.docc/Swift-OpenAPI-Generator.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bd0acd9d..5ee9647d 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ platforms, listed below. | Generated code and runtime library | ✅ 10.15+ | ✅ | ✅ 13+ | ✅ 13+ | ✅ 6+ | ✅ 1+ | > [!NOTE] -> When using Visual Studio Code or other editors that rely on [SourceKit-LSP](https://github.com/swiftlang/sourcekit-lsp), the editor may not correctly recognize generated code within the same module. As a workaround, consider creating a separate target for code generation and importing this from another module. For more details, see the discussion in [swiftlang/sourcekit-lsp#665](https://github.com/swiftlang/sourcekit-lsp/issues/665#issuecomment-2093169169). +> When using Visual Studio Code or other editors that rely on [SourceKit-LSP](https://github.com/swiftlang/sourcekit-lsp), the editor may not correctly recognize generated code within the same module. As a workaround, consider creating a separate target for code generation and then importing it into your main module. For more details, see the discussion in [swiftlang/sourcekit-lsp#665](https://github.com/swiftlang/sourcekit-lsp/issues/665#issuecomment-2093169169). ## Documentation and example projects diff --git a/Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md b/Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md index 952f220c..54f7bc41 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md +++ b/Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md @@ -108,7 +108,7 @@ The generated code, runtime library, and transports are supported on more platfo | Generated code and runtime library | ✅ 10.15+ | ✅ | ✅ 13+ | ✅ 13+ | ✅ 6+ | ✅ 1+ | > [!NOTE] -> When using Visual Studio Code or other editors that rely on [SourceKit-LSP](https://github.com/swiftlang/sourcekit-lsp), the editor may not correctly recognize generated code within the same module. As a workaround, consider creating a separate target for code generation and importing this from another module. For more details, see the discussion in [swiftlang/sourcekit-lsp#665](https://github.com/swiftlang/sourcekit-lsp/issues/665#issuecomment-2093169169). +> When using Visual Studio Code or other editors that rely on [SourceKit-LSP](https://github.com/swiftlang/sourcekit-lsp), the editor may not correctly recognize generated code within the same module. As a workaround, consider creating a separate target for code generation and then importing it into your main module. For more details, see the discussion in [swiftlang/sourcekit-lsp#665](https://github.com/swiftlang/sourcekit-lsp/issues/665#issuecomment-2093169169). ### Documentation and example projects From 895790259dc833df7a4d01a4362f3f1fc0363d98 Mon Sep 17 00:00:00 2001 From: Tobias Haeberle Date: Sat, 23 Nov 2024 07:49:45 +0100 Subject: [PATCH 6/6] fix docc note syntax --- .../Documentation.docc/Swift-OpenAPI-Generator.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md b/Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md index 54f7bc41..4584cf57 100644 --- a/Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md +++ b/Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md @@ -107,8 +107,7 @@ The generated code, runtime library, and transports are supported on more platfo | Generator plugin and CLI | ✅ 10.15+ | ✅ | ✖️ | ✖️ | ✖️ | ✖️ | | Generated code and runtime library | ✅ 10.15+ | ✅ | ✅ 13+ | ✅ 13+ | ✅ 6+ | ✅ 1+ | -> [!NOTE] -> When using Visual Studio Code or other editors that rely on [SourceKit-LSP](https://github.com/swiftlang/sourcekit-lsp), the editor may not correctly recognize generated code within the same module. As a workaround, consider creating a separate target for code generation and then importing it into your main module. For more details, see the discussion in [swiftlang/sourcekit-lsp#665](https://github.com/swiftlang/sourcekit-lsp/issues/665#issuecomment-2093169169). +> Note: When using Visual Studio Code or other editors that rely on [SourceKit-LSP](https://github.com/swiftlang/sourcekit-lsp), the editor may not correctly recognize generated code within the same module. As a workaround, consider creating a separate target for code generation and then importing it into your main module. For more details, see the discussion in [swiftlang/sourcekit-lsp#665](https://github.com/swiftlang/sourcekit-lsp/issues/665#issuecomment-2093169169). ### Documentation and example projects