File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -26,14 +26,19 @@ import var TSCBasic.localFileSystem
26
26
27
27
extension AbsolutePath : ExpressibleByArgument {
28
28
public init ? ( argument: String ) {
29
+ let path : AbsolutePath ?
30
+
29
31
if let cwd = localFileSystem. currentWorkingDirectory {
30
- self . init ( argument, relativeTo: cwd)
32
+ path = try ? AbsolutePath ( validating : argument, relativeTo: cwd)
31
33
} else {
32
- guard let path = try ? AbsolutePath ( validating: argument) else {
33
- return nil
34
- }
35
- self = path
34
+ path = try ? AbsolutePath ( validating: argument)
35
+ }
36
+
37
+ guard let path = path else {
38
+ return nil
36
39
}
40
+
41
+ self = path
37
42
}
38
43
39
44
public static var defaultCompletionKind : CompletionKind {
@@ -192,7 +197,7 @@ struct SourceKitLSP: ParsableCommand {
192
197
syncRequests: syncRequests
193
198
)
194
199
195
- let installPath = AbsolutePath ( Bundle . main. bundlePath)
200
+ let installPath = try AbsolutePath ( validating : Bundle . main. bundlePath)
196
201
ToolchainRegistry . shared = ToolchainRegistry ( installPath: installPath, localFileSystem)
197
202
198
203
let server = SourceKitServer ( client: clientConnection, options: mapOptions ( ) , onExit: {
You can’t perform that action at this time.
0 commit comments