File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 11use std:: {
22 collections:: { HashMap , HashSet } ,
3+ env,
34 path:: { Path , PathBuf } ,
45} ;
56
@@ -106,9 +107,20 @@ impl WorkspaceProtoConfigs {
106107
107108 pub fn no_workspace_mode ( & mut self ) {
108109 let wr = ProtolsConfig :: default ( ) ;
109- let uri = match Url :: from_file_path ( "/" ) {
110+ let rp = if cfg ! ( target_os = "windows" ) {
111+ let mut d = String :: from ( "C" ) ;
112+ if let Ok ( cdir) = env:: current_dir ( ) {
113+ if let Some ( drive) = cdir. components ( ) . next ( ) {
114+ d = drive. as_os_str ( ) . to_string_lossy ( ) . to_string ( )
115+ }
116+ }
117+ format ! ( "{d}://" )
118+ } else {
119+ String :: from ( "/" )
120+ } ;
121+ let uri = match Url :: from_file_path ( & rp) {
110122 Err ( err) => {
111- tracing:: error!( ?err, "failed to convert path: '/' to Url" ) ;
123+ tracing:: error!( ?err, "failed to convert path: {rp} to Url" ) ;
112124 return ;
113125 }
114126 Ok ( uri) => uri,
You can’t perform that action at this time.
0 commit comments