Skip to content

Commit e971af5

Browse files
authored
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?
1 parent a99ba2f commit e971af5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ platforms, listed below.
109109
| Generator plugin and CLI | ✅ 10.15+ || ✖️ | ✖️ | ✖️ | ✖️ |
110110
| Generated code and runtime library | ✅ 10.15+ || ✅ 13+ | ✅ 13+ | ✅ 6+ | ✅ 1+ |
111111

112+
> [!NOTE]
113+
> 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).
114+
112115
## Documentation and example projects
113116

114117
To get started, check out the [documentation][docs-generator], which contains

Sources/swift-openapi-generator/Documentation.docc/Swift-OpenAPI-Generator.md

+2
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ The generated code, runtime library, and transports are supported on more platfo
107107
| Generator plugin and CLI | ✅ 10.15+ || ✖️ | ✖️ | ✖️ | ✖️ |
108108
| Generated code and runtime library | ✅ 10.15+ || ✅ 13+ | ✅ 13+ | ✅ 6+ | ✅ 1+ |
109109

110+
> 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).
111+
110112
### Documentation and example projects
111113

112114
To get started, check out the topics below, or one of the <doc:Swift-OpenAPI-Generator> tutorials.

0 commit comments

Comments
 (0)