File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 365
365
#![ feature( ptr_metadata) ]
366
366
#![ feature( thread_local) ]
367
367
#![ feature( array_from_fn) ]
368
- #![ feature( io_error_more) ]
369
368
// Plugins
370
369
#![ cfg_attr( feature = "gazebo_lint" , feature( plugin) ) ]
371
370
#![ cfg_attr( feature = "gazebo_lint" , allow( deprecated) ) ] // :(
Original file line number Diff line number Diff line change @@ -109,6 +109,8 @@ pub(crate) enum TestServerError {
109
109
/// The provided Url was not absolute and it needs to be.
110
110
#[ error( "Path for URL `{}` was not absolute" , . 0 ) ]
111
111
NotAbsolute ( LspUrl ) ,
112
+ #[ error( "Path is directory: `{0}`" ) ]
113
+ IsADirectory ( LspUrl ) ,
112
114
}
113
115
114
116
struct TestServerContext {
@@ -207,9 +209,7 @@ impl LspContext for TestServerContext {
207
209
let is_dir = self . dirs . read ( ) . unwrap ( ) . contains ( & path) ;
208
210
match ( path. is_absolute ( ) , is_dir) {
209
211
( true , false ) => Ok ( self . file_contents . read ( ) . unwrap ( ) . get ( & path) . cloned ( ) ) ,
210
- ( true , true ) => {
211
- Err ( std:: io:: Error :: from ( std:: io:: ErrorKind :: IsADirectory ) . into ( ) )
212
- }
212
+ ( true , true ) => Err ( TestServerError :: IsADirectory ( uri. clone ( ) ) . into ( ) ) ,
213
213
( false , _) => Err ( TestServerError :: NotAbsolute ( uri. clone ( ) ) . into ( ) ) ,
214
214
}
215
215
}
You can’t perform that action at this time.
0 commit comments