@@ -170,6 +170,50 @@ export async function activate(): Promise<void> {
170
170
}
171
171
}
172
172
173
+ if ( new CppSettings ( ( vscode . workspace . workspaceFolders && vscode . workspace . workspaceFolders . length > 0 ) ? vscode . workspace . workspaceFolders [ 0 ] ?. uri : undefined ) . intelliSenseEngine === "Disabled" ) {
174
+ throw new Error ( intelliSenseDisabledError ) ;
175
+ } else {
176
+ console . log ( "activating extension" ) ;
177
+ sendActivationTelemetry ( ) ;
178
+ const checkForConflictingExtensions : PersistentState < boolean > = new PersistentState < boolean > ( "CPP." + util . packageJson . version + ".checkForConflictingExtensions" , true ) ;
179
+ if ( checkForConflictingExtensions . Value ) {
180
+ checkForConflictingExtensions . Value = false ;
181
+ const clangCommandAdapterActive : boolean = vscode . extensions . all . some ( ( extension : vscode . Extension < any > , index : number , array : Readonly < vscode . Extension < any > [ ] > ) : boolean =>
182
+ extension . isActive && extension . id === "mitaki28.vscode-clang" ) ;
183
+ if ( clangCommandAdapterActive ) {
184
+ telemetry . logLanguageServerEvent ( "conflictingExtension" ) ;
185
+ }
186
+ }
187
+ }
188
+
189
+ console . log ( "starting language server" ) ;
190
+ clients = new ClientCollection ( ) ;
191
+ ui = getUI ( ) ;
192
+
193
+ // There may have already been registered CustomConfigurationProviders.
194
+ // Request for configurations from those providers.
195
+ clients . forEach ( client => {
196
+ getCustomConfigProviders ( ) . forEach ( provider => client . onRegisterCustomConfigurationProvider ( provider ) ) ;
197
+ } ) ;
198
+
199
+ disposables . push ( vscode . workspace . onDidChangeConfiguration ( onDidChangeSettings ) ) ;
200
+ disposables . push ( vscode . window . onDidChangeActiveTextEditor ( onDidChangeActiveTextEditor ) ) ;
201
+ ui . activeDocumentChanged ( ) ; // Handle already active documents (for non-cpp files that we don't register didOpen).
202
+ disposables . push ( vscode . window . onDidChangeTextEditorSelection ( onDidChangeTextEditorSelection ) ) ;
203
+ disposables . push ( vscode . window . onDidChangeVisibleTextEditors ( onDidChangeVisibleTextEditors ) ) ;
204
+
205
+ updateLanguageConfigurations ( ) ;
206
+
207
+ reportMacCrashes ( ) ;
208
+
209
+ vcpkgDbPromise = initVcpkgDatabase ( ) ;
210
+
211
+ clients . ActiveClient . notifyWhenLanguageClientReady ( ( ) => {
212
+ intervalTimer = global . setInterval ( onInterval , 2500 ) ;
213
+ } ) ;
214
+
215
+ registerCommands ( ) ;
216
+
173
217
taskProvider = vscode . tasks . registerTaskProvider ( CppBuildTaskProvider . CppBuildScriptType , cppBuildTaskProvider ) ;
174
218
175
219
vscode . tasks . onDidStartTask ( event => {
@@ -230,55 +274,11 @@ export async function activate(): Promise<void> {
230
274
}
231
275
} ) ;
232
276
233
- if ( new CppSettings ( ( vscode . workspace . workspaceFolders && vscode . workspace . workspaceFolders . length > 0 ) ? vscode . workspace . workspaceFolders [ 0 ] ?. uri : undefined ) . intelliSenseEngine === "Disabled" ) {
234
- throw new Error ( intelliSenseDisabledError ) ;
235
- } else {
236
- console . log ( "activating extension" ) ;
237
- sendActivationTelemetry ( ) ;
238
- const checkForConflictingExtensions : PersistentState < boolean > = new PersistentState < boolean > ( "CPP." + util . packageJson . version + ".checkForConflictingExtensions" , true ) ;
239
- if ( checkForConflictingExtensions . Value ) {
240
- checkForConflictingExtensions . Value = false ;
241
- const clangCommandAdapterActive : boolean = vscode . extensions . all . some ( ( extension : vscode . Extension < any > , index : number , array : Readonly < vscode . Extension < any > [ ] > ) : boolean =>
242
- extension . isActive && extension . id === "mitaki28.vscode-clang" ) ;
243
- if ( clangCommandAdapterActive ) {
244
- telemetry . logLanguageServerEvent ( "conflictingExtension" ) ;
245
- }
246
- }
247
- }
248
-
249
- console . log ( "starting language server" ) ;
250
- clients = new ClientCollection ( ) ;
251
- ui = getUI ( ) ;
252
-
253
277
// Log cold start.
254
278
const activeEditor : vscode . TextEditor | undefined = vscode . window . activeTextEditor ;
255
279
if ( activeEditor ) {
256
280
clients . timeTelemetryCollector . setFirstFile ( activeEditor . document . uri ) ;
257
281
}
258
-
259
- // There may have already been registered CustomConfigurationProviders.
260
- // Request for configurations from those providers.
261
- clients . forEach ( client => {
262
- getCustomConfigProviders ( ) . forEach ( provider => client . onRegisterCustomConfigurationProvider ( provider ) ) ;
263
- } ) ;
264
-
265
- disposables . push ( vscode . workspace . onDidChangeConfiguration ( onDidChangeSettings ) ) ;
266
- disposables . push ( vscode . window . onDidChangeActiveTextEditor ( onDidChangeActiveTextEditor ) ) ;
267
- ui . activeDocumentChanged ( ) ; // Handle already active documents (for non-cpp files that we don't register didOpen).
268
- disposables . push ( vscode . window . onDidChangeTextEditorSelection ( onDidChangeTextEditorSelection ) ) ;
269
- disposables . push ( vscode . window . onDidChangeVisibleTextEditors ( onDidChangeVisibleTextEditors ) ) ;
270
-
271
- updateLanguageConfigurations ( ) ;
272
-
273
- reportMacCrashes ( ) ;
274
-
275
- vcpkgDbPromise = initVcpkgDatabase ( ) ;
276
-
277
- clients . ActiveClient . notifyWhenLanguageClientReady ( ( ) => {
278
- intervalTimer = global . setInterval ( onInterval , 2500 ) ;
279
- } ) ;
280
-
281
- registerCommands ( ) ;
282
282
}
283
283
284
284
export function updateLanguageConfigurations ( ) : void {
0 commit comments