nu-cli/completions: completion for use and source (#5210)

* nu-cli/completions: completion for use and source

* handle subfolders for different base dirs

* fix clippy errors
This commit is contained in:
Herlon Aguiar
2022-04-18 14:59:13 +02:00
committed by GitHub
parent 1314a87cb0
commit dd1d9b7623
6 changed files with 177 additions and 17 deletions

View File

@ -12,6 +12,7 @@ pub use flatten::{flatten_block, flatten_expression, flatten_pipeline, FlatShape
pub use known_external::KnownExternal;
pub use lex::{lex, Token, TokenContents};
pub use lite_parse::{lite_parse, LiteBlock};
pub use parse_keywords::*;
pub use parser::{
is_math_expression_like, parse, parse_block, parse_duration_bytes, parse_external_call,

View File

@ -1359,7 +1359,11 @@ pub fn parse_use(
}
} else {
error = error.or(Some(ParseError::ModuleNotFound(import_pattern.head.span)));
(ImportPattern::new(), Overlay::new())
let mut import_pattern = ImportPattern::new();
import_pattern.head.span = spans[1];
(import_pattern, Overlay::new())
}
} else {
return (garbage_pipeline(spans), Some(ParseError::NonUtf8(spans[1])));