From e6337d2d550c40bfe1a4b9028cb9d37317fb3415 Mon Sep 17 00:00:00 2001 From: Karan Date: Sat, 20 Dec 2025 01:03:52 +0530 Subject: [PATCH] Add parameterLabel modifier for argument labels --- .../SupportTypes/SemanticTokenModifiers.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/LanguageServerProtocol/SupportTypes/SemanticTokenModifiers.swift b/Sources/LanguageServerProtocol/SupportTypes/SemanticTokenModifiers.swift index b623e52d1..fda13cf4e 100644 --- a/Sources/LanguageServerProtocol/SupportTypes/SemanticTokenModifiers.swift +++ b/Sources/LanguageServerProtocol/SupportTypes/SemanticTokenModifiers.swift @@ -47,6 +47,10 @@ public struct SemanticTokenModifiers: OptionSet, Hashable, Sendable { public static let fileScope = Self(rawValue: 1 << 19) public static let globalScope = Self(rawValue: 1 << 20) + // The following is an LSP extension from SourceKit-LSP + /// Marks a token as a parameter label in a function signature or call. + public static let parameterLabel = Self(rawValue: 1 << 21) + public var name: String? { switch self { case .declaration: return "declaration" @@ -70,6 +74,7 @@ public struct SemanticTokenModifiers: OptionSet, Hashable, Sendable { case .classScope: return "classScope" case .fileScope: return "fileScope" case .globalScope: return "globalScope" + case .parameterLabel: return "parameterLabel" default: return nil } } @@ -98,5 +103,6 @@ public struct SemanticTokenModifiers: OptionSet, Hashable, Sendable { .classScope, .fileScope, .globalScope, + .parameterLabel, ] }