From c5309f528bbe604cbd37f8ef7b928a45410b066c Mon Sep 17 00:00:00 2001 From: Matt <85322+mattmassicotte@users.noreply.github.com> Date: Sun, 23 Jul 2023 07:54:50 -0400 Subject: [PATCH] Add missing DiagnosticClientCapabilities --- .../LanguageServerProtocol/ClientCapabilities.swift | 5 ++++- .../LanguageFeatures/Diagnostics.swift | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Sources/LanguageServerProtocol/ClientCapabilities.swift b/Sources/LanguageServerProtocol/ClientCapabilities.swift index 24266c7..0bd2fa9 100644 --- a/Sources/LanguageServerProtocol/ClientCapabilities.swift +++ b/Sources/LanguageServerProtocol/ClientCapabilities.swift @@ -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, @@ -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 @@ -201,6 +203,7 @@ public struct TextDocumentClientCapabilities: Codable, Hashable, Sendable { self.callHierarchy = callHierarchy self.semanticTokens = semanticTokens self.moniker = moniker + self.diagnostic = diagnostic } } diff --git a/Sources/LanguageServerProtocol/LanguageFeatures/Diagnostics.swift b/Sources/LanguageServerProtocol/LanguageFeatures/Diagnostics.swift index defad57..4336317 100644 --- a/Sources/LanguageServerProtocol/LanguageFeatures/Diagnostics.swift +++ b/Sources/LanguageServerProtocol/LanguageFeatures/Diagnostics.swift @@ -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