mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 17:36:19 +04:00
cargo fmt + clippy lint
This commit is contained in:
parent
7c9ebd05b8
commit
4080341977
@ -436,7 +436,7 @@ pub fn new(source: &Rope, config: Arc<HighlightConfiguration>, loader: Arc<Loade
|
|||||||
};
|
};
|
||||||
|
|
||||||
syntax
|
syntax
|
||||||
.update(source, source, &ChangeSet::new(&source))
|
.update(source, source, &ChangeSet::new(source))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
syntax
|
syntax
|
||||||
@ -735,9 +735,7 @@ pub fn highlight_iter<'a>(
|
|||||||
.peekable();
|
.peekable();
|
||||||
|
|
||||||
// If there's no captures, skip the layer
|
// If there's no captures, skip the layer
|
||||||
if captures.peek().is_none() {
|
captures.peek()?;
|
||||||
return None;
|
|
||||||
}
|
|
||||||
|
|
||||||
Some(HighlightIterLayer {
|
Some(HighlightIterLayer {
|
||||||
highlight_end_stack: Vec::new(),
|
highlight_end_stack: Vec::new(),
|
||||||
|
@ -594,11 +594,7 @@ pub fn set_language(
|
|||||||
|
|
||||||
/// Set the programming language for the file if you know the name (scope) but don't have the
|
/// Set the programming language for the file if you know the name (scope) but don't have the
|
||||||
/// [`syntax::LanguageConfiguration`] for it.
|
/// [`syntax::LanguageConfiguration`] for it.
|
||||||
pub fn set_language2(
|
pub fn set_language2(&mut self, scope: &str, config_loader: Arc<syntax::Loader>) {
|
||||||
&mut self,
|
|
||||||
scope: &str,
|
|
||||||
config_loader: Arc<syntax::Loader>,
|
|
||||||
) {
|
|
||||||
let language_config = config_loader.language_config_for_scope(scope);
|
let language_config = config_loader.language_config_for_scope(scope);
|
||||||
|
|
||||||
self.set_language(language_config, Some(config_loader));
|
self.set_language(language_config, Some(config_loader));
|
||||||
|
@ -456,11 +456,7 @@ pub fn open(&mut self, path: PathBuf, action: Action) -> Result<DocumentId, Erro
|
|||||||
let id = if let Some(id) = id {
|
let id = if let Some(id) = id {
|
||||||
id
|
id
|
||||||
} else {
|
} else {
|
||||||
let mut doc = Document::open(
|
let mut doc = Document::open(&path, None, Some(self.syn_loader.clone()))?;
|
||||||
&path,
|
|
||||||
None,
|
|
||||||
Some(self.syn_loader.clone()),
|
|
||||||
)?;
|
|
||||||
|
|
||||||
let _ = Self::launch_language_server(&mut self.language_servers, &mut doc);
|
let _ = Self::launch_language_server(&mut self.language_servers, &mut doc);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user