Simplify inferParser (#14438)
This commit is contained in:
1 parent
c79b3eec5e
commit
a6dcfe9076
1 file changed
+1
-2
@@ -1,10 +1,9 @@
|
||||
import path from "node:path";
|
||||
import { getSupportInfo } from "../main/support.js";
|
||||
import getInterpreter from "../utils/get-interpreter.js";
|
||||
|
||||
function inferParser(filepath, plugins) {
|
||||
const filename = path.basename(filepath).toLowerCase();
|
||||
const { languages } = getSupportInfo({ plugins });
|
||||
const languages = plugins.flatMap((plugin) => plugin.languages ?? []);
|
||||
|
||||
// If the file has no extension, we can try to infer the language from the
|
||||
// interpreter in the shebang line, if any; but since this requires FS access,
|
||||
|
||||
Reference in new issue
Block a user