From e971af5c5374e4ea83c20d0ad0a0df2cc84d39ad Mon Sep 17 00:00:00 2001 From: Tobias Date: Sat, 23 Nov 2024 15:20:27 +0100 Subject: [PATCH] Add a note about an open issue with code generation and SourceKit-LSP (#642) Following the discussion on Slack, this adds a note for users of SourceKit-LSP informing them that the default code generation might not work as expected and offers a possible workaround. https://swift-open-source.slack.com/archives/C02PV8T5HQD/p1726815970093299 Only updates documentation. Let me know if you feel this is the right place for this information? --- README.md | 3 +++ .../Documentation.docc/Swift-OpenAPI-Generator.md | 2 ++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 5c934926..5ee9647d 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 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 To get started, check out the [documentation][docs-generator], which contains 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..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,6 +107,8 @@ 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). + ### Documentation and example projects To get started, check out the topics below, or one of the tutorials.