-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make LSP method names more consistent
Both internally and against the spec Also add missing linkedEditingRange and moniker methods
- Loading branch information
Showing
7 changed files
with
122 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
Sources/LanguageServerProtocol/LanguageFeatures/LinkedEditingRange.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,26 @@ | ||
import Foundation | ||
|
||
public typealias LinkedEditingRangeClientCapabilities = DynamicRegistrationClientCapabilities | ||
|
||
public struct LinkedEditingRangeParams: Codable, Hashable, Sendable { | ||
public let workDoneToken: ProgressToken? | ||
public let partialResultToken: ProgressToken? | ||
|
||
public let textDocument: TextDocumentIdentifier | ||
public let position: Position | ||
|
||
public init(workDoneToken: ProgressToken? = nil, partialResultToken: ProgressToken? = nil, textDocument: TextDocumentIdentifier, position: Position) { | ||
self.workDoneToken = workDoneToken | ||
self.partialResultToken = partialResultToken | ||
self.textDocument = textDocument | ||
self.position = position | ||
} | ||
} | ||
|
||
public struct LinkedEditingRanges : Codable, Sendable { | ||
public let ranges: [LSPRange] | ||
public let wordPattern: String? | ||
} | ||
|
||
|
||
public typealias LinkedEditingRangeResponse = LinkedEditingRanges? |
47 changes: 47 additions & 0 deletions
47
Sources/LanguageServerProtocol/LanguageFeatures/Moniker.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,50 @@ | ||
import Foundation | ||
|
||
public typealias MonikerClientCapabilities = DynamicRegistrationClientCapabilities | ||
|
||
public struct MonikerParams: Codable, Hashable, Sendable { | ||
public let workDoneToken: ProgressToken? | ||
public let partialResultToken: ProgressToken? | ||
|
||
public let textDocument: TextDocumentIdentifier | ||
public let position: Position | ||
|
||
public init(workDoneToken: ProgressToken? = nil, partialResultToken: ProgressToken? = nil, textDocument: TextDocumentIdentifier, position: Position) { | ||
self.workDoneToken = workDoneToken | ||
self.partialResultToken = partialResultToken | ||
self.textDocument = textDocument | ||
self.position = position | ||
} | ||
} | ||
|
||
public enum UniquenessLevel: Codable, Sendable { | ||
case document | ||
case project | ||
case group | ||
case scheme | ||
case global | ||
// public static let document = "document" | ||
// public static let project = "project" | ||
// public static let group = "group" | ||
// public static let scheme = "scheme" | ||
// public static let global = "global" | ||
} | ||
|
||
public enum MonikerKind : Codable, Sendable{ | ||
case _import | ||
case export | ||
case local | ||
// public static let _import = "import" | ||
// public static let export = "export" | ||
// public static let local = "local" | ||
} | ||
|
||
public struct Moniker : Codable, Sendable { | ||
public let scheme: String | ||
public let identifier: String | ||
public let unique: UniquenessLevel | ||
public let kind: MonikerKind? | ||
} | ||
|
||
|
||
public typealias MonikerResponse = [Moniker]? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters