MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / shouldApplyLanguage

Function shouldApplyLanguage

src/lib/editorManager.js:1355–1365  ·  view source on GitHub ↗
(file, state, languageSignature)

Source from the content-addressed store, hash-verified

1353 }
1354
1355 function shouldApplyLanguage(file, state, languageSignature) {
1356 const langExtFn = file?.currentLanguageExtension;
1357 if (typeof langExtFn !== "function") return false;
1358 const isPlainText =
1359 String(file?.currentMode || "").toLowerCase() === "text";
1360 return (
1361 file.__cmLanguageSignature !== languageSignature ||
1362 !file.__cmLanguageReady ||
1363 (!isPlainText && !hasLanguageSupport(state))
1364 );
1365 }
1366
1367 function markLanguageReady(file, languageSignature, ready) {
1368 file.__cmLanguageSignature = languageSignature;

Callers 1

applyFileToEditorFunction · 0.85

Calls 2

StringInterface · 0.85
hasLanguageSupportFunction · 0.85

Tested by

no test coverage detected