Skip to content

Commit ee01a3a

Browse files
committed
Add a documentation article for @_spi
Also remove the `Create SwiftSyntax Release.md` because it describes how to vendor the parser library and we’re no longer doing that.
1 parent 93e905c commit ee01a3a

File tree

4 files changed

+21
-35
lines changed

4 files changed

+21
-35
lines changed

CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntax/SwiftSyntaxDoccIndexTemplate.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@ allows Swift tools to parse, inspect, generate, and transform Swift source code.
1717
### Articles
1818

1919
- <doc:Working-with-SwiftSyntax>
20-
- <doc:ChangingSwiftSyntax>
21-
- <doc:Create-SwiftSyntax-Release>
2220

2321
### Tutorials
2422

2523
- <doc:Tutorial-Table-of-Contents>
2624

25+
### Contributing
26+
27+
These articles are intended for developers wishing to contribute to SwiftSyntax
28+
29+
- <doc:ChangingSwiftSyntax>
30+
2731
### Syntax
2832

2933
- <doc:SwiftSyntax/Syntax>

Sources/SwiftSyntax/Documentation.docc/Create SwiftSyntax Release.md

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# `@_spi` attribute
2+
3+
swift-syntax extensively makes extensive use of the `@_spi` attribute.
4+
5+
Functions marked as `@_spi(RawSyntax)` (where `RawSyntax` can be any name) are considered *SPI* (System Programming Interface) and are only accessible if the module that declares them is imported as `@_spi(RawSyntax)`.
6+
7+
Since functions marked as SPI are not part of the public API, swift-syntax makes no guarantee to their source stability. swift-syntax makes no effort to keep its SPI stable.
8+
9+
Declarations are typically marked as SPI because they have some kind of caveat that makes them unsafe to use in general. For example, when accessing ``RawSyntax`` nodes, you need to manually guarantee that the ``SyntaxArena`` they live in doesn’t get de-allocated. Other declarations have an `@_spi` to share them between different modudules within the swift-syntax package but those APIs shouldn’t be accessed publicly.

Sources/SwiftSyntax/Documentation.docc/generated/SwiftSyntax.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@ allows Swift tools to parse, inspect, generate, and transform Swift source code.
1717
### Articles
1818

1919
- <doc:Working-with-SwiftSyntax>
20-
- <doc:ChangingSwiftSyntax>
21-
- <doc:Create-SwiftSyntax-Release>
2220

2321
### Tutorials
2422

2523
- <doc:Tutorial-Table-of-Contents>
2624

25+
### Contributing
26+
27+
These articles are intended for developers wishing to contribute to SwiftSyntax
28+
29+
- <doc:ChangingSwiftSyntax>
30+
2731
### Syntax
2832

2933
- <doc:SwiftSyntax/Syntax>

0 commit comments

Comments
 (0)