@@ -79,6 +79,31 @@ class SemanticSymbol {
79
79
function getClientConfig ( context : ExtensionContext ) {
80
80
const kCacheDirPrefName = 'cacheDirectory' ;
81
81
82
+ function hasAnySemanticHighlighting ( ) {
83
+ let options = [
84
+ 'cquery.highlighting.enabled.types' ,
85
+ 'cquery.highlighting.enabled.freeStandingFunctions' ,
86
+ 'cquery.highlighting.enabled.memberFunctions' ,
87
+ 'cquery.highlighting.enabled.freeStandingVariables' ,
88
+ 'cquery.highlighting.enabled.memberVariables' ,
89
+ 'cquery.highlighting.enabled.namespaces' ,
90
+ 'cquery.highlighting.enabled.macros' ,
91
+ 'cquery.highlighting.enabled.enums' ,
92
+ 'cquery.highlighting.enabled.typeAliases' ,
93
+ 'cquery.highlighting.enabled.enumConstants' ,
94
+ 'cquery.highlighting.enabled.staticMemberFunctions' ,
95
+ 'cquery.highlighting.enabled.parameters' ,
96
+ 'cquery.highlighting.enabled.templateParameters' ,
97
+ 'cquery.highlighting.enabled.staticMemberVariables' ,
98
+ 'cquery.highlighting.enabled.globalVariables' ] ;
99
+ let config = workspace . getConfiguration ( ) ;
100
+ for ( let name of options ) {
101
+ if ( config . get ( name , false ) )
102
+ return true ;
103
+ }
104
+ return false ;
105
+ }
106
+
82
107
// Read prefs; this map goes from `cquery/js name` => `vscode prefs name`.
83
108
let configMapping = [
84
109
[ 'launchCommand' , 'launch.command' ] ,
@@ -105,10 +130,14 @@ function getClientConfig(context: ExtensionContext) {
105
130
[ 'diagnostics.onParse' , 'diagnostics.onParse' ] ,
106
131
[ 'diagnostics.onType' , 'diagnostics.onType' ] ,
107
132
[ 'codeLens.localVariables' , 'codeLens.onLocalVariables' ] ,
133
+ [ 'emitInactiveRegions' , 'misc.showInactiveRegions' ] ,
108
134
] ;
109
135
let clientConfig = {
110
136
launchCommand : '' ,
111
137
cacheDirectory : '' ,
138
+ highlight : {
139
+ enabled : hasAnySemanticHighlighting ( )
140
+ } ,
112
141
workspaceSymbol : {
113
142
sort : false ,
114
143
}
0 commit comments