diff options
Diffstat (limited to 'support')
-rw-r--r-- | support/texlab/CHANGELOG.md | 12 | ||||
-rw-r--r-- | support/texlab/Cargo.lock | 2 | ||||
-rw-r--r-- | support/texlab/crates/base-db/src/config.rs | 2 | ||||
-rw-r--r-- | support/texlab/crates/base-db/src/graph.rs | 5 | ||||
-rw-r--r-- | support/texlab/crates/commands/src/clean.rs | 18 | ||||
-rw-r--r-- | support/texlab/crates/commands/src/fwd_search.rs | 2 | ||||
-rw-r--r-- | support/texlab/crates/distro/src/file_name_db.rs | 4 | ||||
-rw-r--r-- | support/texlab/crates/distro/src/lib.rs | 16 | ||||
-rw-r--r-- | support/texlab/crates/texlab/Cargo.toml | 13 | ||||
-rw-r--r-- | support/texlab/crates/texlab/src/server/options.rs | 10 | ||||
-rw-r--r-- | support/texlab/texlab.1 | 4 | ||||
-rw-r--r-- | support/texlab/texlab.pdf | bin | 26416 -> 26643 bytes |
12 files changed, 63 insertions, 25 deletions
diff --git a/support/texlab/CHANGELOG.md b/support/texlab/CHANGELOG.md index a97c7cb44a..0301227cd1 100644 --- a/support/texlab/CHANGELOG.md +++ b/support/texlab/CHANGELOG.md @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [5.9.0] - 2023-08-06 + +### Added + +- Use bibliographies found in `BIBINPUTS` environment variable ([#493](https://github.com/latex-lsp/texlab/issues/493)) +- Add `texlab.build.pdfDirectory` setting ([#911](https://github.com/latex-lsp/texlab/issues/911)) + +### Fixed + +- Fix search path for aux files when using `\include` instead of `\input` ([#906](https://github.com/latex-lsp/texlab/issues/906)) + ## [5.8.0] - 2023-07-30 ### Added @@ -23,7 +34,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix parsing paths with `|` ([#568](https://github.com/latex-lsp/texlab/issues/568)) - Fix parsing LaTeX identifiers with `=` ([#568](https://github.com/latex-lsp/texlab/issues/568)) -- Fix search path for aux files when using `\include` instead of `\input` ([[#906](https://github.com/latex-lsp/texlab/issues/906)) ## [5.7.0] - 2023-06-07 diff --git a/support/texlab/Cargo.lock b/support/texlab/Cargo.lock index 98dff1e35c..f25cc7c01c 100644 --- a/support/texlab/Cargo.lock +++ b/support/texlab/Cargo.lock @@ -1584,7 +1584,7 @@ dependencies = [ [[package]] name = "texlab" -version = "5.8.0" +version = "5.9.0" dependencies = [ "anyhow", "assert_unordered", diff --git a/support/texlab/crates/base-db/src/config.rs b/support/texlab/crates/base-db/src/config.rs index 36063b470c..bffd28b987 100644 --- a/support/texlab/crates/base-db/src/config.rs +++ b/support/texlab/crates/base-db/src/config.rs @@ -24,6 +24,7 @@ pub struct BuildConfig { pub forward_search_after: bool, pub aux_dir: String, pub log_dir: String, + pub pdf_dir: String, pub output_filename: Option<PathBuf>, } @@ -115,6 +116,7 @@ impl Default for BuildConfig { forward_search_after: false, aux_dir: String::from("."), log_dir: String::from("."), + pdf_dir: String::from("."), output_filename: None, } } diff --git a/support/texlab/crates/base-db/src/graph.rs b/support/texlab/crates/base-db/src/graph.rs index 3e718afd48..2dd732a449 100644 --- a/support/texlab/crates/base-db/src/graph.rs +++ b/support/texlab/crates/base-db/src/graph.rs @@ -137,8 +137,13 @@ impl<'a> Graph<'a> { let aux_dir = self.workspace.output_dir(base_dir, config.aux_dir.clone()); let log_dir = self.workspace.output_dir(base_dir, config.log_dir.clone()); + let relative_path = base_dir.make_relative(&source.uri).unwrap(); + + self.add_artifact(source, &aux_dir.join(&relative_path).unwrap(), "aux"); self.add_artifact(source, &aux_dir, "aux"); self.add_artifact(source, base_dir, "aux"); + + self.add_artifact(source, &log_dir.join(&relative_path).unwrap(), "log"); self.add_artifact(source, &log_dir, "log"); self.add_artifact(source, base_dir, "log"); } diff --git a/support/texlab/crates/commands/src/clean.rs b/support/texlab/crates/commands/src/clean.rs index d6c3977fb2..562d9c49b6 100644 --- a/support/texlab/crates/commands/src/clean.rs +++ b/support/texlab/crates/commands/src/clean.rs @@ -21,20 +21,26 @@ impl CleanCommand { anyhow::bail!("document '{}' is not a local file", document.uri) }; - let dir = workspace.current_dir(&document.dir); - let dir = workspace - .output_dir(&dir, workspace.config().build.log_dir.clone()) - .to_file_path() - .unwrap(); + let base_dir = workspace.current_dir(&document.dir); let flag = match target { CleanTarget::Auxiliary => "-c", CleanTarget::Artifacts => "-C", }; + let out_dir = match target { + CleanTarget::Auxiliary => &workspace.config().build.aux_dir, + CleanTarget::Artifacts => &workspace.config().build.pdf_dir, + }; + + let out_dir = workspace + .output_dir(&base_dir, out_dir.clone()) + .to_file_path() + .unwrap(); + let executable = String::from("latexmk"); let args = vec![ - format!("-outdir={}", dir.display()), + format!("-outdir={}", out_dir.display()), String::from(flag), path.display().to_string(), ]; diff --git a/support/texlab/crates/commands/src/fwd_search.rs b/support/texlab/crates/commands/src/fwd_search.rs index 153e1245d5..9004ef9b09 100644 --- a/support/texlab/crates/commands/src/fwd_search.rs +++ b/support/texlab/crates/commands/src/fwd_search.rs @@ -60,7 +60,7 @@ impl ForwardSearch { let dir = workspace.current_dir(&parent.dir); let dir = workspace - .output_dir(&dir, workspace.config().build.log_dir.clone()) + .output_dir(&dir, workspace.config().build.pdf_dir.clone()) .to_file_path() .unwrap(); diff --git a/support/texlab/crates/distro/src/file_name_db.rs b/support/texlab/crates/distro/src/file_name_db.rs index 750ed11e68..06871bde83 100644 --- a/support/texlab/crates/distro/src/file_name_db.rs +++ b/support/texlab/crates/distro/src/file_name_db.rs @@ -47,6 +47,10 @@ pub struct FileNameDB { } impl FileNameDB { + pub(crate) fn insert(&mut self, path: PathBuf) { + self.files.insert(DistroFile(path)); + } + pub fn get(&self, name: &str) -> Option<&Path> { self.files.get(name).map(|file| file.path()) } diff --git a/support/texlab/crates/distro/src/lib.rs b/support/texlab/crates/distro/src/lib.rs index 5ad9a8529c..5c0dbe51fb 100644 --- a/support/texlab/crates/distro/src/lib.rs +++ b/support/texlab/crates/distro/src/lib.rs @@ -58,7 +58,7 @@ impl Distro { } }; - let file_name_db = match kind { + let mut file_name_db = match kind { DistroKind::Texlive => { let root_dirs = kpsewhich::root_directories()?; FileNameDB::parse(&root_dirs, &mut texlive::read_database)? @@ -70,6 +70,20 @@ impl Distro { DistroKind::Tectonic | DistroKind::Unknown => FileNameDB::default(), }; + if let Some(bibinputs) = std::env::var_os("BIBINPUTS") { + for dir in std::env::split_paths(&bibinputs) { + if let Ok(entries) = std::fs::read_dir(dir) { + for file in entries + .flatten() + .filter(|entry| entry.file_type().map_or(false, |ty| ty.is_file())) + .map(|entry| entry.path()) + { + file_name_db.insert(file); + } + } + } + } + Ok(Self { kind, file_name_db }) } } diff --git a/support/texlab/crates/texlab/Cargo.toml b/support/texlab/crates/texlab/Cargo.toml index 9bb0654a8b..65752a4e60 100644 --- a/support/texlab/crates/texlab/Cargo.toml +++ b/support/texlab/crates/texlab/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "texlab" description = "LaTeX Language Server" -version = "5.8.0" +version = "5.9.0" license.workspace = true readme = "README.md" authors.workspace = true @@ -12,16 +12,7 @@ repository = "https://github.com/latex-lsp/texlab" documentation = "https://github.com/latex-lsp/texlab" keywords = ["lsp", "server", "latex", "bibtex"] categories = ["development-tools"] -exclude = [ - ".gitattributes", - ".gitignore", - ".github/**", - "tests/it/**", - "*.snap", - "texlab.1", - "texlab.pdf", - "texlab.tex", -] +exclude = ["tests/it/**", "*.snap"] [[bin]] name = "texlab" diff --git a/support/texlab/crates/texlab/src/server/options.rs b/support/texlab/crates/texlab/src/server/options.rs index ddf20f0a5d..a602e5d792 100644 --- a/support/texlab/crates/texlab/src/server/options.rs +++ b/support/texlab/crates/texlab/src/server/options.rs @@ -71,6 +71,7 @@ pub struct BuildOptions { pub forward_search_after: bool, pub aux_directory: Option<String>, pub log_directory: Option<String>, + pub pdf_directory: Option<String>, pub filename: Option<String>, } @@ -164,12 +165,17 @@ impl From<Options> for Config { .or_else(|| value.aux_directory.clone()) .unwrap_or_else(|| String::from(".")); - config.build.log_dir = value + config.build.pdf_dir = value .build - .log_directory + .pdf_directory .or_else(|| value.aux_directory) .unwrap_or_else(|| String::from(".")); + config.build.log_dir = value + .build + .log_directory + .unwrap_or_else(|| config.build.pdf_dir.clone()); + config.build.output_filename = value.build.filename.map(PathBuf::from); config.diagnostics.allowed_patterns = value diff --git a/support/texlab/texlab.1 b/support/texlab/texlab.1 index 7b58ac6af1..7d5e82cd43 100644 --- a/support/texlab/texlab.1 +++ b/support/texlab/texlab.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH TEXLAB "1" "July 2023" "texlab 5.8.0" "User Commands" +.TH TEXLAB "1" "August 2023" "texlab 5.9.0" "User Commands" .SH NAME -texlab \- manual page for texlab 5.8.0 +texlab \- manual page for texlab 5.9.0 .SH SYNOPSIS .B texlab [\fI\,OPTIONS\/\fR] diff --git a/support/texlab/texlab.pdf b/support/texlab/texlab.pdf Binary files differindex 927983b23e..71e172b73b 100644 --- a/support/texlab/texlab.pdf +++ b/support/texlab/texlab.pdf |