@@ -53,9 +53,6 @@ struct SemanticTokensLegendTranslator {
5353 logger. error ( " Token type ' \( tokenType, privacy: . public) ' from clangd does not exist in SourceKit-LSP's legend " )
5454 tokenTypeTranslations [ UInt32 ( index) ] = . doesNotExistInSourceKitLSP
5555 case let sourceKitLSPIndex? :
56- logger. info (
57- " Token type ' \( tokenType, privacy: . public) ' from clangd at index \( index) translated to \( sourceKitLSPIndex) "
58- )
5956 tokenTypeTranslations [ UInt32 ( index) ] = . translation( UInt32 ( sourceKitLSPIndex) )
6057 }
6158 }
@@ -72,12 +69,35 @@ struct SemanticTokensLegendTranslator {
7269 )
7370 tokenModifierTranslations [ UInt32 ( index) ] = . doesNotExistInSourceKitLSP
7471 case let sourceKitLSPIndex? :
75- logger. error (
76- " Token modifier ' \( tokenModifier, privacy: . public) ' from clangd at index \( index) translated to \( sourceKitLSPIndex) "
77- )
7872 tokenModifierTranslations [ UInt32 ( index) ] = . translation( UInt32 ( sourceKitLSPIndex) )
7973 }
8074 }
75+ struct TranslationsLogObject : CustomLogStringConvertible {
76+ let translations : [ UInt32 : Translation ]
77+
78+ var description : String { redactedDescription }
79+
80+ var redactedDescription : String {
81+ translations. sorted { $0. key < $1. key } . map { entry in
82+ switch entry. value {
83+ case . translation( let translation) :
84+ return " \( entry. key) : \( translation) "
85+ case . doesNotExistInSourceKitLSP:
86+ return " \( entry. key) : does not exist "
87+ }
88+ } . joined ( separator: " \n " )
89+ }
90+ }
91+ logger. logFullObjectInMultipleLogMessages (
92+ level: . info,
93+ header: " clangd token type translations " ,
94+ TranslationsLogObject ( translations: tokenTypeTranslations)
95+ )
96+ logger. logFullObjectInMultipleLogMessages (
97+ level: . info,
98+ header: " clangd token modifier translations " ,
99+ TranslationsLogObject ( translations: tokenModifierTranslations)
100+ )
81101 self . tokenModifierTranslations = tokenModifierTranslations
82102
83103 var tokenModifierTranslationBitmask : UInt32 = 0
0 commit comments