summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-11-11 03:00:56 +0000
committerNorbert Preining <norbert@preining.info>2021-11-11 03:00:56 +0000
commit5749e1b65a86cb035a8e4809e7383a98619b0984 (patch)
tree7f699c2ae9ef2ae3f063583650a343e0d37f66da /support
parent3b9a500a47854adcb6f2a248722ae2225d6d7d43 (diff)
CTAN sync 202111110300
Diffstat (limited to 'support')
-rw-r--r--support/TeX4ht/source/ChangeLog14
-rw-r--r--support/TeX4ht/source/tex4ht-html4.tex3
-rw-r--r--support/TeX4ht/source/tex4ht-html5.tex3
-rw-r--r--support/TeX4ht/source/tex4ht-mathml.tex6
-rw-r--r--support/lualibs/lua-uca/CHANGELOG.md14
-rw-r--r--support/lualibs/lua-uca/LICENSE12
-rw-r--r--support/lualibs/lua-uca/README.md8
-rw-r--r--support/lualibs/lua-uca/lua-uca-doc.pdfbin72038 -> 72205 bytes
-rw-r--r--support/lualibs/lua-uca/lua-uca-doc.tex2
-rw-r--r--support/lualibs/lua-uca/lua-uca/lua-uca-collator.lua18
-rw-r--r--support/texlab/CHANGELOG.md9
-rw-r--r--support/texlab/Cargo.lock26
-rw-r--r--support/texlab/Cargo.toml10
-rw-r--r--support/texlab/src/diagnostics/build_log.rs12
-rw-r--r--support/texlab/src/features/completion.rs8
-rw-r--r--support/texlab/src/features/cursor.rs17
-rw-r--r--support/texlab/src/syntax/build_log.rs186
-rw-r--r--support/texlab/src/syntax/latex/kind.rs1
-rw-r--r--support/texlab/src/syntax/latex/lexer.rs5
-rw-r--r--support/texlab/src/syntax/latex/parser.rs20
-rw-r--r--support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__command_with_parameter.snap2
-rw-r--r--support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__invalid_parameter.snap2
-rw-r--r--support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__command_definition_simple.snap3
-rw-r--r--support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__label_reference_incomplete.snap33
-rw-r--r--support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__parameter.snap3
-rw-r--r--support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__parameter_error.snap3
-rw-r--r--support/texlab/src/syntax/snapshots/texlab__syntax__build_log__tests__parse_007.snap15
-rw-r--r--support/texlab/src/workspace/api.rs2
-rw-r--r--support/texlab/tests/integration/completion.rs8
-rw-r--r--support/texlab/tests/integration/issues.rs20
-rw-r--r--support/texlab/tests/integration/snapshots/integration__issues__510_completion_with_unmatched_braces.snap57
-rw-r--r--support/texlab/texlab.pdfbin26161 -> 88770 bytes
32 files changed, 453 insertions, 69 deletions
diff --git a/support/TeX4ht/source/ChangeLog b/support/TeX4ht/source/ChangeLog
index 6d3301318d..6a53f48d2f 100644
--- a/support/TeX4ht/source/ChangeLog
+++ b/support/TeX4ht/source/ChangeLog
@@ -1,3 +1,17 @@
+2021-11-09 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-html4.tex (html4.4ht): added CSS declaration that enables table row
+ rules.
+ * tex4ht-html5.tex (html5.4ht): removed CSS rules declaration that was moved
+ to html4.4ht.
+ https://tex.stackexchange.com/a/621871/2891
+
+2021-11-08 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-mathml.tex (mathml.4ht): use stretchy="false" for math operators
+ that shouldn't be stretchy.
+ https://tex.stackexchange.com/a/621839/2891
+
2021-11-05 Michal Hoftich <michal.h21@gmail.com>
* tex4ht-4ht.tex (hyperref-hooks.4ht, biblatex-hooks.4ht):
diff --git a/support/TeX4ht/source/tex4ht-html4.tex b/support/TeX4ht/source/tex4ht-html4.tex
index 332e0022ff..2a0568c96f 100644
--- a/support/TeX4ht/source/tex4ht-html4.tex
+++ b/support/TeX4ht/source/tex4ht-html4.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-html4.tex 1008 2021-11-04 20:14:13Z michal_h21 $
+% $Id: tex4ht-html4.tex 1011 2021-11-09 09:00:24Z michal_h21 $
% Compile 4 times: latex tex4ht-html4
% Copy html4.4ht into the work directory before all but the last compilation.
%
@@ -19663,6 +19663,7 @@ Enable linebreaking in long URLs
\Configure{pic-halign}{}
\Configure{halignTB<>}{halign}{\HCode{id="TBL-\TableNo" class="halign"\Hnewline }<>}
\HAssign\Next:TableNo|=0 \global\let\TableNo=\Next:TableNo
+\Css{table.tabular{border-collapse: collapse; border-spacing: 0;}}
>>>
The following should be just under LaTeX.
diff --git a/support/TeX4ht/source/tex4ht-html5.tex b/support/TeX4ht/source/tex4ht-html5.tex
index 96e726f58d..c1a469ca5b 100644
--- a/support/TeX4ht/source/tex4ht-html5.tex
+++ b/support/TeX4ht/source/tex4ht-html5.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-html5.tex 994 2021-10-18 08:59:43Z michal_h21 $
+% $Id: tex4ht-html5.tex 1011 2021-11-09 09:00:24Z michal_h21 $
% compile 3 times: latex tex4ht-moz
% or xhlatex tex4ht-moz "html,3,sections+"
%
@@ -313,7 +313,6 @@ cellspacing and cellpading attributes are prohibited in html5
\<tabular fixes\><<<
\Configure{halignTB<>}{tabular}{\HCode{id="TBL-\TableNo" class="tabular"\Hnewline \GROUPS\Hnewline
}<>\HAlign}
-\Css{table.tabular{border-collapse: collapse; border-spacing: 0;}}
>>>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/support/TeX4ht/source/tex4ht-mathml.tex b/support/TeX4ht/source/tex4ht-mathml.tex
index 6fc95d0a44..bd2fa451da 100644
--- a/support/TeX4ht/source/tex4ht-mathml.tex
+++ b/support/TeX4ht/source/tex4ht-mathml.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-mathml.tex 952 2021-06-17 21:47:06Z karl $$
+% $Id: tex4ht-mathml.tex 1010 2021-11-08 17:32:28Z michal_h21 $$
% compile 3 times: latex tex4ht-mathltx
% or xhlatex tex4ht-mathltx "html,3,sections+"
%
@@ -3161,10 +3161,10 @@ Accent versus underscript: \verb=\underbrace{x+y+z}=
\Configure{MathClass}{3}{*}{<\a:mathml mo\Hnewline
\mml:class="MathClass-rel">}{</\a:mathml mo>}{}
\Configure{MathClass}{4}{*}{<\a:mathml mo\Hnewline
- \mml:class="MathClass-open">}
+ \mml:class="MathClass-open" stretchy="false">}
{</\a:mathml mo>}{}
\Configure{MathClass}{5}{*}{<\a:mathml mo\Hnewline
- \mml:class="MathClass-close">}
+ \mml:class="MathClass-close" stretchy="false">}
{</\a:mathml mo>}{}
\Configure{MathClass}{6}{*}{<\a:mathml mo\Hnewline
\mml:class="MathClass-punc">}{</\a:mathml mo>}{}
diff --git a/support/lualibs/lua-uca/CHANGELOG.md b/support/lualibs/lua-uca/CHANGELOG.md
index 2d5816ebfc..9ba52855a1 100644
--- a/support/lualibs/lua-uca/CHANGELOG.md
+++ b/support/lualibs/lua-uca/CHANGELOG.md
@@ -1,7 +1,17 @@
# Changelog
+2021-11-10
+
+ - version `0.1b` released.
+
+2021-11-09
+
+ - cache string to codepoint conversion.
+ - use NFC normalization with LuaTeX.
+
2021-09-16
+ - version `0.1a` released.
- added sorting rules for all languages contained in CLDR collation files.
2020-06-09
@@ -11,5 +21,5 @@
2020-03-24
- - version `0.1` released
- - initial version for CTAN
+ - version `0.1` released.
+ - initial version for CTAN.
diff --git a/support/lualibs/lua-uca/LICENSE b/support/lualibs/lua-uca/LICENSE
index c085812b5a..c71dcd0d8c 100644
--- a/support/lualibs/lua-uca/LICENSE
+++ b/support/lualibs/lua-uca/LICENSE
@@ -1,8 +1,14 @@
-Copyright 2020 Michal Hoftich
+Copyright 2021 Michal Hoftich
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
diff --git a/support/lualibs/lua-uca/README.md b/support/lualibs/lua-uca/README.md
index 37343a83af..6ef94a4995 100644
--- a/support/lualibs/lua-uca/README.md
+++ b/support/lualibs/lua-uca/README.md
@@ -121,3 +121,11 @@ will be sorted at the very end.
- Algorithm for setting implicit sort weights of characters that are not explicitly listed in DUCET.
- Special handling of CJK scripts.
+
+\iffalse
+# Copyright
+
+Michal Hoftich, 2021. See LICENSE file for more details.
+
+
+\fi
diff --git a/support/lualibs/lua-uca/lua-uca-doc.pdf b/support/lualibs/lua-uca/lua-uca-doc.pdf
index 049332eda1..4b32fd55d3 100644
--- a/support/lualibs/lua-uca/lua-uca-doc.pdf
+++ b/support/lualibs/lua-uca/lua-uca-doc.pdf
Binary files differ
diff --git a/support/lualibs/lua-uca/lua-uca-doc.tex b/support/lualibs/lua-uca/lua-uca-doc.tex
index 2d25f51992..64b34335c2 100644
--- a/support/lualibs/lua-uca/lua-uca-doc.tex
+++ b/support/lualibs/lua-uca/lua-uca-doc.tex
@@ -31,7 +31,6 @@
\section{Available Languages}
-\begin{raggedright}
The \texttt{lua-uca-languages} library provides the following langauges:
\bgroup\ttfamily
\begin{luacode*}
@@ -46,7 +45,6 @@ table.sort(l)
tex.print(table.concat(l, ", "))
\end{luacode*}
\egroup
-\end{raggedright}
If you want to requrest language not listed in this listing, or if you had
created support code for one, please contact the package author by mail or using
diff --git a/support/lualibs/lua-uca/lua-uca/lua-uca-collator.lua b/support/lualibs/lua-uca/lua-uca/lua-uca-collator.lua
index c009bc9868..258b2a12e4 100644
--- a/support/lualibs/lua-uca/lua-uca/lua-uca-collator.lua
+++ b/support/lualibs/lua-uca/lua-uca/lua-uca-collator.lua
@@ -2,6 +2,11 @@
local math = require "math"
local tailoring_lib = require "lua-uca.lua-uca-tailoring"
local reordering_table = require "lua-uca.lua-uca-reordering-table"
+local uni_normalize
+-- in LuaTeX, load the lua-uni-normalize library
+if kpse then
+ uni_normalize = require "lua-uni-normalize"
+end
local collator = {}
collator.__index = collator
@@ -213,9 +218,20 @@ function collator:compare(a, b)
return #a < #b
end
+local codepoints_cache = {}
+
function collator:string_to_codepoints(a)
+ if codepoints_cache[a] then return codepoints_cache[a] end
+ -- try unicode normalization, if it is available
+ -- it uses libraries available in LuaTeX, so it doesn't work with
+ -- stock Lua
+ local normalized = a
+ if uni_normalize then
+ normalized = uni_normalize.NFC(a)
+ end
local codepoints = {}
- for _, code in utf8.codes(a) do codepoints[#codepoints+1] = code end
+ for _, code in utf8.codes(normalized) do codepoints[#codepoints+1] = code end
+ codepoints_cache[a] = codepoints
return codepoints
end
diff --git a/support/texlab/CHANGELOG.md b/support/texlab/CHANGELOG.md
index 22934a08fe..13b1cc799c 100644
--- a/support/texlab/CHANGELOG.md
+++ b/support/texlab/CHANGELOG.md
@@ -5,6 +5,15 @@ 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).
+## [3.3.1] - 10.11.2021
+
+### Fixed
+
+- Fix completion for symbols in commands with incomplete braces ([#510](https://github.com/latex-lsp/texlab/issues/510))
+- Do not produce syntax errors for macro parameters inside special command arguments ([#508](https://github.com/latex-lsp/texlab/issues/508))
+- Fix a bug that sometimes causes the `aux` file to pick up the diagnostics of the `tex` file ([#502](https://github.com/latex-lsp/texlab/issues/502))
+- Fix a bug that sometimes prevents `log` files from being reanalyzed ([#502](https://github.com/latex-lsp/texlab/issues/502))
+
## [3.3.0] - 10.10.2021
### Added
diff --git a/support/texlab/Cargo.lock b/support/texlab/Cargo.lock
index 45a9114cc4..b5815c3ff4 100644
--- a/support/texlab/Cargo.lock
+++ b/support/texlab/Cargo.lock
@@ -51,9 +51,9 @@ checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e"
[[package]]
name = "anyhow"
-version = "1.0.44"
+version = "1.0.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1"
+checksum = "ee10e43ae4a853c0a3591d4e2ada1719e553be18199d9da9d4a83f5927c2f5c7"
[[package]]
name = "atty"
@@ -464,9 +464,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
[[package]]
name = "encoding_rs"
-version = "0.8.28"
+version = "0.8.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065"
+checksum = "a74ea89a0a1b98f6332de42c95baff457ada66d1cb4030f9ff151b2041a1c746"
dependencies = [
"cfg-if 1.0.0",
]
@@ -1629,9 +1629,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.68"
+version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8"
+checksum = "e466864e431129c7e0d3476b92f20458e5879919a0596c6472738d9fa2d342f8"
dependencies = [
"itoa",
"ryu",
@@ -1700,9 +1700,9 @@ dependencies = [
[[package]]
name = "smol_str"
-version = "0.1.18"
+version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b203e79e90905594272c1c97c7af701533d42adaab0beb3859018e477d54a3b0"
+checksum = "61d15c83e300cce35b7c8cd39ff567c1ef42dde6d4a1a38dbdbf9a59902261bd"
dependencies = [
"serde",
]
@@ -1769,9 +1769,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
[[package]]
name = "structopt"
-version = "0.3.23"
+version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf9d950ef167e25e0bdb073cf1d68e9ad2795ac826f2f3f59647817cf23c0bfa"
+checksum = "40b9788f4202aa75c240ecc9c15c65185e6a39ccdeb0fd5d008b98825464c87c"
dependencies = [
"clap",
"lazy_static",
@@ -1780,9 +1780,9 @@ dependencies = [
[[package]]
name = "structopt-derive"
-version = "0.4.16"
+version = "0.4.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "134d838a2c9943ac3125cf6df165eda53493451b719f3255b2a26b85f772d0ba"
+checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0"
dependencies = [
"heck",
"proc-macro-error",
@@ -1863,7 +1863,7 @@ dependencies = [
[[package]]
name = "texlab"
-version = "3.3.0"
+version = "3.3.1"
dependencies = [
"anyhow",
"bibutils-sys",
diff --git a/support/texlab/Cargo.toml b/support/texlab/Cargo.toml
index 13a27a8bd0..cf99f7b387 100644
--- a/support/texlab/Cargo.toml
+++ b/support/texlab/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "texlab"
description = "LaTeX Language Server"
-version = "3.3.0"
+version = "3.3.1"
license = "GPL-3.0"
readme = "README.md"
authors = [
@@ -29,7 +29,7 @@ citation = [
semantic = []
[dependencies]
-anyhow = "1.0.44"
+anyhow = "1.0.45"
bibutils-sys = { version="0.1.1", optional=true }
byteorder = "1.4.3"
cancellation = "0.1"
@@ -42,7 +42,7 @@ csl = { git="https://github.com/cormacrelf/citeproc-rs", rev="5252fbd8d2046a5a7d
crossbeam-channel = "0.5.1"
cstree = "0.6.1"
derive_more = "0.99.16"
-encoding_rs = "0.8.28"
+encoding_rs = "0.8.29"
encoding_rs_io = "0.1.7"
flate2 = "1.0.22"
fern = "0.6"
@@ -62,9 +62,9 @@ rayon = "1.5.1"
regex = "1.5.4"
rustc-hash = "1.1.0"
serde = "1.0.130"
-serde_json = "1.0.68"
+serde_json = "1.0.69"
serde_repr = "0.1.7"
-smol_str = { version="0.1.18", features=["serde"] }
+smol_str = { version="0.1.21", features=["serde"] }
structopt = "0.3"
tempfile = "3.2.0"
threadpool = "1.8.1"
diff --git a/support/texlab/src/diagnostics/build_log.rs b/support/texlab/src/diagnostics/build_log.rs
index a2069ff762..ede3a873a8 100644
--- a/support/texlab/src/diagnostics/build_log.rs
+++ b/support/texlab/src/diagnostics/build_log.rs
@@ -15,11 +15,13 @@ pub fn analyze_build_log_static(
let root_document = workspace.documents().into_iter().find(|document| {
if let Some(data) = document.data.as_latex() {
- data.extras
- .implicit_links
- .log
- .iter()
- .any(|u| u.as_ref() == build_log_uri)
+ !document.uri.as_str().ends_with(".aux")
+ && data
+ .extras
+ .implicit_links
+ .log
+ .iter()
+ .any(|u| u.as_ref() == build_log_uri)
} else {
false
}
diff --git a/support/texlab/src/features/completion.rs b/support/texlab/src/features/completion.rs
index f9ad8554cd..cb6a66f3cd 100644
--- a/support/texlab/src/features/completion.rs
+++ b/support/texlab/src/features/completion.rs
@@ -24,6 +24,7 @@ use std::borrow::Cow;
use cancellation::CancellationToken;
use cstree::TextSize;
use fuzzy_matcher::{skim::SkimMatcherV2, FuzzyMatcher};
+use itertools::Itertools;
use lsp_types::{
CompletionItem, CompletionList, CompletionParams, CompletionTextEdit, Documentation,
InsertTextFormat, MarkupContent, MarkupKind, TextEdit,
@@ -159,7 +160,12 @@ fn score(context: &CursorContext<CompletionParams>, items: &mut Vec<InternalComp
}
Cursor::Latex(token) if token.kind() == latex::WORD => {
if let Some(key) = latex::Key::cast(token.parent()) {
- key.to_string().into()
+ key.words()
+ .take_while(|word| word.text_range() != token.text_range())
+ .chain(std::iter::once(token))
+ .filter(|word| word.text_range().start() < context.offset)
+ .join(" ")
+ .into()
} else {
token.text().into()
}
diff --git a/support/texlab/src/features/cursor.rs b/support/texlab/src/features/cursor.rs
index 6e8719987a..d8db0f2aa8 100644
--- a/support/texlab/src/features/cursor.rs
+++ b/support/texlab/src/features/cursor.rs
@@ -264,8 +264,21 @@ impl<P: HasPosition> CursorContext<P> {
let group = latex::CurlyGroupWordList::cast(group)
.filter(|group| self.is_inside_latex_curly(group))?;
- key.map(|key| (key.to_string(), key.small_range(), group))
- .or_else(|| Some((String::new(), TextRange::empty(self.offset), group)))
+ key.map(|key| {
+ let range = if group
+ .syntax()
+ .last_token()
+ .filter(|tok| tok.kind() == latex::MISSING)
+ .is_some()
+ {
+ TextRange::new(key.small_range().start(), token.text_range().end())
+ } else {
+ key.small_range()
+ };
+
+ (key.to_string(), range, group)
+ })
+ .or_else(|| Some((String::new(), TextRange::empty(self.offset), group)))
}
}
diff --git a/support/texlab/src/syntax/build_log.rs b/support/texlab/src/syntax/build_log.rs
index 65a5938262..f91ce974d0 100644
--- a/support/texlab/src/syntax/build_log.rs
+++ b/support/texlab/src/syntax/build_log.rs
@@ -183,6 +183,7 @@ impl PartialOrd for FileRange {
mod tests {
use super::*;
use indoc::indoc;
+ use insta::assert_debug_snapshot;
#[test]
fn test_parse_001() {
@@ -1158,4 +1159,189 @@ mod tests {
]
);
}
+
+ #[test]
+ fn test_parse_007() {
+ let log = indoc! {
+ r#"
+ This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/W32TeX) (preloaded format=pdflatex 2021.6.19) 5 NOV 2021 19:10
+ entering extended mode
+ restricted \write18 enabled.
+ %&-line parsing enabled.
+ **/some/folder/a.tex
+ (/some/folder/a.tex
+ LaTeX2e <2021-06-01> patch level 1
+ L3 programming layer <2021-06-18>
+ (/texlive/2021/texmf-dist/tex/latex/koma-script/scrartcl.cls
+ Document Class: scrartcl 2021/03/17 v3.33 KOMA-Script document class (article)
+ (/texlive/2021/texmf-dist/tex/latex/koma-script/scrkbase.sty
+ Package: scrkbase 2021/03/17 v3.33 KOMA-Script package (KOMA-Script-dependent b
+ asics and keyval usage)
+
+ (/texlive/2021/texmf-dist/tex/latex/koma-script/scrbase.sty
+ Package: scrbase 2021/03/17 v3.33 KOMA-Script package (KOMA-Script-independent
+ basics and keyval usage)
+
+ (/texlive/2021/texmf-dist/tex/latex/koma-script/scrlfile.sty
+ Package: scrlfile 2021/03/17 v3.33 KOMA-Script package (file load hooks)
+
+ (/texlive/2021/texmf-dist/tex/latex/koma-script/scrlfile-hook.sty
+ Package: scrlfile-hook 2021/03/17 v3.33 KOMA-Script package (using LaTeX hooks)
+
+
+ (/texlive/2021/texmf-dist/tex/latex/koma-script/scrlogo.sty
+ Package: scrlogo 2021/03/17 v3.33 KOMA-Script package (logo)
+ )))
+ (/texlive/2021/texmf-dist/tex/latex/graphics/keyval.sty
+ Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
+ \KV@toks@=\toks16
+ )
+ Applying: [2021/05/01] Usage of raw option list on input line 252.
+ Already applied: [0000/00/00] compatibility for LaTeX before 2021/05/01 on inpu
+ t line 337.
+ ))
+ ==> First Aid for scrkbase.sty no longer applied!
+ (/texlive/2021/texmf-dist/tex/latex/koma-script/tocbasic.sty
+ Package: tocbasic 2021/03/17 v3.33 KOMA-Script package (handling toc-files)
+ \scr@dte@tocline@numberwidth=\skip47
+ \scr@dte@tocline@numbox=\box50
+ )
+ Package tocbasic Info: babel extension for `toc' omitted
+ (tocbasic) because of missing \bbl@set@language on input line 135.
+ Class scrartcl Info: File `scrsize11pt.clo' used instead of
+ (scrartcl) file `scrsize11.clo' to setup font sizes on input line 223
+ 9.
+
+ (/texlive/2021/texmf-dist/tex/latex/koma-script/scrsize11pt.clo
+ File: scrsize11pt.clo 2021/03/17 v3.33 KOMA-Script font size class option (11pt
+ )
+ )
+ (/texlive/2021/texmf-dist/tex/latex/koma-script/typearea.sty
+ Package: typearea 2021/03/17 v3.33 KOMA-Script package (type area)
+ \ta@bcor=\skip48
+ \ta@div=\count182
+ \ta@hblk=\skip49
+ \ta@vblk=\skip50
+ \ta@temp=\skip51
+ \footheight=\skip52
+ Package typearea Info: These are the values describing the layout:
+ (typearea) DIV = 10
+ (typearea) BCOR = 0.0pt
+ (typearea) \paperwidth = 597.50793pt
+ (typearea) \textwidth = 418.25555pt
+ (typearea) DIV departure = -6%
+ (typearea) \evensidemargin = 17.3562pt
+ (typearea) \oddsidemargin = 17.3562pt
+ (typearea) \paperheight = 845.04694pt
+ (typearea) \textheight = 595.80026pt
+ (typearea) \topmargin = -25.16531pt
+ (typearea) \headheight = 17.0pt
+ (typearea) \headsep = 20.40001pt
+ (typearea) \topskip = 11.0pt
+ (typearea) \footskip = 47.6pt
+ (typearea) \baselineskip = 13.6pt
+ (typearea) on input line 1741.
+ )
+ \c@part=\count183
+ \c@section=\count184
+ \c@subsection=\count185
+ \c@subsubsection=\count186
+ \c@paragraph=\count187
+ \c@subparagraph=\count188
+ \scr@dte@section@maxnumwidth=\skip53
+ Class scrartcl Info: using compatibility default `runin=bysign'
+ (scrartcl) for `\section on input line 4846.
+ Class scrartcl Info: using compatibility default `afterindent=bysign'
+ (scrartcl) for `\section on input line 4846.
+ \scr@dte@part@maxnumwidth=\skip54
+ Class scrartcl Info: using compatibility default `afterindent=false'
+ (scrartcl) for `\part on input line 4854.
+ \scr@dte@subsection@maxnumwidth=\skip55
+ Class scrartcl Info: using compatibility default `runin=bysign'
+ (scrartcl) for `\subsection on input line 4864.
+ Class scrartcl Info: using compatibility default `afterindent=bysign'
+ (scrartcl) for `\subsection on input line 4864.
+ \scr@dte@subsubsection@maxnumwidth=\skip56
+ Class scrartcl Info: using compatibility default `runin=bysign'
+ (scrartcl) for `\subsubsection on input line 4874.
+ Class scrartcl Info: using compatibility default `afterindent=bysign'
+ (scrartcl) for `\subsubsection on input line 4874.
+ \scr@dte@paragraph@maxnumwidth=\skip57
+ Class scrartcl Info: using compatibility default `runin=bysign'
+ (scrartcl) for `\paragraph on input line 4885.
+ Class scrartcl Info: using compatibility default `afterindent=bysign'
+ (scrartcl) for `\paragraph on input line 4885.
+ \scr@dte@subparagraph@maxnumwidth=\skip58
+ Class scrartcl Info: using compatibility default `runin=bysign'
+ (scrartcl) for `\subparagraph on input line 4895.
+ Class scrartcl Info: using compatibility default `afterindent=bysign'
+ (scrartcl) for `\subparagraph on input line 4895.
+ \abovecaptionskip=\skip59
+ \belowcaptionskip=\skip60
+ \c@pti@nb@sid@b@x=\box51
+ Package tocbasic Info: babel extension for `lof' omitted
+ (tocbasic) because of missing \bbl@set@language on input line 6127.
+
+ \scr@dte@figure@maxnumwidth=\skip61
+ \c@figure=\count189
+ Package tocbasic Info: babel extension for `lot' omitted
+ (tocbasic) because of missing \bbl@set@language on input line 6139.
+
+ \scr@dte@table@maxnumwidth=\skip62
+ \c@table=\count190
+ Class scrartcl Info: Redefining `\numberline' on input line 6303.
+ \bibindent=\dimen138
+ )
+ (/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
+ File: l3backend-pdftex.def 2021-05-07 L3 backend support: PDF output (pdfTeX)
+ \l__color_backend_stack_int=\count191
+ \l__pdf_internal_box=\box52
+ ) (./a.aux)
+ \openout1 = `a.aux'.
+
+ LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 3.
+ LaTeX Font Info: ... okay on input line 3.
+ LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 3.
+ LaTeX Font Info: ... okay on input line 3.
+ LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 3.
+ LaTeX Font Info: ... okay on input line 3.
+ LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 3.
+ LaTeX Font Info: ... okay on input line 3.
+ LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 3.
+ LaTeX Font Info: ... okay on input line 3.
+ LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 3.
+ LaTeX Font Info: ... okay on input line 3.
+ LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 3.
+ LaTeX Font Info: ... okay on input line 3.
+ Package scrbase Info: activating english \contentsname on input line 3.
+ Package scrbase Info: activating english \listfigurename on input line 3.
+ Package scrbase Info: activating english \listtablename on input line 3.
+ ! Undefined control sequence.
+ l.4 \lsdkfjlskdfj
+
+ The control sequence at the end of the top line
+ of your error message was never \def'ed. If you have
+ misspelled it (e.g., `\hobx'), type `I' and the correct
+ spelling (e.g., `I\hbox'). Otherwise just continue,
+ and I'll forget about whatever was undefined.
+
+ (./a.aux) )
+ Here is how much of TeX's memory you used:
+ 3199 strings out of 478510
+ 74549 string characters out of 5853586
+ 510929 words of memory out of 5000000
+ 21227 multiletter control sequences out of 15000+600000
+ 403730 words of font info for 28 fonts, out of 8000000 for 9000
+ 1141 hyphenation exceptions out of 8191
+ 108i,1n,108p,10625b,270s stack positions out of 5000i,500n,10000p,200000b,80000s
+
+ No pages of output.
+ PDF statistics:
+ 0 PDF objects out of 1000 (max. 8388607)
+ 0 named destinations out of 1000 (max. 500000)
+ 1 words of extra memory for PDF output out of 10000 (max. 10000000)"#,
+ };
+
+ assert_debug_snapshot!(parse(&log).errors);
+ }
}
diff --git a/support/texlab/src/syntax/latex/kind.rs b/support/texlab/src/syntax/latex/kind.rs
index fcab393380..90b68145a7 100644
--- a/support/texlab/src/syntax/latex/kind.rs
+++ b/support/texlab/src/syntax/latex/kind.rs
@@ -13,7 +13,6 @@ pub enum SyntaxKind {
R_BRACK,
L_PAREN,
R_PAREN,
- PARAMETER,
COMMA,
EQUALITY_SIGN,
WORD,
diff --git a/support/texlab/src/syntax/latex/lexer.rs b/support/texlab/src/syntax/latex/lexer.rs
index 7cd94ec897..f697403577 100644
--- a/support/texlab/src/syntax/latex/lexer.rs
+++ b/support/texlab/src/syntax/latex/lexer.rs
@@ -30,16 +30,13 @@ enum Token {
#[token(")")]
R_PAREN,
- #[regex(r"#\d?")]
- PARAMETER,
-
#[token(",")]
COMMA,
#[token("=")]
EQUALITY_SIGN,
- #[regex(r"[^\s\\%\{\},\$\[\]\(\)=\#]+")]
+ #[regex(r"[^\s\\%\{\},\$\[\]\(\)=]+")]
#[error]
WORD,
diff --git a/support/texlab/src/syntax/latex/parser.rs b/support/texlab/src/syntax/latex/parser.rs
index a21674f51d..a7fe3342f8 100644
--- a/support/texlab/src/syntax/latex/parser.rs
+++ b/support/texlab/src/syntax/latex/parser.rs
@@ -105,7 +105,6 @@ impl<'a> Parser<'a> {
self.eat();
self.builder.finish_node();
}
- PARAMETER => self.eat(),
WORD | COMMA => self.text(context),
EQUALITY_SIGN => self.eat(),
DOLLAR => self.formula(),
@@ -212,10 +211,6 @@ impl<'a> Parser<'a> {
Some(WORD) => {
self.key();
}
- Some(PARAMETER) => {
- self.eat();
- self.trivia();
- }
Some(_) | None => {
self.builder.token(MISSING.into(), "");
}
@@ -230,7 +225,7 @@ impl<'a> Parser<'a> {
while self
.peek()
- .filter(|&kind| matches!(kind, WHITESPACE | COMMENT | WORD | COMMA | PARAMETER))
+ .filter(|&kind| matches!(kind, WHITESPACE | COMMENT | WORD | COMMA))
.is_some()
{
if self.peek() == Some(WORD) {
@@ -253,10 +248,6 @@ impl<'a> Parser<'a> {
self.eat();
self.trivia();
}
- Some(PARAMETER) => {
- self.eat();
- self.trivia();
- }
Some(_) | None => {
self.builder.token(MISSING.into(), "");
}
@@ -301,10 +292,6 @@ impl<'a> Parser<'a> {
Some(WORD) => {
self.key();
}
- Some(PARAMETER) => {
- self.eat();
- self.trivia();
- }
Some(_) | None => {
self.builder.token(MISSING.into(), "");
}
@@ -1544,6 +1531,11 @@ mod tests {
}
#[test]
+ fn test_label_reference_incomplete() {
+ assert_debug_snapshot!(setup(r#"Equation \eqref{eq is a \emph{useful} identity."#));
+ }
+
+ #[test]
fn test_equation_label_reference_simple() {
assert_debug_snapshot!(setup(r#"\eqref{foo}"#));
}
diff --git a/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__command_with_parameter.snap b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__command_with_parameter.snap
index 9cff735e99..a9a0e11ad7 100644
--- a/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__command_with_parameter.snap
+++ b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__command_with_parameter.snap
@@ -37,7 +37,7 @@ expression: "verify(r#\"\\newcommand{\\id}[1]{#1}\"#)"
"{",
),
(
- PARAMETER,
+ WORD,
"#1",
),
(
diff --git a/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__invalid_parameter.snap b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__invalid_parameter.snap
index adadfcf0ef..e947ec3fb6 100644
--- a/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__invalid_parameter.snap
+++ b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__invalid_parameter.snap
@@ -5,7 +5,7 @@ expression: "verify(r#\"#\"#)"
---
[
(
- PARAMETER,
+ WORD,
"#",
),
]
diff --git a/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__command_definition_simple.snap b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__command_definition_simple.snap
index b0d9b225d0..b6b8380155 100644
--- a/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__command_definition_simple.snap
+++ b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__command_definition_simple.snap
@@ -20,6 +20,7 @@ ROOT@0..23
R_CURLY@18..19 "}"
CURLY_GROUP@19..23
L_CURLY@19..20 "{"
- PARAMETER@20..22 "#1"
+ TEXT@20..22
+ WORD@20..22 "#1"
R_CURLY@22..23 "}"
diff --git a/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__label_reference_incomplete.snap b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__label_reference_incomplete.snap
new file mode 100644
index 0000000000..047eea657d
--- /dev/null
+++ b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__label_reference_incomplete.snap
@@ -0,0 +1,33 @@
+---
+source: src/syntax/latex/parser.rs
+expression: "setup(r#\"Equation \\eqref{eq is a \\emph{useful} identity.\"#)"
+
+---
+ROOT@0..47
+ PREAMBLE@0..47
+ TEXT@0..9
+ WORD@0..8 "Equation"
+ WHITESPACE@8..9 " "
+ LABEL_REFERENCE@9..24
+ LABEL_REFERENCE_NAME@9..15 "\\eqref"
+ CURLY_GROUP_WORD_LIST@15..24
+ L_CURLY@15..16 "{"
+ KEY@16..24
+ WORD@16..18 "eq"
+ WHITESPACE@18..19 " "
+ WORD@19..21 "is"
+ WHITESPACE@21..22 " "
+ WORD@22..23 "a"
+ WHITESPACE@23..24 " "
+ MISSING@24..24 ""
+ GENERIC_COMMAND@24..38
+ GENERIC_COMMAND_NAME@24..29 "\\emph"
+ CURLY_GROUP@29..38
+ L_CURLY@29..30 "{"
+ TEXT@30..36
+ WORD@30..36 "useful"
+ R_CURLY@36..37 "}"
+ WHITESPACE@37..38 " "
+ TEXT@38..47
+ WORD@38..47 "identity."
+
diff --git a/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__parameter.snap b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__parameter.snap
index 8c6bd90cb8..4888672c31 100644
--- a/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__parameter.snap
+++ b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__parameter.snap
@@ -5,5 +5,6 @@ expression: "setup(r#\"#1\"#)"
---
ROOT@0..2
PREAMBLE@0..2
- PARAMETER@0..2 "#1"
+ TEXT@0..2
+ WORD@0..2 "#1"
diff --git a/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__parameter_error.snap b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__parameter_error.snap
index 1a9b68fa2d..843327ab80 100644
--- a/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__parameter_error.snap
+++ b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__parameter_error.snap
@@ -5,5 +5,6 @@ expression: "setup(r#\"#\"#)"
---
ROOT@0..1
PREAMBLE@0..1
- PARAMETER@0..1 "#"
+ TEXT@0..1
+ WORD@0..1 "#"
diff --git a/support/texlab/src/syntax/snapshots/texlab__syntax__build_log__tests__parse_007.snap b/support/texlab/src/syntax/snapshots/texlab__syntax__build_log__tests__parse_007.snap
new file mode 100644
index 0000000000..09d99c4f21
--- /dev/null
+++ b/support/texlab/src/syntax/snapshots/texlab__syntax__build_log__tests__parse_007.snap
@@ -0,0 +1,15 @@
+---
+source: src/syntax/build_log.rs
+expression: parse(&log).errors
+
+---
+[
+ BuildError {
+ relative_path: "/some/folder/a.tex",
+ level: Error,
+ message: "Undefined control sequence.",
+ line: Some(
+ 3,
+ ),
+ },
+]
diff --git a/support/texlab/src/workspace/api.rs b/support/texlab/src/workspace/api.rs
index 38fa0ce530..1ccd19d4e4 100644
--- a/support/texlab/src/workspace/api.rs
+++ b/support/texlab/src/workspace/api.rs
@@ -33,7 +33,7 @@ pub trait Workspace: Send + Sync {
fn reload(&self, path: PathBuf) -> Result<Option<Arc<Document>>> {
let uri = Arc::new(Uri::from_file_path(path.clone()).unwrap());
- if self.is_open(&uri) {
+ if self.is_open(&uri) && !uri.as_str().ends_with(".log") {
return Ok(self.get(&uri));
}
diff --git a/support/texlab/tests/integration/completion.rs b/support/texlab/tests/integration/completion.rs
index 01c9824eeb..74e8269d67 100644
--- a/support/texlab/tests/integration/completion.rs
+++ b/support/texlab/tests/integration/completion.rs
@@ -268,7 +268,7 @@ mod latex {
"bibtex",
false,
)?;
- assert_json_snapshot!(complete_and_resolve(&server, tex_uri, 3, 6)?);
+ assert_json_snapshot!(complete_and_resolve(&server, tex_uri, 3, 7)?);
Ok(())
}
@@ -549,7 +549,7 @@ mod latex {
"latex",
false,
)?;
- assert_json_snapshot!(complete_and_resolve(&server, uri, 5, 5)?);
+ assert_json_snapshot!(complete_and_resolve(&server, uri, 5, 6)?);
Ok(())
}
@@ -732,7 +732,7 @@ mod latex {
"latex",
false,
)?;
- assert_json_snapshot!(complete_and_resolve(&server, uri, 3, 7)?);
+ assert_json_snapshot!(complete_and_resolve(&server, uri, 3, 8)?);
Ok(())
}
@@ -790,7 +790,7 @@ mod latex {
"latex",
false,
)?;
- assert_json_snapshot!(complete_and_resolve(&server, uri, 4, 7)?);
+ assert_json_snapshot!(complete_and_resolve(&server, uri, 4, 8)?);
Ok(())
}
}
diff --git a/support/texlab/tests/integration/issues.rs b/support/texlab/tests/integration/issues.rs
index 5d6caeb79d..b991d185d3 100644
--- a/support/texlab/tests/integration/issues.rs
+++ b/support/texlab/tests/integration/issues.rs
@@ -39,3 +39,23 @@ fn test_408_parent_expansion() -> Result<()> {
Ok(())
}
+
+#[test]
+#[cfg(feature = "completion")]
+fn test_510_completion_with_unmatched_braces() -> Result<()> {
+ use insta::assert_debug_snapshot;
+
+ let server = ServerTester::launch_new_instance()?;
+ server.initialize(ClientCapabilities::default(), None)?;
+
+ let uri = server.open(
+ "main.tex",
+ "\\label{eq:foo}\n\\ref{eq is a \\emph{useful} identity.",
+ "latex",
+ false,
+ )?;
+
+ assert_debug_snapshot!(server.complete(uri, 1, 7)?);
+
+ Ok(())
+}
diff --git a/support/texlab/tests/integration/snapshots/integration__issues__510_completion_with_unmatched_braces.snap b/support/texlab/tests/integration/snapshots/integration__issues__510_completion_with_unmatched_braces.snap
new file mode 100644
index 0000000000..e421d6615e
--- /dev/null
+++ b/support/texlab/tests/integration/snapshots/integration__issues__510_completion_with_unmatched_braces.snap
@@ -0,0 +1,57 @@
+---
+source: tests/integration/issues.rs
+expression: "server.complete(uri, 1, 7)?"
+
+---
+CompletionList {
+ is_incomplete: false,
+ items: [
+ CompletionItem {
+ label: "eq:foo",
+ kind: Some(
+ Text,
+ ),
+ detail: None,
+ documentation: None,
+ deprecated: None,
+ preselect: Some(
+ false,
+ ),
+ sort_text: Some(
+ "00 eq:foo",
+ ),
+ filter_text: Some(
+ "eq:foo",
+ ),
+ insert_text: None,
+ insert_text_format: None,
+ insert_text_mode: None,
+ text_edit: Some(
+ Edit(
+ TextEdit {
+ range: Range {
+ start: Position {
+ line: 1,
+ character: 5,
+ },
+ end: Position {
+ line: 1,
+ character: 7,
+ },
+ },
+ new_text: "eq:foo",
+ },
+ ),
+ ),
+ additional_text_edits: None,
+ command: None,
+ commit_characters: None,
+ data: Some(
+ String(
+ "label",
+ ),
+ ),
+ tags: None,
+ },
+ ],
+}
diff --git a/support/texlab/texlab.pdf b/support/texlab/texlab.pdf
index 27f915c944..289c5f1951 100644
--- a/support/texlab/texlab.pdf
+++ b/support/texlab/texlab.pdf
Binary files differ