File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed
Sources/BuildServerProtocol Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
2
+ //
3
+ // This source file is part of the Swift.org open source project
4
+ //
5
+ // Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
6
+ // Licensed under Apache License v2.0 with Runtime Library Exception
7
+ //
8
+ // See https://swift.org/LICENSE.txt for license information
9
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
+ //
11
+ //===----------------------------------------------------------------------===//
12
+ import LanguageServerProtocol
13
+
14
+ /// The SourceKitOptions request is sent from the client to the server
15
+ /// to query for the list of compiler options necessary to compile this file.
16
+ public struct SourceKitOptions : RequestType , Hashable {
17
+ public static let method : String = " textDocument/sourceKitOptions "
18
+ public typealias Response = SourceKitOptionsResult
19
+
20
+ /// The URL of the document to get options for
21
+ public var uri : URL
22
+
23
+ public init ( uri: URL ) {
24
+ self . uri = uri
25
+ }
26
+ }
27
+
28
+ public struct SourceKitOptionsResult : ResponseType , Hashable {
29
+ /// The compiler options required for the requested file.
30
+ public var options : [ String ]
31
+
32
+ /// The working directory for the compile command.
33
+ public var workingDirectory : String ?
34
+ }
Original file line number Diff line number Diff line change @@ -14,11 +14,12 @@ import LanguageServerProtocol
14
14
fileprivate let requestTypes : [ _RequestType . Type ] = [
15
15
InitializeBuild . self,
16
16
ShutdownBuild . self,
17
+ SourceKitOptions . self,
17
18
]
18
19
19
20
fileprivate let notificationTypes : [ NotificationType . Type ] = [
20
- InitializedBuildNotification . self,
21
21
ExitBuildNotification . self,
22
+ InitializedBuildNotification . self,
22
23
]
23
24
24
25
public let bspRegistry = MessageRegistry ( requests: requestTypes, notifications: notificationTypes)
You can’t perform that action at this time.
0 commit comments