Skip to content

Commit 8270688

Browse files
authored
Merge pull request #16 from tayloraswift/tag-crawling
swift 5.9 support
2 parents 6350137 + 3d71ca6 commit 8270688

File tree

63 files changed

+646
-414
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+646
-414
lines changed

Assets/css/Main.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/css/Main.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.resolved

Lines changed: 2 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.8
1+
// swift-tools-version:5.9
22
import PackageDescription
33

44
let package:Package = .init(
@@ -75,8 +75,6 @@ let package:Package = .init(
7575
.package(url: "https://github.com/tayloraswift/swift-mongodb", .upToNextMinor(
7676
from: "0.8.2")),
7777

78-
.package(url: "https://github.com/swift-server/swift-backtrace", .upToNextMinor(
79-
from: "1.3.4")),
8078
.package(url: "https://github.com/apple/swift-nio", .upToNextMinor(
8179
from: "2.57.0")),
8280
.package(url: "https://github.com/apple/swift-nio-http2", .upToNextMinor(
@@ -88,7 +86,7 @@ let package:Package = .init(
8886
.package(url: "https://github.com/apple/swift-system", .upToNextMinor(
8987
from: "1.2.1")),
9088
.package(url: "https://github.com/apple/swift-syntax",
91-
exact: "508.0.1"),
89+
exact: "509.0.0"),
9290
],
9391
targets:
9492
[
@@ -239,7 +237,7 @@ let package:Package = .init(
239237
.target(name: "Signatures"),
240238
.target(name: "Symbols"),
241239

242-
.product(name: "IDEUtils", package: "swift-syntax"),
240+
.product(name: "SwiftIDEUtils", package: "swift-syntax"),
243241
.product(name: "SwiftParser", package: "swift-syntax"),
244242
]),
245243

@@ -456,8 +454,6 @@ let package:Package = .init(
456454
.target(name: "Multiparts"),
457455
.target(name: "System"),
458456
.target(name: "UnidocPages"),
459-
460-
.product(name: "Backtrace", package: "swift-backtrace"),
461457
]),
462458

463459

Sources/HTTPServer/Authorities/ServerAuthority.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import NIOPosix
55
import TraceableErrors
66

77
public
8-
protocol ServerAuthority<SecurityContext>
8+
protocol ServerAuthority<SecurityContext>:Sendable
99
{
1010
associatedtype SecurityContext = Never
1111

Sources/JSONLegacy/CodableCompatibility/JSON.KeyedDecoder.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,22 +149,22 @@ extension JSON.KeyedDecoder:KeyedDecodingContainerProtocol
149149
}
150150

151151
public
152-
func singleValueContainer<Key>(forKey key:Key,
153-
typed _:Key.Type = Key.self) throws -> JSON.SingleValueDecoder
154-
where Key:CodingKey
152+
func singleValueContainer<NestedKey>(forKey key:NestedKey,
153+
typed _:NestedKey.Type = NestedKey.self) throws -> JSON.SingleValueDecoder
154+
where NestedKey:CodingKey
155155
{
156156
let value:JSON.Node = try self.diagnose(key){ $0 }
157157
let decoder:JSON.SingleValueDecoder = .init(value,
158158
path: self.codingPath + CollectionOfOne<any CodingKey>.init(key))
159159
return decoder
160160
}
161161
public
162-
func nestedUnkeyedContainer(forKey key:Key) throws -> UnkeyedDecodingContainer
162+
func nestedUnkeyedContainer(forKey key:Key) throws -> any UnkeyedDecodingContainer
163163
{
164164
let path:[any CodingKey] = self.codingPath + CollectionOfOne<any CodingKey>.init(key)
165165
let container:JSON.UnkeyedDecoder =
166166
.init(try self.diagnose(key, \.array), path: path)
167-
return container as UnkeyedDecodingContainer
167+
return container as any UnkeyedDecodingContainer
168168
}
169169
public
170170
func nestedContainer<NestedKey>(keyedBy _:NestedKey.Type,

Sources/JSONLegacy/CodableCompatibility/JSON.Node (ext).swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ extension JSON.Node:Decoder
1212
}
1313

1414
public
15-
func singleValueContainer() -> SingleValueDecodingContainer
15+
func singleValueContainer() -> any SingleValueDecodingContainer
1616
{
17-
JSON.SingleValueDecoder.init(self, path: []) as SingleValueDecodingContainer
17+
JSON.SingleValueDecoder.init(self, path: []) as any SingleValueDecodingContainer
1818
}
1919
public
20-
func unkeyedContainer() throws -> UnkeyedDecodingContainer
20+
func unkeyedContainer() throws -> any UnkeyedDecodingContainer
2121
{
2222
try JSON.SingleValueDecoder.init(self, path: []).unkeyedContainer()
2323
}

Sources/JSONParsing/Rules/JSON.NodeRule.Null.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Grammar
33
extension JSON.NodeRule
44
{
55
/// A literal `null` expression.
6-
enum Null<Location>:LiteralRule
6+
enum Null:LiteralRule
77
{
88
typealias Terminal = UInt8
99

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import IDEUtils
21
import MarkdownABI
2+
import SwiftIDEUtils
33

44
extension MarkdownBytecode.Context
55
{
@@ -8,30 +8,28 @@ extension MarkdownBytecode.Context
88
switch classification
99
{
1010
case .none,
11-
.editorPlaceholder: return nil
11+
.editorPlaceholder: return nil
1212

13-
case .attribute: self = .attribute
13+
case .attribute: self = .attribute
1414

15-
case .buildConfigId: self = .directive
16-
case .poundDirectiveKeyword: self = .magic
15+
case .ifConfigDirective: self = .directive
1716

1817
case .lineComment,
19-
.blockComment: self = .comment
18+
.blockComment: self = .comment
2019
case .docLineComment,
21-
.docBlockComment: self = .doccomment
20+
.docBlockComment: self = .doccomment
2221

23-
case .dollarIdentifier: self = .pseudo
24-
case .identifier: self = .identifier
25-
case .operatorIdentifier: self = .operator
22+
case .dollarIdentifier: self = .pseudo
23+
case .identifier: self = .identifier
24+
case .operator: self = .operator
2625

2726
case .integerLiteral,
28-
.floatingLiteral: self = .literalNumber
27+
.floatLiteral: self = .literalNumber
2928
case .stringLiteral,
30-
.objectLiteral: self = .literalString
29+
.regexLiteral: self = .literalString
3130

32-
case .keyword: self = .keyword
33-
case .stringInterpolationAnchor: self = .interpolation
34-
case .typeIdentifier: self = .type
31+
case .keyword: self = .keyword
32+
case .type: self = .type
3533
}
3634
}
3735
}

Sources/MarkdownPluginSwift/MarkdownCodeLanguage.Swift.Highlighter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import IDEUtils
21
import MarkdownABI
2+
import SwiftIDEUtils
33
import SwiftParser
44
import SwiftSyntax
55

Sources/MarkdownPluginSwift/Signature.Expanded (ext).swift

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,24 @@ extension Signature.Expanded
7272
$0 += utf8[range]
7373

7474
case .text(let range, let color?, .toplevel?):
75+
if case .attribute = color
76+
{
77+
switch String.init(decoding: utf8[range], as: Unicode.UTF8.self)
78+
{
79+
case "@attached": keywords.attached = true
80+
case "@freestanding": keywords.freestanding = true
81+
default: break
82+
}
83+
}
7584
if case .keyword = color
7685
{
7786
// The `actor` and `async` keywords are contextual; there is no
7887
// other way to detect them besides inspecting token text!
7988
switch String.init(decoding: utf8[range], as: Unicode.UTF8.self)
8089
{
81-
case "actor": keywords.actor = true
82-
case "class": keywords.class = true
83-
default: break
90+
case "actor": keywords.actor = true
91+
case "class": keywords.class = true
92+
default: break
8493
}
8594
}
8695

@@ -90,7 +99,18 @@ extension Signature.Expanded
9099

91100
$0[color]
92101
{
93-
if let referent:Scalar = symbols.removeValue(forKey: range.lowerBound)
102+
let offset:Int
103+
if case .attribute = color,
104+
case 0x40 = utf8[range.lowerBound] // '@'
105+
{
106+
offset = range.lowerBound + 1
107+
}
108+
else
109+
{
110+
offset = range.lowerBound
111+
}
112+
113+
if let referent:Scalar = symbols.removeValue(forKey: offset)
94114
{
95115
$0[.href] =
96116
{

Sources/MarkdownPluginSwift/Signature.Expanded.InterestingKeywords.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,22 @@ extension Signature.Expanded
88
public
99
var actor:Bool
1010
public
11+
var attached:Bool
12+
public
1113
var `class`:Bool
14+
public
15+
var freestanding:Bool
1216

1317
@inlinable public
14-
init(actor:Bool = false, `class`:Bool = false)
18+
init(actor:Bool = false,
19+
attached:Bool = false,
20+
`class`:Bool = false,
21+
freestanding:Bool = false)
1522
{
1623
self.actor = actor
24+
self.attached = attached
1725
self.class = `class`
26+
self.freestanding = freestanding
1827
}
1928
}
2029
}

0 commit comments

Comments
 (0)