Latest config changes
This commit is contained in:
parent
846e47b931
commit
a3c3abdf89
12 changed files with 110 additions and 10 deletions
25
lua/workspace.lua
Normal file
25
lua/workspace.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
local util = require('lspconfig.util')
|
||||
|
||||
local join = util.path.join
|
||||
|
||||
local M = {}
|
||||
|
||||
local env = {
|
||||
HOME = vim.loop.os_homedir(),
|
||||
XDG_CACHE_HOME = os.getenv('XDG_CACHE_HOME'),
|
||||
}
|
||||
|
||||
---Returns the default workspace directory
|
||||
---@return string
|
||||
function M.get_default_workspace()
|
||||
local cache_dir = env.XDG_CACHE_HOME and env.XDG_CACHE_HOME
|
||||
or join(env.HOME, '.cache')
|
||||
local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ':p:h:t')
|
||||
|
||||
local path =
|
||||
join(cache_dir, 'jdtls', 'workspaces', project_name)
|
||||
|
||||
return path
|
||||
end
|
||||
|
||||
return M
|
||||
Loading…
Add table
Add a link
Reference in a new issue