summaryrefslogtreecommitdiff
path: root/support/texlab
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-03-29 03:02:21 +0000
committerNorbert Preining <norbert@preining.info>2024-03-29 03:02:21 +0000
commit23724df30adf3c6356ee7877833b8096987c643f (patch)
treea59cd37590258851deb53c4a5ff957cd12c308a0 /support/texlab
parent79e9e48f9496fe82b7e76b2b318d24e9aab1ca8a (diff)
CTAN sync 202403290302
Diffstat (limited to 'support/texlab')
-rw-r--r--support/texlab/CHANGELOG.md7
-rw-r--r--support/texlab/Cargo.lock2
-rw-r--r--support/texlab/crates/base-db/src/deps/root.rs8
-rw-r--r--support/texlab/crates/parser/src/latex.rs5
-rw-r--r--support/texlab/crates/parser/src/latex/tests.rs24
-rw-r--r--support/texlab/crates/texlab/Cargo.toml2
-rw-r--r--support/texlab/texlab.14
-rw-r--r--support/texlab/texlab.pdfbin26181 -> 26268 bytes
8 files changed, 47 insertions, 5 deletions
diff --git a/support/texlab/CHANGELOG.md b/support/texlab/CHANGELOG.md
index 7d08d3769d..4b3705b115 100644
--- a/support/texlab/CHANGELOG.md
+++ b/support/texlab/CHANGELOG.md
@@ -5,6 +5,13 @@ 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.14.1] - 2024-03-27
+
+### Fixed
+
+- Fix parsing `\label` with options (for example, when using `cleverref`) ([#1056](https://github.com/latex-lsp/texlab/issues/1056))
+- Fix detecting project root if the home directory contains a `.latexmkrc` file ([#1061](https://github.com/latex-lsp/texlab/issues/1061))
+
## [5.14.0] - 2024-03-24
### Added
diff --git a/support/texlab/Cargo.lock b/support/texlab/Cargo.lock
index a13e8bbdb4..5f84112903 100644
--- a/support/texlab/Cargo.lock
+++ b/support/texlab/Cargo.lock
@@ -1483,7 +1483,7 @@ dependencies = [
[[package]]
name = "texlab"
-version = "5.14.0"
+version = "5.14.1"
dependencies = [
"anyhow",
"base-db",
diff --git a/support/texlab/crates/base-db/src/deps/root.rs b/support/texlab/crates/base-db/src/deps/root.rs
index 7e2266e68c..442d6f9e35 100644
--- a/support/texlab/crates/base-db/src/deps/root.rs
+++ b/support/texlab/crates/base-db/src/deps/root.rs
@@ -2,6 +2,8 @@ use url::Url;
use crate::{DocumentData, Workspace};
+use super::graph::HOME_DIR;
+
#[derive(PartialEq, Eq, Clone, Hash)]
pub struct ProjectRoot {
pub compile_dir: Url,
@@ -14,6 +16,10 @@ pub struct ProjectRoot {
impl ProjectRoot {
pub fn walk_and_find(workspace: &Workspace, dir: &Url) -> Self {
+ let home_dir = HOME_DIR
+ .as_deref()
+ .and_then(|path| Url::from_directory_path(path).ok());
+
let mut current = dir.clone();
loop {
let root = Self::from_rootfile(workspace, &current)
@@ -28,7 +34,7 @@ impl ProjectRoot {
break Self::from_config(workspace, &dir);
};
- if current == parent {
+ if current == parent || Some(&parent) == home_dir.as_ref() {
break Self::from_config(workspace, &dir);
}
diff --git a/support/texlab/crates/parser/src/latex.rs b/support/texlab/crates/parser/src/latex.rs
index 4a6fabae21..a114d3ecba 100644
--- a/support/texlab/crates/parser/src/latex.rs
+++ b/support/texlab/crates/parser/src/latex.rs
@@ -855,6 +855,11 @@ impl<'a> Parser<'a> {
self.builder.start_node(LABEL_DEFINITION.into());
self.eat();
self.trivia();
+
+ if self.lexer.peek() == Some(Token::LBrack) {
+ self.brack_group();
+ }
+
if self.lexer.peek() == Some(Token::LCurly) {
self.curly_group_word();
}
diff --git a/support/texlab/crates/parser/src/latex/tests.rs b/support/texlab/crates/parser/src/latex/tests.rs
index 5e1a4044cd..9c086c43fd 100644
--- a/support/texlab/crates/parser/src/latex/tests.rs
+++ b/support/texlab/crates/parser/src/latex/tests.rs
@@ -2883,6 +2883,30 @@ fn test_label_definition_simple() {
}
#[test]
+fn test_label_definition_options() {
+ check(
+ r#"\label[foo]{bar}"#,
+ expect![[r#"
+ ROOT@0..16
+ PREAMBLE@0..16
+ LABEL_DEFINITION@0..16
+ COMMAND_NAME@0..6 "\\label"
+ BRACK_GROUP@6..11
+ L_BRACK@6..7 "["
+ TEXT@7..10
+ WORD@7..10 "foo"
+ R_BRACK@10..11 "]"
+ CURLY_GROUP_WORD@11..16
+ L_CURLY@11..12 "{"
+ KEY@12..15
+ WORD@12..15 "bar"
+ R_CURLY@15..16 "}"
+
+ "#]],
+ );
+}
+
+#[test]
fn test_label_number() {
check(
r#"\newlabel{foo}{{1.1}}"#,
diff --git a/support/texlab/crates/texlab/Cargo.toml b/support/texlab/crates/texlab/Cargo.toml
index a78059051e..8fe5d4fbbe 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.14.0"
+version = "5.14.1"
license.workspace = true
readme = "README.md"
authors.workspace = true
diff --git a/support/texlab/texlab.1 b/support/texlab/texlab.1
index deeb11a500..00148f341b 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.49.1.
-.TH TEXLAB "1" "March 2024" "texlab 5.14.0" "User Commands"
+.TH TEXLAB "1" "March 2024" "texlab 5.14.1" "User Commands"
.SH NAME
-texlab \- manual page for texlab 5.14.0
+texlab \- manual page for texlab 5.14.1
.SH SYNOPSIS
.B texlab
[\fI\,OPTIONS\/\fR]
diff --git a/support/texlab/texlab.pdf b/support/texlab/texlab.pdf
index b76a5f2d9d..87a904383d 100644
--- a/support/texlab/texlab.pdf
+++ b/support/texlab/texlab.pdf
Binary files differ