aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/filetype
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2025-01-24 13:01:25 +0000
committerLewis Russell <me@lewisr.dev>2025-01-27 16:37:50 +0000
commit6aa42e8f92bd8bea49b7b2accfe4ab67a5344e41 (patch)
tree5695108458a60f19e56834e9889ea58fc9c8c32d /runtime/lua/vim/filetype
parent83479b95abae84b4b2b4a0331503298ddc5ff47b (diff)
downloadrneovim-6aa42e8f92bd8bea49b7b2accfe4ab67a5344e41.tar.gz
rneovim-6aa42e8f92bd8bea49b7b2accfe4ab67a5344e41.tar.bz2
rneovim-6aa42e8f92bd8bea49b7b2accfe4ab67a5344e41.zip
fix: resolve all remaining LuaLS diagnostics
Diffstat (limited to 'runtime/lua/vim/filetype')
-rw-r--r--runtime/lua/vim/filetype/detect.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua
index 8f66418733..91c0406dc0 100644
--- a/runtime/lua/vim/filetype/detect.lua
+++ b/runtime/lua/vim/filetype/detect.lua
@@ -881,7 +881,7 @@ end
--- (refactor of filetype.vim since the patterns are case-insensitive)
--- @type vim.filetype.mapfn
function M.log(path, _)
- path = path:lower()
+ path = path:lower() --- @type string LuaLS bug
if
findany(
path,
@@ -1167,7 +1167,7 @@ end
--- @type vim.filetype.mapfn
function M.perl(path, bufnr)
local dir_name = vim.fs.dirname(path)
- if fn.expand(path, '%:e') == 't' and (dir_name == 't' or dir_name == 'xt') then
+ if fn.fnamemodify(path, '%:e') == 't' and (dir_name == 't' or dir_name == 'xt') then
return 'perl'
end
local first_line = getline(bufnr, 1)
@@ -1375,7 +1375,7 @@ end
local udev_rules_pattern = '^%s*udev_rules%s*=%s*"([%^"]+)/*".*'
--- @type vim.filetype.mapfn
function M.rules(path)
- path = path:lower()
+ path = path:lower() --- @type string LuaLS bug
if
findany(path, {
'/etc/udev/.*%.rules$',
@@ -1398,7 +1398,7 @@ function M.rules(path)
if not ok then
return 'hog'
end
- local dir = fn.expand(path, ':h')
+ local dir = fn.fnamemodify(path, ':h')
for _, line in ipairs(config_lines) do
local match = line:match(udev_rules_pattern)
if match then