Skip to content

Commit

Permalink
Add missing DiagnosticClientCapabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Jul 23, 2023
1 parent a9f9b2c commit c5309f5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/LanguageServerProtocol/ClientCapabilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ public struct TextDocumentClientCapabilities: Codable, Hashable, Sendable {
public var callHierarchy: CallHierarchyClientCapabilities?
public var semanticTokens: SemanticTokensClientCapabilities?
public var moniker: MonikerClientCapabilities?
public var diagnostic: DiagnosticClientCapabilities?

public init(synchronization: TextDocumentSyncClientCapabilities? = nil,
completion: CompletionClientCapabilities? = nil,
Expand All @@ -174,7 +175,8 @@ public struct TextDocumentClientCapabilities: Codable, Hashable, Sendable {
linkedEditingRange: LinkedEditingRangeClientCapabilities? = nil,
callHierarchy: CallHierarchyClientCapabilities? = nil,
semanticTokens: SemanticTokensClientCapabilities? = nil,
moniker: MonikerClientCapabilities? = nil) {
moniker: MonikerClientCapabilities? = nil,
diagnostic: DiagnosticClientCapabilities? = nil) {
self.synchronization = synchronization
self.completion = completion
self.hover = hover
Expand All @@ -201,6 +203,7 @@ public struct TextDocumentClientCapabilities: Codable, Hashable, Sendable {
self.callHierarchy = callHierarchy
self.semanticTokens = semanticTokens
self.moniker = moniker
self.diagnostic = diagnostic
}
}

Expand Down
10 changes: 10 additions & 0 deletions Sources/LanguageServerProtocol/LanguageFeatures/Diagnostics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ public struct PublishDiagnosticsClientCapabilities: Codable, Hashable, Sendable
}
}

public struct DiagnosticClientCapabilities: Codable, Hashable, Sendable {
public var dynamicRegistration: Bool?
public var relatedDocumentSupport: Bool?

public init(dynamicRegistration: Bool? = nil, relatedDocumentSupport: Bool?) {
self.dynamicRegistration = dynamicRegistration
self.relatedDocumentSupport = relatedDocumentSupport
}
}

public struct DiagnosticRelatedInformation: Codable, Hashable, Sendable {
public let location: Location
public let message: String
Expand Down

0 comments on commit c5309f5

Please sign in to comment.