fix(repo-map): do not report errors when encountering unsupported languages (#652)

This commit is contained in:
yetone
2024-09-27 02:19:01 +08:00
committed by GitHub
parent 131d800c16
commit 302f207951
2 changed files with 42 additions and 13 deletions

View File

@@ -53,6 +53,14 @@ end
local cache = {}
function RepoMap.get_repo_map(file_ext)
local repo_map = RepoMap._get_repo_map(file_ext) or {}
if not repo_map or next(repo_map) == nil then
Utils.warn("The repo map is empty. Maybe do not support this language: " .. file_ext)
end
return repo_map
end
function RepoMap._get_repo_map(file_ext)
file_ext = file_ext or vim.fn.expand("%:e")
local project_root = Utils.root.get()
local cache_key = project_root .. "." .. file_ext