From 2c7249e4df23ccb37ea1dbd549b2b401c03b1ea0 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sat, 11 Jan 2020 13:27:06 +0000 Subject: [PATCH] mpy added as an indexable file extension --- lib/indexer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/indexer.php b/lib/indexer.php index d3056f3..1d83bbb 100644 --- a/lib/indexer.php +++ b/lib/indexer.php @@ -3,7 +3,7 @@ include("headers.php"); include("settings.php"); // File extensions to look for functions & classes in -$indexableFileExts = ["php", "js", "coffee", "ts", "rb", "py", "sql", "erl", "java", "jl", "c", "cpp", "ino", "cs", "go", "lua", "pl"]; +$indexableFileExts = ["php", "js", "coffee", "ts", "rb", "py", "mpy", "sql", "erl", "java", "jl", "c", "cpp", "ino", "cs", "go", "lua", "pl"]; // Fallback for prevIndexData to start off initially $prevIndexData = []; @@ -89,7 +89,7 @@ function phpGrep($path, $base) { // If we have both parens in ( then ) order on the line and... (strpos($line, "(") !== false && strpos($line, "(") < strpos($line, ")")) && // ...if a particular language and we have a valid format on the same line for it - (($filePathExt === "py" || $filePathExt === "rb") && strpos($line, "def") !== false && strpos($line, "def") < strpos($line, "(")) || + (($filePathExt === "py" || $filePathExt === "mpy" || $filePathExt === "rb") && strpos($line, "def") !== false && strpos($line, "def") < strpos($line, "(")) || (($filePathExt === "js" || $filePathExt === "ts") && strpos($line, "=>") !== false) || (($filePathExt === "erl" || $filePathExt === "coffee") && strpos($line, "->") !== false) || (($filePathExt === "c" || $filePathExt === "cpp") && strpos($line, "{") !== false && strpos($line, "{") > strpos($line, "(")) ||