@@ -53,9 +53,6 @@ struct SemanticTokensLegendTranslator {
53
53
logger. error ( " Token type ' \( tokenType, privacy: . public) ' from clangd does not exist in SourceKit-LSP's legend " )
54
54
tokenTypeTranslations [ UInt32 ( index) ] = . doesNotExistInSourceKitLSP
55
55
case let sourceKitLSPIndex? :
56
- logger. info (
57
- " Token type ' \( tokenType, privacy: . public) ' from clangd at index \( index) translated to \( sourceKitLSPIndex) "
58
- )
59
56
tokenTypeTranslations [ UInt32 ( index) ] = . translation( UInt32 ( sourceKitLSPIndex) )
60
57
}
61
58
}
@@ -72,12 +69,35 @@ struct SemanticTokensLegendTranslator {
72
69
)
73
70
tokenModifierTranslations [ UInt32 ( index) ] = . doesNotExistInSourceKitLSP
74
71
case let sourceKitLSPIndex? :
75
- logger. error (
76
- " Token modifier ' \( tokenModifier, privacy: . public) ' from clangd at index \( index) translated to \( sourceKitLSPIndex) "
77
- )
78
72
tokenModifierTranslations [ UInt32 ( index) ] = . translation( UInt32 ( sourceKitLSPIndex) )
79
73
}
80
74
}
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
+ )
81
101
self . tokenModifierTranslations = tokenModifierTranslations
82
102
83
103
var tokenModifierTranslationBitmask : UInt32 = 0
0 commit comments