File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ local M = {}
77--- Returns the workspace directory path based on the current dir
88--- @return string
99function M .get_workspace_path ()
10- local project_path =
11- string.gsub (vim . fn . fnamemodify ( vim . fn . getcwd () , ' :p:h ' ), ' / ' , ' _' )
10+ local project_path = vim . fn . fnamemodify ( vim . fn . getcwd (), ' :p:h ' )
11+ local project_path_hash = string.gsub (project_path , ' [/ \\ :+-] ' , ' _' )
1212
1313 local nvim_cache_path = vim .fn .stdpath (' cache' )
14- return join (nvim_cache_path , ' jdtls' , ' workspaces' , project_path )
14+ return join (nvim_cache_path , ' jdtls' , ' workspaces' , project_path_hash )
1515end
1616
1717--- Returns the jdtls config cache directory
Original file line number Diff line number Diff line change 11local M = {}
22
3+ if vim .fn .has (' win32' ) == 1 or vim .fn .has (' win32unix' ) == 1 then
4+ M .path_separator = ' \\ '
5+ else
6+ M .path_separator = ' /'
7+ end
8+
39--- Join a given list of paths to one path
410--- @param ... string paths to join
511--- @return string # joined path
612function M .join (...)
7- return table.concat ({ ... }, ' / ' )
13+ return table.concat ({ ... }, M . path_separator )
814end
915
1016return M
You can’t perform that action at this time.
0 commit comments