summaryrefslogtreecommitdiff
path: root/support/texlab/src/features
diff options
context:
space:
mode:
Diffstat (limited to 'support/texlab/src/features')
-rw-r--r--support/texlab/src/features/build.rs20
-rw-r--r--support/texlab/src/features/folding.rs4
-rw-r--r--support/texlab/src/features/formatting.rs2
-rw-r--r--support/texlab/src/features/reference/entry.rs5
-rw-r--r--support/texlab/src/features/rename/entry.rs2
5 files changed, 22 insertions, 11 deletions
diff --git a/support/texlab/src/features/build.rs b/support/texlab/src/features/build.rs
index 645f1e8e0e..69c3a7825c 100644
--- a/support/texlab/src/features/build.rs
+++ b/support/texlab/src/features/build.rs
@@ -104,12 +104,17 @@ impl Command {
.stdin(Stdio::null())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
- .current_dir(self.working_dir)
+ .current_dir(&self.working_dir)
.spawn()
{
Ok(process) => process,
- Err(_) => {
- log::error!("Failed to spawn process: {:?}", self.executable);
+ Err(why) => {
+ log::error!(
+ "Failed to spawn process {:?} in directory {}: {}",
+ self.executable,
+ self.working_dir.display(),
+ why
+ );
return BuildStatus::FAILURE;
}
};
@@ -127,7 +132,7 @@ impl Command {
.recv(&line_receiver, |line| match line {
Ok(message) => {
let params = LogMessageParams { message, typ };
- client.send_notification::<LogMessage>(params).unwrap();
+ let _ = client.send_notification::<LogMessage>(params);
false
}
Err(_) => true,
@@ -170,9 +175,10 @@ fn track_output(
);
thread::spawn(move || {
- for line in reader.lines() {
- sender.send(line.unwrap()).unwrap();
- }
+ let _ = reader
+ .lines()
+ .flatten()
+ .try_for_each(|line| sender.send(line));
})
}
diff --git a/support/texlab/src/features/folding.rs b/support/texlab/src/features/folding.rs
index ea26121f3f..153b839f57 100644
--- a/support/texlab/src/features/folding.rs
+++ b/support/texlab/src/features/folding.rs
@@ -43,7 +43,9 @@ pub fn find_all(db: &dyn Db, uri: &Url) -> Option<Vec<FoldingRange>> {
.map(|node| create_range(line_index.line_col_lsp_range(node.text_range())))
.collect()
}
- DocumentData::Log(_) => return None,
+ DocumentData::Log(_) | DocumentData::TexlabRoot(_) | DocumentData::Tectonic(_) => {
+ return None;
+ }
};
Some(foldings)
diff --git a/support/texlab/src/features/formatting.rs b/support/texlab/src/features/formatting.rs
index 66375bd576..09737777fd 100644
--- a/support/texlab/src/features/formatting.rs
+++ b/support/texlab/src/features/formatting.rs
@@ -26,6 +26,6 @@ pub fn format_source_code(
BibtexFormatter::Texlab => format_bibtex_internal(db, document, options),
BibtexFormatter::Latexindent => format_with_latexindent(db, document),
},
- Language::Log => None,
+ Language::Log | Language::TexlabRoot | Language::Tectonic => None,
}
}
diff --git a/support/texlab/src/features/reference/entry.rs b/support/texlab/src/features/reference/entry.rs
index 3dfa10da5b..0c8f374cb7 100644
--- a/support/texlab/src/features/reference/entry.rs
+++ b/support/texlab/src/features/reference/entry.rs
@@ -47,7 +47,10 @@ pub(super) fn find_all_references(
results.push(ReferenceResult { document, range });
});
}
- DocumentData::Bib(_) | DocumentData::Log(_) => {}
+ DocumentData::Bib(_)
+ | DocumentData::Log(_)
+ | DocumentData::TexlabRoot(_)
+ | DocumentData::Tectonic(_) => {}
};
}
diff --git a/support/texlab/src/features/rename/entry.rs b/support/texlab/src/features/rename/entry.rs
index 79ee25ac71..67c0388f4f 100644
--- a/support/texlab/src/features/rename/entry.rs
+++ b/support/texlab/src/features/rename/entry.rs
@@ -58,7 +58,7 @@ pub(super) fn rename(context: &CursorContext<Params>) -> Option<RenameResult> {
.collect();
changes.insert(document, edits);
}
- DocumentData::Log(_) => {}
+ DocumentData::Log(_) | DocumentData::TexlabRoot(_) | DocumentData::Tectonic(_) => {}
}
}