File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change 11local compat = require (' rustaceanvim.compat' )
22local rust_analyzer = require (' rustaceanvim.rust_analyzer' )
3+ local os = require (' rustaceanvim.os' )
34local joinpath = compat .joinpath
45
56local cargo = {}
@@ -17,6 +18,7 @@ local function get_mb_active_client_root(file_name)
1718 local toolchains = joinpath (rustup_home , ' toolchains' )
1819
1920 for _ , item in ipairs { toolchains , registry } do
21+ item = os .normalize_path_on_windows (item )
2022 if file_name :sub (1 , # item ) == item then
2123 local clients = rust_analyzer .get_active_rustaceanvim_clients ()
2224 return clients and # clients > 0 and clients [# clients ].config .root_dir or nil
Original file line number Diff line number Diff line change 4545--- @return string normalized_path
4646function os .normalize_path_on_windows (path )
4747 if shell .is_windows () and starts_with_windows_drive_letter (path ) then
48- return path :sub (1 , 1 ):lower () .. path :sub (2 )
48+ return path :sub (1 , 1 ):lower () .. path :sub (2 ): gsub ( ' /+ ' , ' \\ ' )
4949 end
5050 return path
5151end
You can’t perform that action at this time.
0 commit comments