Skip to content

Commit

Permalink
Support for Swift 5.9
Browse files Browse the repository at this point in the history
Co-authored-by: Marcos Griselli <[email protected]>
  • Loading branch information
johnfairh and marcosgriselli committed Feb 27, 2024
1 parent ec79396 commit cd599fd
Show file tree
Hide file tree
Showing 22 changed files with 31,276 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
MacOS:
strategy:
matrix:
xcode_version: ['14.1', '14.3.1']
xcode_version: ['14.3.1', '15.2']
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app
Expand All @@ -21,7 +21,7 @@ jobs:
Linux:
strategy:
matrix:
tag: ['5.7-focal', '5.8-focal']
tag: ['5.8-focal', '5.9-focal']
runs-on: ubuntu-latest
container:
image: swift:${{ matrix.tag }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pod_lib_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
pod_lib_lint:
name: pod lib lint
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer
steps:
- uses: actions/checkout@v3
- run: bundle install --path vendor/bundle
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/swiftpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
Xcode:
strategy:
matrix:
xcode_version: ['14.1', '14.3.1']
xcode_version: ['14.3.1', '15.2']
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app
Expand All @@ -23,7 +23,7 @@ jobs:
Linux:
strategy:
matrix:
tag: ['5.7', '5.8']
tag: ['5.8', '5.9']
runs-on: ubuntu-latest
container:
image: swift:${{ matrix.tag }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/xcodebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
Xcode:
strategy:
matrix:
xcode_version: ['14.1', '14.3.1']
xcode_version: ['14.3.1', '15.2']
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

##### Enhancements

* Added new syntax, attribute and declaration kinds introduced in Swift 5.9.
[John Fairhurst](https://github.com/johnfairh)

* Added new syntax, attribute and declaration kinds introduced in Swift 5.8.
[JP Simard](https://github.com/jpsim)

Expand Down
71 changes: 43 additions & 28 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,41 +1,49 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.5)
CFPropertyList (3.0.7)
base64
nkf
rexml
activesupport (6.1.7.6)
activesupport (7.1.3.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
base64 (0.2.0)
bigdecimal (3.1.6)
claide (1.1.0)
cocoapods (1.11.3)
cocoapods (1.15.2)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.11.3)
cocoapods-core (= 1.15.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.4.0, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.4.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 1.0, < 3.0)
xcodeproj (>= 1.21.0, < 2.0)
cocoapods-core (1.11.3)
activesupport (>= 5.0, < 7)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.15.2)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
Expand All @@ -45,7 +53,7 @@ GEM
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.6.3)
cocoapods-downloader (2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
Expand All @@ -54,58 +62,65 @@ GEM
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.2.2)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
drb (2.2.0)
ruby2_keywords
escape (0.0.4)
ethon (0.15.0)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.15.5)
ffi (1.16.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
jazzy (0.14.2)
jazzy (0.14.4)
cocoapods (~> 1.5)
mustache (~> 1.1)
open4 (~> 1.3)
redcarpet (~> 3.4)
rexml (~> 3.2)
rouge (>= 2.0.6, < 4.0)
rouge (>= 2.0.6, < 5.0)
sassc (~> 2.1)
sqlite3 (~> 1.3)
xcinvoke (~> 0.3.0)
json (2.6.2)
json (2.7.1)
liferaft (0.0.6)
minitest (5.19.0)
mini_portile2 (2.8.5)
minitest (5.22.2)
molinillo (0.8.0)
mustache (1.1.1)
mutex_m (0.2.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
open4 (1.3.4)
public_suffix (4.0.7)
redcarpet (3.5.1)
rexml (3.2.5)
rouge (3.28.0)
redcarpet (3.6.0)
rexml (3.2.6)
rouge (4.2.0)
ruby-macho (2.5.1)
ruby2_keywords (0.0.5)
sassc (2.4.0)
ffi (~> 1.9)
sqlite3 (1.4.2)
typhoeus (1.4.0)
sqlite3 (1.7.2)
mini_portile2 (~> 2.8.0)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcinvoke (0.3.0)
liferaft (~> 0.0.6)
xcodeproj (1.21.0)
xcodeproj (1.24.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
zeitwerk (2.6.11)

PLATFORMS
ruby
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ package: installables
release: package

docker_test:
docker run -v `pwd`:`pwd` -w `pwd` --name sourcekitten --rm swift:5.6-focal swift test --parallel
docker run -v `pwd`:`pwd` -w `pwd` --name sourcekitten --rm swift:5.9-focal swift test --parallel

docker_htop:
docker run -it --rm --pid=container:sourcekitten terencewestphal/htop || reset
Expand Down
13 changes: 12 additions & 1 deletion Source/SourceKittenFramework/SwiftDeclarationAttributeKind.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public enum SwiftDeclarationAttributeKind: String, CaseIterable {
case setterPublic = "source.decl.attribute.setter_access.public"
case setterOpen = "source.decl.attribute.setter_access.open"
case optimize = "source.decl.attribute._optimize"
case consuming = "source.decl.attribute.__consuming"
case __consuming = "source.decl.attribute.__consuming"
case implicitlyUnwrappedOptional = "source.decl.attribute._implicitly_unwrapped_optional"

// only available in Swift >= 4.1.50
Expand Down Expand Up @@ -185,4 +185,15 @@ public enum SwiftDeclarationAttributeKind: String, CaseIterable {
case typeWrapper = "source.decl.attribute.typeWrapper"
case _expose = "source.decl.attribute._expose"
case _documentation = "source.decl.attribute._documentation"

// Only available in Swift >= 5.9
case setterAccessPackage = "source.decl.attribute.setter_access.package"
case package = "source.decl.attribute.package"
case initializes = "source.decl.attribute.initializes"
case _lexicalLifetimes = "source.decl.attribute._lexicalLifetimes"
case consuming = "source.decl.attribute.consuming"
case attached = "source.decl.attribute.attached"
case borrowing = "source.decl.attribute.borrowing"
case storageRestrictions = "source.decl.attribute.storageRestrictions"
case accesses = "source.decl.attribute.accesses"
}
2 changes: 2 additions & 0 deletions Source/SourceKittenFramework/SwiftDeclarationKind.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,6 @@ public enum SwiftDeclarationKind: String, CaseIterable {
case actor = "source.lang.swift.decl.actor"
/// `macro`
case macro = "source.lang.swift.decl.macro"
/// `function.accessor.init`
case functionAccessorInit = "source.lang.swift.decl.function.accessor.init"
}
4 changes: 4 additions & 0 deletions Source/SourceKittenFramework/library_wrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ struct DynamicLinkLibrary {
typealias Handle = HMODULE?
#else
typealias Handle = UnsafeMutableRawPointer
// Workaround for Swift 5.9+, see LibraryWrapperGeneratorTests
private struct GetLastError {}
private struct WindowsError { let code: GetLastError }
// End workaround
#endif

fileprivate let handle: Handle
Expand Down
Loading

0 comments on commit cd599fd

Please sign in to comment.