MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / activate

Function activate

src/test/helpers.ts:292–311  ·  view source on GitHub ↗
(file?: vs.Uri | null)

Source from the content-addressed store, hash-verified

290}
291
292export async function activate(file?: vs.Uri | null): Promise<void> {
293 await activateWithoutAnalysis(file);
294
295 logger.info(`Waiting for initial analysis`);
296 await privateApi.initialAnalysis;
297 // Opening a file above may start analysis after a short period so give it time to start
298 // before we continue.
299 await delay(50);
300 logger.info(`Waiting for in-progress analysis`);
301 await privateApi.currentAnalysis();
302
303 logger.info(`Ready to start test`);
304 const cpuLoad = os.loadavg();
305 const totalMem = os.totalmem();
306 const freeMem = os.freemem();
307 logger.info(` cpuLoad: ${cpuLoad}`);
308 logger.info(` totalMem: ${totalMem}`);
309 logger.info(` freeMem: ${freeMem}`);
310 logger.info(` ${Math.round((freeMem / totalMem) * 100)}% memory is available`);
311}
312
313export async function getPackages(uri?: vs.Uri) {
314 await activateWithoutAnalysis(null);

Calls 3

activateWithoutAnalysisFunction · 0.85
delayFunction · 0.85
infoMethod · 0.65

Tested by

no test coverage detected