Skip to content

Commit

Permalink
refactor!: remove util.path.is_absolute
Browse files Browse the repository at this point in the history
Work on #2079.
  • Loading branch information
dundargoc committed Dec 14, 2024
1 parent 3da1815 commit c502e4d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
11 changes: 0 additions & 11 deletions lua/lspconfig/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,6 @@ M.path = (function()
end
end

--- @param filename string
--- @return boolean
local function is_absolute(filename)
if iswin then
return filename:match '^%a:' or filename:match '^\\\\'
else
return filename:match '^/'
end
end

local function path_join(...)
return table.concat(M.tbl_flatten { ... }, '/')
end
Expand Down Expand Up @@ -175,7 +165,6 @@ M.path = (function()
local path_separator = iswin and ';' or ':'

return {
is_absolute = is_absolute,
join = path_join,
traverse_parents = traverse_parents,
iterate_parents = iterate_parents,
Expand Down
13 changes: 0 additions & 13 deletions test/lspconfig_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@ describe('lspconfig', function()

describe('util', function()
describe('path', function()
describe('is_absolute', function()
it('is absolute', function()
local lspconfig = require 'lspconfig'
eq(true, lspconfig.util.path.is_absolute '/foo/bar' ~= nil)
end)

it('is not absolute', function()
local lspconfig = require 'lspconfig'
assert.is_nil(lspconfig.util.path.is_absolute 'foo/bar')
assert.is_nil(lspconfig.util.path.is_absolute '../foo/bar')
end)
end)

describe('join', function()
it('', function()
local lspconfig = require 'lspconfig'
Expand Down

0 comments on commit c502e4d

Please sign in to comment.