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 1
1
use std:: {
2
2
collections:: { HashMap , HashSet } ,
3
+ env,
3
4
path:: { Path , PathBuf } ,
4
5
} ;
5
6
@@ -106,9 +107,20 @@ impl WorkspaceProtoConfigs {
106
107
107
108
pub fn no_workspace_mode ( & mut self ) {
108
109
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) {
110
122
Err ( err) => {
111
- tracing:: error!( ?err, "failed to convert path: '/' to Url" ) ;
123
+ tracing:: error!( ?err, "failed to convert path: {rp} to Url" ) ;
112
124
return ;
113
125
}
114
126
Ok ( uri) => uri,
You can’t perform that action at this time.
0 commit comments