MCPcopy Index your code
hub / github.com/REditorSupport/vscode-R / waitForFileToFinish

Function waitForFileToFinish

src/preview.ts:99–120  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

97}
98
99async function waitForFileToFinish(filePath: string): Promise<boolean | undefined> {
100 const fileBusy = true;
101 let currentSize = 0;
102 let previousSize = 1;
103
104 while (fileBusy) {
105 const stats = statSync(filePath);
106 currentSize = stats.size;
107
108 // UPDATE: We are now limited to 20 mb by MODEL_TOKENIZATION_LIMIT
109 // Https://github.com/Microsoft/vscode/blob/master/src/vs/editor/common/model/textModel.ts#L34
110 if (currentSize > 2 * 10000000) { // 20 MB
111 return false;
112 }
113
114 if (currentSize === previousSize) {
115 return true;
116 }
117 previousSize = currentSize;
118 await delay(50);
119 }
120}
121
122function checkcsv(): boolean {
123 const iscsv = extensions.getExtension('GrapeCity.gc-excelviewer');

Callers 1

openTmpCSVFunction · 0.85

Calls 1

delayFunction · 0.90

Tested by

no test coverage detected