(file, languageSignature, warnKey)
| 1382 | } |
| 1383 | |
| 1384 | function resolveLanguageExtension(file, languageSignature, warnKey) { |
| 1385 | const langExtFn = file.currentLanguageExtension; |
| 1386 | if (typeof langExtFn !== "function") { |
| 1387 | markLanguageReady(file, languageSignature, true); |
| 1388 | return []; |
| 1389 | } |
| 1390 | |
| 1391 | let result; |
| 1392 | try { |
| 1393 | result = langExtFn(); |
| 1394 | } catch (_) { |
| 1395 | markLanguageReady(file, languageSignature, true); |
| 1396 | return []; |
| 1397 | } |
| 1398 | |
| 1399 | if (result && typeof result.then === "function") { |
| 1400 | const fileId = file.id; |
| 1401 | markLanguageReady(file, languageSignature, false); |
| 1402 | result |
| 1403 | .then((ext) => { |
| 1404 | if ( |
| 1405 | manager.activeFile?.id !== fileId || |
| 1406 | file.__cmLanguageSignature !== languageSignature |
| 1407 | ) { |
| 1408 | return; |
| 1409 | } |
| 1410 | dispatchLanguageExtension(file, languageSignature, ext, warnKey); |
| 1411 | }) |
| 1412 | .catch(() => { |
| 1413 | markLanguageReady(file, languageSignature, true); |
| 1414 | }); |
| 1415 | return []; |
| 1416 | } |
| 1417 | |
| 1418 | markLanguageReady(file, languageSignature, true); |
| 1419 | return result || []; |
| 1420 | } |
| 1421 | |
| 1422 | function scheduleLspForFile(file) { |
| 1423 | const fileId = file?.id; |
no test coverage detected