summaryrefslogtreecommitdiff
path: root/support/texlab/tests
diff options
context:
space:
mode:
Diffstat (limited to 'support/texlab/tests')
-rw-r--r--support/texlab/tests/logs/bad-box.log84
-rw-r--r--support/texlab/tests/logs/child-error.log65
-rw-r--r--support/texlab/tests/logs/citation-warning.log67
-rw-r--r--support/texlab/tests/logs/package-error.log86
-rw-r--r--support/texlab/tests/logs/package-warning.log387
-rw-r--r--support/texlab/tests/logs/tex-error.log125
-rw-r--r--support/texlab/tests/scenarios/completion/bibtex/command/foo.bib7
-rw-r--r--support/texlab/tests/scenarios/completion/bibtex/field/foo.bib6
-rw-r--r--support/texlab/tests/scenarios/completion/bibtex/type/foo.bib3
-rw-r--r--support/texlab/tests/scenarios/completion/bibtex/word/foo.bib8
-rw-r--r--support/texlab/tests/scenarios/completion/latex/citation/bar.bib7
-rw-r--r--support/texlab/tests/scenarios/completion/latex/citation/foo.tex8
-rw-r--r--support/texlab/tests/scenarios/completion/latex/color/foo.tex3
-rw-r--r--support/texlab/tests/scenarios/completion/latex/component/foo.tex8
-rw-r--r--support/texlab/tests/scenarios/completion/latex/include/bar.tex0
-rw-r--r--support/texlab/tests/scenarios/completion/latex/include/bibliography.bib0
-rw-r--r--support/texlab/tests/scenarios/completion/latex/include/foo.tex7
-rw-r--r--support/texlab/tests/scenarios/completion/latex/include/qux/baz.tex0
-rw-r--r--support/texlab/tests/scenarios/completion/latex/label/bar.aux25
-rw-r--r--support/texlab/tests/scenarios/completion/latex/label/bar.tex6
-rw-r--r--support/texlab/tests/scenarios/completion/latex/label/foo.aux10
-rw-r--r--support/texlab/tests/scenarios/completion/latex/label/foo.tex36
-rw-r--r--support/texlab/tests/scenarios/completion/latex/preselect/foo.tex3
-rw-r--r--support/texlab/tests/scenarios/completion/latex/theorem/foo.tex5
-rw-r--r--support/texlab/tests/scenarios/completion/latex/tikz/foo.tex3
-rw-r--r--support/texlab/tests/scenarios/completion/latex/user/foo.tex5
-rw-r--r--support/texlab/tests/scenarios/definition/bibtex/string/foo.bib7
-rw-r--r--support/texlab/tests/scenarios/definition/latex/citation/bar.bib3
-rw-r--r--support/texlab/tests/scenarios/definition/latex/citation/baz.bib3
-rw-r--r--support/texlab/tests/scenarios/definition/latex/citation/foo.tex2
-rw-r--r--support/texlab/tests/scenarios/definition/latex/command/foo.tex3
-rw-r--r--support/texlab/tests/scenarios/definition/latex/label/default.tex2
-rw-r--r--support/texlab/tests/scenarios/definition/latex/label/equation.tex6
-rw-r--r--support/texlab/tests/scenarios/definition/latex/label/float.tex7
-rw-r--r--support/texlab/tests/scenarios/definition/latex/label/item.tex7
-rw-r--r--support/texlab/tests/scenarios/definition/latex/label/section.tex7
-rw-r--r--support/texlab/tests/scenarios/definition/latex/label/theorem.tex9
-rw-r--r--support/texlab/tests/scenarios/definition/latex/math_operator/foo.tex3
-rw-r--r--support/texlab/tests/scenarios/diagnostics/bibtex/foo.bib1
-rw-r--r--support/texlab/tests/scenarios/diagnostics/build/foo.log59
-rw-r--r--support/texlab/tests/scenarios/diagnostics/build/foo.tex6
-rw-r--r--support/texlab/tests/scenarios/folding/bar.bib24
-rw-r--r--support/texlab/tests/scenarios/folding/foo.tex13
-rw-r--r--support/texlab/tests/scenarios/formatting/bibtex/default/formatted.bib4
-rw-r--r--support/texlab/tests/scenarios/formatting/bibtex/default/unformatted.bib1
-rw-r--r--support/texlab/tests/scenarios/formatting/bibtex/infinite_line_length/formatted.bib3
-rw-r--r--support/texlab/tests/scenarios/formatting/bibtex/infinite_line_length/unformatted.bib1
-rw-r--r--support/texlab/tests/scenarios/hover/bibtex/field/foo.bib4
-rw-r--r--support/texlab/tests/scenarios/hover/bibtex/string_reference/foo.bib6
-rw-r--r--support/texlab/tests/scenarios/hover/bibtex/type/foo.bib5
-rw-r--r--support/texlab/tests/scenarios/hover/latex/citation/foo.bib5
-rw-r--r--support/texlab/tests/scenarios/hover/latex/citation/foo.tex4
-rw-r--r--support/texlab/tests/scenarios/hover/latex/component/foo.tex4
-rw-r--r--support/texlab/tests/scenarios/hover/latex/label/section.tex5
-rw-r--r--support/texlab/tests/scenarios/symbol/hierarchical/enumerate.aux3
-rw-r--r--support/texlab/tests/scenarios/symbol/hierarchical/enumerate.tex12
-rw-r--r--support/texlab/tests/scenarios/symbol/hierarchical/equation.aux2
-rw-r--r--support/texlab/tests/scenarios/symbol/hierarchical/equation.tex17
-rw-r--r--support/texlab/tests/scenarios/symbol/hierarchical/float.aux5
-rw-r--r--support/texlab/tests/scenarios/symbol/hierarchical/float.tex24
-rw-r--r--support/texlab/tests/scenarios/symbol/hierarchical/section.aux4
-rw-r--r--support/texlab/tests/scenarios/symbol/hierarchical/section.tex11
-rw-r--r--support/texlab/tests/scenarios/symbol/hierarchical/theorem.aux3
-rw-r--r--support/texlab/tests/scenarios/symbol/hierarchical/theorem.tex23
-rw-r--r--support/texlab/tests/scenarios/symbol/workspace/bar.bib3
-rw-r--r--support/texlab/tests/scenarios/symbol/workspace/foo.aux17
-rw-r--r--support/texlab/tests/scenarios/symbol/workspace/foo.tex38
-rw-r--r--support/texlab/tests/support/mod.rs635
-rw-r--r--support/texlab/tests/test_completion_bibtex_command.rs19
-rw-r--r--support/texlab/tests/test_completion_bibtex_field.rs19
-rw-r--r--support/texlab/tests/test_completion_bibtex_type.rs26
-rw-r--r--support/texlab/tests/test_completion_bibtex_word.rs20
-rw-r--r--support/texlab/tests/test_completion_latex_citation.rs26
-rw-r--r--support/texlab/tests/test_completion_latex_color.rs23
-rw-r--r--support/texlab/tests/test_completion_latex_component.rs68
-rw-r--r--support/texlab/tests/test_completion_latex_include.rs29
-rw-r--r--support/texlab/tests/test_completion_latex_label.rs34
-rw-r--r--support/texlab/tests/test_completion_latex_preselect.rs11
-rw-r--r--support/texlab/tests/test_completion_latex_theorem.rs12
-rw-r--r--support/texlab/tests/test_completion_latex_tikz.rs21
-rw-r--r--support/texlab/tests/test_completion_latex_user.rs19
-rw-r--r--support/texlab/tests/test_definition_bibtex_string.rs18
-rw-r--r--support/texlab/tests/test_definition_latex_citation.rs27
-rw-r--r--support/texlab/tests/test_definition_latex_command.rs18
-rw-r--r--support/texlab/tests/test_definition_latex_label.rs73
-rw-r--r--support/texlab/tests/test_definition_latex_math_operator.rs18
-rw-r--r--support/texlab/tests/test_diagnostics_bibtex.rs36
-rw-r--r--support/texlab/tests/test_diagnostics_build.rs25
-rw-r--r--support/texlab/tests/test_folding.rs66
-rw-r--r--support/texlab/tests/test_formatting_bibtex.rs34
-rw-r--r--support/texlab/tests/test_hover_bibtex_field.rs28
-rw-r--r--support/texlab/tests/test_hover_bibtex_string_reference.rs24
-rw-r--r--support/texlab/tests/test_hover_bibtex_type.rs28
-rw-r--r--support/texlab/tests/test_hover_latex_citation.rs24
-rw-r--r--support/texlab/tests/test_hover_latex_component.rs27
-rw-r--r--support/texlab/tests/test_hover_latex_label.rs59
-rw-r--r--support/texlab/tests/test_symbol_hierarchical.rs167
-rw-r--r--support/texlab/tests/test_symbol_workspace.rs48
98 files changed, 3012 insertions, 0 deletions
diff --git a/support/texlab/tests/logs/bad-box.log b/support/texlab/tests/logs/bad-box.log
new file mode 100644
index 0000000000..39d13e0acd
--- /dev/null
+++ b/support/texlab/tests/logs/bad-box.log
@@ -0,0 +1,84 @@
+This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/W32TeX) (preloaded format=pdflatex 2018.3.30) 26 DEC 2018 16:50
+entering extended mode
+ restricted \write18 enabled.
+ %&-line parsing enabled.
+**./parent.tex
+(./parent.tex
+LaTeX2e <2017-04-15>
+Babel <3.10> and hyphenation patterns for 84 language(s) loaded.
+(/TexLive/texmf-dist/tex/latex/base/article.cls
+Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
+(/TexLive/texmf-dist/tex/latex/base/size10.clo
+File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
+)
+\c@part=\count79
+\c@section=\count80
+\c@subsection=\count81
+\c@subsubsection=\count82
+\c@paragraph=\count83
+\c@subparagraph=\count84
+\c@figure=\count85
+\c@table=\count86
+\abovecaptionskip=\skip41
+\belowcaptionskip=\skip42
+\bibindent=\dimen102
+)
+(/TexLive/texmf-dist/tex/latex/multirow/bigstrut.sty
+Package: bigstrut 2016/11/25 v2.2 Provide larger struts in tabulars
+\bigstrutjot=\dimen103
+)
+(/TexLive/texmf-dist/tex/latex/multirow/multirow.sty
+Package: multirow 2016/11/25 v2.2 Span multiple rows of a table
+\multirow@colwidth=\skip43
+\multirow@cntb=\count87
+\multirow@dima=\skip44
+) (./parent.aux)
+\openout1 = `parent.aux'.
+
+LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 6.
+LaTeX Font Info: ... okay on input line 6.
+LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 6.
+LaTeX Font Info: ... okay on input line 6.
+LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 6.
+LaTeX Font Info: ... okay on input line 6.
+LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 6.
+LaTeX Font Info: ... okay on input line 6.
+LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 6.
+LaTeX Font Info: ... okay on input line 6.
+LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 6.
+LaTeX Font Info: ... okay on input line 6.
+
+Overfull \hbox (200.00162pt too wide) in paragraph at lines 8--9
+[]\OT1/cmr/m/n/10 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+ []
+
+LaTeX Font Info: External font `cmex10' loaded for size
+(Font) <7> on input line 11.
+LaTeX Font Info: External font `cmex10' loaded for size
+(Font) <5> on input line 11.
+
+Overfull \vbox (3.19998pt too high) detected at line 23
+ []
+
+[1
+
+{/TexLive/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./parent.aux) )
+Here is how much of TeX's memory you used:
+ 265 strings out of 492995
+ 3121 string characters out of 6138727
+ 55074 words of memory out of 5000000
+ 3896 multiletter control sequences out of 15000+600000
+ 3640 words of font info for 14 fonts, out of 8000000 for 9000
+ 1141 hyphenation exceptions out of 8191
+ 23i,20n,20p,124b,282s stack positions out of 5000i,500n,10000p,200000b,80000s
+</
+TexLive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></TexLive/texmf-d
+ist/fonts/type1/public/amsfonts/cm/cmr7.pfb>
+Output written on parent.pdf (1 page, 17505 bytes).
+PDF statistics:
+ 16 PDF objects out of 1000 (max. 8388607)
+ 10 compressed objects within 1 object stream
+ 0 named destinations out of 1000 (max. 500000)
+ 1 words of extra memory for PDF output out of 10000 (max. 10000000)
+
diff --git a/support/texlab/tests/logs/child-error.log b/support/texlab/tests/logs/child-error.log
new file mode 100644
index 0000000000..d40d9201f4
--- /dev/null
+++ b/support/texlab/tests/logs/child-error.log
@@ -0,0 +1,65 @@
+This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/W32TeX) (preloaded format=pdflatex 2018.3.30) 26 DEC 2018 16:52
+entering extended mode
+ restricted \write18 enabled.
+ %&-line parsing enabled.
+**./parent.tex
+(./parent.tex
+LaTeX2e <2017-04-15>
+Babel <3.10> and hyphenation patterns for 84 language(s) loaded.
+(/TexLive/texmf-dist/tex/latex/base/article.cls
+Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
+(/TexLive/texmf-dist/tex/latex/base/size10.clo
+File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
+)
+\c@part=\count79
+\c@section=\count80
+\c@subsection=\count81
+\c@subsubsection=\count82
+\c@paragraph=\count83
+\c@subparagraph=\count84
+\c@figure=\count85
+\c@table=\count86
+\abovecaptionskip=\skip41
+\belowcaptionskip=\skip42
+\bibindent=\dimen102
+) (./parent.aux (./child.aux))
+\openout1 = `parent.aux'.
+
+LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 4.
+LaTeX Font Info: ... okay on input line 4.
+LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 4.
+LaTeX Font Info: ... okay on input line 4.
+LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 4.
+LaTeX Font Info: ... okay on input line 4.
+LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 4.
+LaTeX Font Info: ... okay on input line 4.
+LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 4.
+LaTeX Font Info: ... okay on input line 4.
+LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 4.
+LaTeX Font Info: ... okay on input line 4.
+(./child.tex
+! Undefined control sequence.
+l.1 \foo
+
+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.
+
+) (./parent.aux) )
+Here is how much of TeX's memory you used:
+ 205 strings out of 492995
+ 2149 string characters out of 6138727
+ 54074 words of memory out of 5000000
+ 3841 multiletter control sequences out of 15000+600000
+ 3640 words of font info for 14 fonts, out of 8000000 for 9000
+ 1141 hyphenation exceptions out of 8191
+ 23i,1n,17p,116b,36s 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)
+
diff --git a/support/texlab/tests/logs/citation-warning.log b/support/texlab/tests/logs/citation-warning.log
new file mode 100644
index 0000000000..0fae25fd4f
--- /dev/null
+++ b/support/texlab/tests/logs/citation-warning.log
@@ -0,0 +1,67 @@
+This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/W32TeX) (preloaded format=pdflatex 2018.3.30) 26 DEC 2018 16:51
+entering extended mode
+ restricted \write18 enabled.
+ %&-line parsing enabled.
+**./parent.tex
+(./parent.tex
+LaTeX2e <2017-04-15>
+Babel <3.10> and hyphenation patterns for 84 language(s) loaded.
+(/TexLive/texmf-dist/tex/latex/base/article.cls
+Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
+(/TexLive/texmf-dist/tex/latex/base/size10.clo
+File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
+)
+\c@part=\count79
+\c@section=\count80
+\c@subsection=\count81
+\c@subsubsection=\count82
+\c@paragraph=\count83
+\c@subparagraph=\count84
+\c@figure=\count85
+\c@table=\count86
+\abovecaptionskip=\skip41
+\belowcaptionskip=\skip42
+\bibindent=\dimen102
+) (./parent.aux)
+\openout1 = `parent.aux'.
+
+LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 4.
+LaTeX Font Info: ... okay on input line 4.
+LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 4.
+LaTeX Font Info: ... okay on input line 4.
+LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 4.
+LaTeX Font Info: ... okay on input line 4.
+LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 4.
+LaTeX Font Info: ... okay on input line 4.
+LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 4.
+LaTeX Font Info: ... okay on input line 4.
+LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 4.
+LaTeX Font Info: ... okay on input line 4.
+
+
+LaTeX Warning: Citation `foo' on page 1 undefined on input line 6.
+
+[1
+
+{/TexLive/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./parent.aux)
+
+LaTeX Warning: There were undefined references.
+
+ )
+Here is how much of TeX's memory you used:
+ 204 strings out of 492995
+ 2142 string characters out of 6138727
+ 54074 words of memory out of 5000000
+ 3842 multiletter control sequences out of 15000+600000
+ 3948 words of font info for 15 fonts, out of 8000000 for 9000
+ 1141 hyphenation exceptions out of 8191
+ 23i,4n,21p,116b,107s stack positions out of 5000i,500n,10000p,200000b,80000s
+</TexLive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></TexLive/
+texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
+Output written on parent.pdf (1 page, 17339 bytes).
+PDF statistics:
+ 16 PDF objects out of 1000 (max. 8388607)
+ 10 compressed objects within 1 object stream
+ 0 named destinations out of 1000 (max. 500000)
+ 1 words of extra memory for PDF output out of 10000 (max. 10000000)
+
diff --git a/support/texlab/tests/logs/package-error.log b/support/texlab/tests/logs/package-error.log
new file mode 100644
index 0000000000..e79f1e851c
--- /dev/null
+++ b/support/texlab/tests/logs/package-error.log
@@ -0,0 +1,86 @@
+This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/W32TeX) (preloaded format=pdflatex 2018.3.30) 26 DEC 2018 16:40
+entering extended mode
+ restricted \write18 enabled.
+ %&-line parsing enabled.
+**./parent.tex
+(./parent.tex
+LaTeX2e <2017-04-15>
+Babel <3.10> and hyphenation patterns for 84 language(s) loaded.
+(/TexLive/texmf-dist/tex/latex/base/article.cls
+Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
+(/TexLive/texmf-dist/tex/latex/base/size10.clo
+File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
+)
+\c@part=\count79
+\c@section=\count80
+\c@subsection=\count81
+\c@subsubsection=\count82
+\c@paragraph=\count83
+\c@subparagraph=\count84
+\c@figure=\count85
+\c@table=\count86
+\abovecaptionskip=\skip41
+\belowcaptionskip=\skip42
+\bibindent=\dimen102
+)
+(/TexLive/texmf-dist/tex/generic/babel/babel.sty
+Package: babel 2017/05/19 3.10 The Babel package
+
+
+! Package babel Error: Unknown option `foo'. Either you misspelled it
+(babel) or the language definition file foo.ldf was not found.
+
+See the babel package documentation for explanation.
+Type H <return> for immediate help.
+ ...
+
+l.393 \ProcessOptions*
+
+Valid options are: shorthands=, KeepShorthandsActive,
+activeacute, activegrave, noconfigs, safe=, main=, math=
+headfoot=, strings=, config=, hyphenmap=, or a language name.
+
+
+! Package babel Error: You haven't specified a language option.
+
+See the babel package documentation for explanation.
+Type H <return> for immediate help.
+ ...
+
+l.426 ...ry to proceed from here, type x to quit.}
+
+You need to specify a language, either as a global option
+or as an optional argument to the \usepackage command;
+You shouldn't try to proceed from here, type x to quit.
+
+) (./parent.aux)
+\openout1 = `parent.aux'.
+
+LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 5.
+LaTeX Font Info: ... okay on input line 5.
+LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 5.
+LaTeX Font Info: ... okay on input line 5.
+LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 5.
+LaTeX Font Info: ... okay on input line 5.
+LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 5.
+LaTeX Font Info: ... okay on input line 5.
+LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 5.
+LaTeX Font Info: ... okay on input line 5.
+LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 5.
+LaTeX Font Info: ... okay on input line 5.
+ (./parent.aux) )
+Here is how much of TeX's memory you used:
+ 304 strings out of 492995
+ 3421 string characters out of 6138727
+ 56035 words of memory out of 5000000
+ 3938 multiletter control sequences out of 15000+600000
+ 3640 words of font info for 14 fonts, out of 8000000 for 9000
+ 1141 hyphenation exceptions out of 8191
+ 23i,1n,17p,116b,36s 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)
+
diff --git a/support/texlab/tests/logs/package-warning.log b/support/texlab/tests/logs/package-warning.log
new file mode 100644
index 0000000000..f3c4769e52
--- /dev/null
+++ b/support/texlab/tests/logs/package-warning.log
@@ -0,0 +1,387 @@
+This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/W32TeX) (preloaded format=pdflatex 2018.3.30) 26 DEC 2018 16:45
+entering extended mode
+ restricted \write18 enabled.
+ %&-line parsing enabled.
+**./parent.tex
+(./parent.tex
+LaTeX2e <2017-04-15>
+Babel <3.10> and hyphenation patterns for 84 language(s) loaded.
+(/TexLive/texmf-dist/tex/latex/base/article.cls
+Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
+(/TexLive/texmf-dist/tex/latex/base/size10.clo
+File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
+)
+\c@part=\count79
+\c@section=\count80
+\c@subsection=\count81
+\c@subsubsection=\count82
+\c@paragraph=\count83
+\c@subparagraph=\count84
+\c@figure=\count85
+\c@table=\count86
+\abovecaptionskip=\skip41
+\belowcaptionskip=\skip42
+\bibindent=\dimen102
+)
+(/TexLive/texmf-dist/tex/generic/babel/babel.sty
+Package: babel 2017/05/19 3.10 The Babel package
+
+(/TexLive/texmf-dist/tex/generic/babel-spanish/spanish.ldf
+Language: spanish.ldf 2016/03/03 v5.0p Spanish support from the babel system
+
+(/TexLive/texmf-dist/tex/generic/babel/babel.def
+File: babel.def 2017/05/19 3.10 Babel common definitions
+\babel@savecnt=\count87
+\U@D=\dimen103
+)
+\es@quottoks=\toks14
+\es@quotdepth=\count88
+Package babel Info: Making " an active character on input line 561.
+Package babel Info: Making . an active character on input line 662.
+Package babel Info: Making < an active character on input line 707.
+Package babel Info: Making > an active character on input line 707.
+))
+(/TexLive/texmf-dist/tex/latex/biblatex/biblatex.sty
+Package: biblatex 2016/12/05 v3.7 programmable bibliographies (PK/JW/AB)
+
+(/TexLive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
+Package: pdftexcmds 2017/03/19 v0.25 Utility functions of pdfTeX for LuaTeX (HO
+)
+
+(/TexLive/texmf-dist/tex/generic/oberdiek/infwarerr.sty
+Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO)
+)
+(/TexLive/texmf-dist/tex/generic/oberdiek/ifluatex.sty
+Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO)
+Package ifluatex Info: LuaTeX not detected.
+)
+(/TexLive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty
+Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
+)
+(/TexLive/texmf-dist/tex/generic/oberdiek/ifpdf.sty
+Package: ifpdf 2017/03/15 v3.2 Provides the ifpdf switch
+)
+Package pdftexcmds Info: LuaTeX not detected.
+Package pdftexcmds Info: \pdf@primitive is available.
+Package pdftexcmds Info: \pdf@ifprimitive is available.
+Package pdftexcmds Info: \pdfdraftmode found.
+)
+(/TexLive/texmf-dist/tex/latex/etoolbox/etoolbox.sty
+Package: etoolbox 2017/01/02 v2.4 e-TeX tools for LaTeX (JAW)
+\etb@tempcnta=\count89
+)
+(/TexLive/texmf-dist/tex/latex/graphics/keyval.sty
+Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
+\KV@toks@=\toks15
+)
+(/TexLive/texmf-dist/tex/latex/oberdiek/kvoptions.sty
+Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO)
+
+(/TexLive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
+Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO)
+
+(/TexLive/texmf-dist/tex/generic/oberdiek/etexcmds.sty
+Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
+Package etexcmds Info: Could not find \expanded.
+(etexcmds) That can mean that you are not using pdfTeX 1.50 or
+(etexcmds) that some package has redefined \expanded.
+(etexcmds) In the latter case, load this package earlier.
+)))
+(/TexLive/texmf-dist/tex/latex/logreq/logreq.sty
+Package: logreq 2010/08/04 v1.0 xml request logger
+\lrq@indent=\count90
+
+(/TexLive/texmf-dist/tex/latex/logreq/logreq.def
+File: logreq.def 2010/08/04 v1.0 logreq spec v1.0
+))
+(/TexLive/texmf-dist/tex/latex/base/ifthen.sty
+Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
+)
+(/TexLive/texmf-dist/tex/latex/url/url.sty
+\Urlmuskip=\muskip10
+Package: url 2013/09/16 ver 3.4 Verb mode for urls, etc.
+)
+(/TexLive/texmf-dist/tex/generic/xstring/xstring.sty
+(/TexLive/texmf-dist/tex/generic/xstring/xstring.tex
+\@xs@message=\write3
+\integerpart=\count91
+\decimalpart=\count92
+)
+Package: xstring 2013/10/13 v1.7c String manipulations (C Tellechea)
+)
+\c@tabx@nest=\count93
+\c@listtotal=\count94
+\c@listcount=\count95
+\c@liststart=\count96
+\c@liststop=\count97
+\c@citecount=\count98
+\c@citetotal=\count99
+\c@multicitecount=\count100
+\c@multicitetotal=\count101
+\c@instcount=\count102
+\c@maxnames=\count103
+\c@minnames=\count104
+\c@maxitems=\count105
+\c@minitems=\count106
+\c@citecounter=\count107
+\c@savedcitecounter=\count108
+\c@uniquelist=\count109
+\c@uniquename=\count110
+\c@refsection=\count111
+\c@refsegment=\count112
+\c@maxextratitle=\count113
+\c@maxextratitleyear=\count114
+\c@maxextrayear=\count115
+\c@maxextraalpha=\count116
+\c@abbrvpenalty=\count117
+\c@highnamepenalty=\count118
+\c@lownamepenalty=\count119
+\c@maxparens=\count120
+\c@parenlevel=\count121
+\blx@tempcnta=\count122
+\blx@tempcntb=\count123
+\blx@tempcntc=\count124
+\blx@maxsection=\count125
+\blx@maxsegment@0=\count126
+\blx@notetype=\count127
+\blx@parenlevel@text=\count128
+\blx@parenlevel@foot=\count129
+\blx@sectionciteorder@0=\count130
+\labelnumberwidth=\skip43
+\labelalphawidth=\skip44
+\biblabelsep=\skip45
+\bibitemsep=\skip46
+\bibnamesep=\skip47
+\bibinitsep=\skip48
+\bibparsep=\skip49
+\bibhang=\skip50
+\blx@bcfin=\read1
+\blx@bcfout=\write4
+\c@mincomprange=\count131
+\c@maxcomprange=\count132
+\c@mincompwidth=\count133
+Package biblatex Info: Trying to load biblatex default data model...
+Package biblatex Info: ... file 'blx-dm.def' found.
+
+(/TexLive/texmf-dist/tex/latex/biblatex/blx-dm.def)
+Package biblatex Info: Trying to load biblatex style data model...
+Package biblatex Info: ... file 'ieee.dbx' not found.
+Package biblatex Info: Trying to load biblatex custom data model...
+Package biblatex Info: ... file 'biblatex-dm.cfg' not found.
+\c@afterword=\count134
+\c@savedafterword=\count135
+\c@annotator=\count136
+\c@savedannotator=\count137
+\c@author=\count138
+\c@savedauthor=\count139
+\c@bookauthor=\count140
+\c@savedbookauthor=\count141
+\c@commentator=\count142
+\c@savedcommentator=\count143
+\c@editor=\count144
+\c@savededitor=\count145
+\c@editora=\count146
+\c@savededitora=\count147
+\c@editorb=\count148
+\c@savededitorb=\count149
+\c@editorc=\count150
+\c@savededitorc=\count151
+\c@foreword=\count152
+\c@savedforeword=\count153
+\c@holder=\count154
+\c@savedholder=\count155
+\c@introduction=\count156
+\c@savedintroduction=\count157
+\c@namea=\count158
+\c@savednamea=\count159
+\c@nameb=\count160
+\c@savednameb=\count161
+\c@namec=\count162
+\c@savednamec=\count163
+\c@translator=\count164
+\c@savedtranslator=\count165
+\c@shortauthor=\count166
+\c@savedshortauthor=\count167
+\c@shorteditor=\count168
+\c@savedshorteditor=\count169
+\c@labelname=\count170
+\c@savedlabelname=\count171
+\c@institution=\count172
+\c@savedinstitution=\count173
+\c@lista=\count174
+\c@savedlista=\count175
+\c@listb=\count176
+\c@savedlistb=\count177
+\c@listc=\count178
+\c@savedlistc=\count179
+\c@listd=\count180
+\c@savedlistd=\count181
+\c@liste=\count182
+\c@savedliste=\count183
+\c@listf=\count184
+\c@savedlistf=\count185
+\c@location=\count186
+\c@savedlocation=\count187
+\c@organization=\count188
+\c@savedorganization=\count189
+\c@origlocation=\count190
+\c@savedoriglocation=\count191
+\c@origpublisher=\count192
+\c@savedorigpublisher=\count193
+\c@publisher=\count194
+\c@savedpublisher=\count195
+\c@language=\count196
+\c@savedlanguage=\count197
+\c@pageref=\count198
+\c@savedpageref=\count199
+\shorthandwidth=\skip51
+\shortjournalwidth=\skip52
+\shortserieswidth=\skip53
+\shorttitlewidth=\skip54
+\shortauthorwidth=\skip55
+\shorteditorwidth=\skip56
+Package biblatex Info: Trying to load compatibility code...
+Package biblatex Info: ... file 'blx-compat.def' found.
+
+(/TexLive/texmf-dist/tex/latex/biblatex/blx-compat.def
+File: blx-compat.def 2016/12/05 v3.7 biblatex compatibility (PK/JW/AB)
+)
+Package biblatex Info: Trying to load generic definitions...
+Package biblatex Info: ... file 'biblatex.def' found.
+
+(/TexLive/texmf-dist/tex/latex/biblatex/biblatex.def
+File: biblatex.def 2016/12/05 v3.7 biblatex compatibility (PK/JW/AB)
+\c@textcitecount=\count266
+\c@textcitetotal=\count267
+\c@textcitemaxnames=\count268
+\c@biburlnumpenalty=\count269
+\c@biburlucpenalty=\count270
+\c@biburllcpenalty=\count271
+\c@smartand=\count272
+)
+Package biblatex Info: Trying to load bibliography style 'ieee'...
+Package biblatex Info: ... file 'ieee.bbx' found.
+
+(/TexLive/texmf-dist/tex/latex/biblatex-ieee/ieee.bbx
+File: ieee.bbx 2017/03/27 v1.2d biblatex bibliography style
+Package biblatex Info: Trying to load bibliography style 'numeric-comp'...
+Package biblatex Info: ... file 'numeric-comp.bbx' found.
+
+(/TexLive/texmf-dist/tex/latex/biblatex/bbx/numeric-comp.bbx
+File: numeric-comp.bbx 2016/12/05 v3.7 biblatex bibliography style (PK/JW/AB)
+Package biblatex Info: Trying to load bibliography style 'numeric'...
+Package biblatex Info: ... file 'numeric.bbx' found.
+
+(/TexLive/texmf-dist/tex/latex/biblatex/bbx/numeric.bbx
+File: numeric.bbx 2016/12/05 v3.7 biblatex bibliography style (PK/JW/AB)
+Package biblatex Info: Trying to load bibliography style 'standard'...
+Package biblatex Info: ... file 'standard.bbx' found.
+
+(/TexLive/texmf-dist/tex/latex/biblatex/bbx/standard.bbx
+File: standard.bbx 2016/12/05 v3.7 biblatex bibliography style (PK/JW/AB)
+\c@bbx:relatedcount=\count273
+\c@bbx:relatedtotal=\count274
+))))
+Package biblatex Info: Trying to load citation style 'ieee'...
+Package biblatex Info: ... file 'ieee.cbx' found.
+
+(/TexLive/texmf-dist/tex/latex/biblatex-ieee/ieee.cbx
+File: ieee.cbx 2017/03/27 v1.2d biblatex citation style
+Package biblatex Info: Trying to load citation style 'numeric-comp'...
+Package biblatex Info: ... file 'numeric-comp.cbx' found.
+
+(/TexLive/texmf-dist/tex/latex/biblatex/cbx/numeric-comp.cbx
+File: numeric-comp.cbx 2016/12/05 v3.7 biblatex citation style (PK/JW/AB)
+\c@cbx@tempcnta=\count275
+\c@cbx@tempcntb=\count276
+Package biblatex Info: Redefining '\cite'.
+Package biblatex Info: Redefining '\parencite'.
+Package biblatex Info: Redefining '\footcite'.
+Package biblatex Info: Redefining '\footcitetext'.
+Package biblatex Info: Redefining '\smartcite'.
+Package biblatex Info: Redefining '\supercite'.
+Package biblatex Info: Redefining '\textcite'.
+Package biblatex Info: Redefining '\textcites'.
+Package biblatex Info: Redefining '\cites'.
+Package biblatex Info: Redefining '\parencites'.
+Package biblatex Info: Redefining '\smartcites'.
+)
+Package biblatex Info: Redefining '\cite'.
+Package biblatex Info: Redefining '\cites'.
+)
+Package biblatex Info: Trying to load configuration file...
+Package biblatex Info: ... file 'biblatex.cfg' found.
+
+(/TexLive/texmf-dist/tex/latex/biblatex/biblatex.cfg
+File: biblatex.cfg
+))
+Package biblatex Info: Trying to load language 'spanish'...
+Package biblatex Info: ... file 'spanish.lbx' found.
+
+(/TexLive/texmf-dist/tex/latex/biblatex/lbx/spanish.lbx
+File: spanish.lbx 2016/12/05 v3.7 biblatex localization (PK/JW/AB)
+)
+
+Package biblatex Warning: 'babel/polyglossia' detected but 'csquotes' missing.
+(biblatex) Loading 'csquotes' recommended.
+
+\@quotelevel=\count277
+\@quotereset=\count278
+(./parent.aux)
+\openout1 = `parent.aux'.
+
+LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 6.
+LaTeX Font Info: ... okay on input line 6.
+LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 6.
+LaTeX Font Info: ... okay on input line 6.
+LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 6.
+LaTeX Font Info: ... okay on input line 6.
+LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 6.
+LaTeX Font Info: ... okay on input line 6.
+LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 6.
+LaTeX Font Info: ... okay on input line 6.
+LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 6.
+LaTeX Font Info: ... okay on input line 6.
+LaTeX Info: Redefining \sptext on input line 6.
+LaTeX Info: Redefining \. on input line 6.
+LaTeX Info: Redefining \% on input line 6.
+Package biblatex Info: No input encoding detected.
+(biblatex) Assuming 'ascii'.
+Package biblatex Info: Automatic encoding selection.
+(biblatex) Assuming data encoding 'ascii'.
+\openout4 = `parent.bcf'.
+
+Package biblatex Info: Trying to load bibliographic data...
+Package biblatex Info: ... file 'parent.bbl' not found.
+
+No file parent.bbl.
+Package biblatex Info: Reference section=0 on input line 6.
+Package biblatex Info: Reference segment=0 on input line 6.
+(./parent.aux)
+
+LaTeX Warning: There were undefined references.
+
+
+Package biblatex Warning: Please (re)run Biber on the file:
+(biblatex) parent
+(biblatex) and rerun LaTeX afterwards.
+
+Package logreq Info: Writing requests to 'parent.run.xml'.
+\openout1 = `parent.run.xml'.
+
+ )
+Here is how much of TeX's memory you used:
+ 7717 strings out of 492995
+ 133301 string characters out of 6138727
+ 557258 words of memory out of 5000000
+ 11248 multiletter control sequences out of 15000+600000
+ 3640 words of font info for 14 fonts, out of 8000000 for 9000
+ 1141 hyphenation exceptions out of 8191
+ 35i,1n,30p,856b,700s 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)
+
diff --git a/support/texlab/tests/logs/tex-error.log b/support/texlab/tests/logs/tex-error.log
new file mode 100644
index 0000000000..33648f7f66
--- /dev/null
+++ b/support/texlab/tests/logs/tex-error.log
@@ -0,0 +1,125 @@
+This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/W32TeX) (preloaded format=pdflatex 2018.3.30) 26 DEC 2018 16:33
+entering extended mode
+ restricted \write18 enabled.
+ %&-line parsing enabled.
+**./parent.tex
+(./parent.tex
+LaTeX2e <2017-04-15>
+Babel <3.10> and hyphenation patterns for 84 language(s) loaded.
+(/TexLive/texmf-dist/tex/latex/base/article.cls
+Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
+(/TexLive/texmf-dist/tex/latex/base/size10.clo
+File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
+)
+\c@part=\count79
+\c@section=\count80
+\c@subsection=\count81
+\c@subsubsection=\count82
+\c@paragraph=\count83
+\c@subparagraph=\count84
+\c@figure=\count85
+\c@table=\count86
+\abovecaptionskip=\skip41
+\belowcaptionskip=\skip42
+\bibindent=\dimen102
+) (./parent.aux
+(./child.tex.aux))
+\openout1 = `parent.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 T1/cmr/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 OMS/cmsy/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.
+\openout2 = `child.aux'.
+
+ (./child.tex)
+! Undefined control sequence.
+l.7 \foo
+
+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.
+
+! Missing $ inserted.
+<inserted text>
+ $
+l.8 \bar
+
+I've inserted a begin-math/end-math symbol since I think
+you left one out. Proceed, with fingers crossed.
+
+LaTeX Font Info: External font `cmex10' loaded for size
+(Font) <7> on input line 8.
+LaTeX Font Info: External font `cmex10' loaded for size
+(Font) <5> on input line 8.
+! Undefined control sequence.
+l.9 \baz
+
+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.
+
+! Missing { inserted.
+<to be read again>
+ \par
+l.10
+
+A left brace was mandatory here, so I've put one in.
+You might want to delete and/or insert some corrections
+so that I will find a matching right brace soon.
+(If you're confused by all this, try typing `I}' now.)
+
+! Missing $ inserted.
+<inserted text>
+ $
+l.10
+
+I've inserted a begin-math/end-math symbol since I think
+you left one out. Proceed, with fingers crossed.
+
+! Missing } inserted.
+<inserted text>
+ }
+l.10
+
+I've inserted something that you may have forgotten.
+(See the <inserted text> above.)
+With luck, this will get me unwedged. But if you
+really didn't forget anything, try typing `2' now; then
+my insertion and my current dilemma will both disappear.
+
+[1
+
+
+
+{/TexLive/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./parent.aux
+(./child.aux)) )
+Here is how much of TeX's memory you used:
+ 212 strings out of 492995
+ 2238 string characters out of 6138727
+ 54074 words of memory out of 5000000
+ 3843 multiletter control sequences out of 15000+600000
+ 3640 words of font info for 14 fonts, out of 8000000 for 9000
+ 1141 hyphenation exceptions out of 8191
+ 23i,4n,17p,116b,107s stack positions out of 5000i,500n,10000p,200000b,80000s
+</TexLive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb
+>
+Output written on parent.pdf (1 page, 8329 bytes).
+PDF statistics:
+ 12 PDF objects out of 1000 (max. 8388607)
+ 7 compressed objects within 1 object stream
+ 0 named destinations out of 1000 (max. 500000)
+ 1 words of extra memory for PDF output out of 10000 (max. 10000000)
+
diff --git a/support/texlab/tests/scenarios/completion/bibtex/command/foo.bib b/support/texlab/tests/scenarios/completion/bibtex/command/foo.bib
new file mode 100644
index 0000000000..918669ba68
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/bibtex/command/foo.bib
@@ -0,0 +1,7 @@
+@article{foo,
+ author = {\LaT
+}
+
+@article{foo,
+ author = {\LaT}
+}
diff --git a/support/texlab/tests/scenarios/completion/bibtex/field/foo.bib b/support/texlab/tests/scenarios/completion/bibtex/field/foo.bib
new file mode 100644
index 0000000000..6a24acd646
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/bibtex/field/foo.bib
@@ -0,0 +1,6 @@
+@article{foo,
+ titl
+
+@article{foo,
+ title = {}
+} \ No newline at end of file
diff --git a/support/texlab/tests/scenarios/completion/bibtex/type/foo.bib b/support/texlab/tests/scenarios/completion/bibtex/type/foo.bib
new file mode 100644
index 0000000000..2c645612b9
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/bibtex/type/foo.bib
@@ -0,0 +1,3 @@
+@
+@art
+@article
diff --git a/support/texlab/tests/scenarios/completion/bibtex/word/foo.bib b/support/texlab/tests/scenarios/completion/bibtex/word/foo.bib
new file mode 100644
index 0000000000..b2b9e862db
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/bibtex/word/foo.bib
@@ -0,0 +1,8 @@
+
+@article{foo,
+ author = {},
+}
+
+@comment{foo,
+ author = {},
+}
diff --git a/support/texlab/tests/scenarios/completion/latex/citation/bar.bib b/support/texlab/tests/scenarios/completion/latex/citation/bar.bib
new file mode 100644
index 0000000000..d96336de26
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/latex/citation/bar.bib
@@ -0,0 +1,7 @@
+@article{foo:2019,
+ author = {Foo Bar},
+ title = {Baz Qux},
+ year = {2019},
+}
+
+@article{bar:2005,}
diff --git a/support/texlab/tests/scenarios/completion/latex/citation/foo.tex b/support/texlab/tests/scenarios/completion/latex/citation/foo.tex
new file mode 100644
index 0000000000..fd75f22698
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/latex/citation/foo.tex
@@ -0,0 +1,8 @@
+\documentclass{article}
+\bibliography{bar}
+
+\begin{document}
+
+\cite{
+
+\end{document} \ No newline at end of file
diff --git a/support/texlab/tests/scenarios/completion/latex/color/foo.tex b/support/texlab/tests/scenarios/completion/latex/color/foo.tex
new file mode 100644
index 0000000000..72df702d12
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/latex/color/foo.tex
@@ -0,0 +1,3 @@
+\color{re}
+\definecolor{foo}{
+\definecolorset{R}
diff --git a/support/texlab/tests/scenarios/completion/latex/component/foo.tex b/support/texlab/tests/scenarios/completion/latex/component/foo.tex
new file mode 100644
index 0000000000..991b7f5f68
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/latex/component/foo.tex
@@ -0,0 +1,8 @@
+\documentclass{book}
+\usepackage{amsmath}
+\chap
+\varDel
+\begin{theind}
+\end{alig}
+\begin{doc}
+\vareps
diff --git a/support/texlab/tests/scenarios/completion/latex/include/bar.tex b/support/texlab/tests/scenarios/completion/latex/include/bar.tex
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/latex/include/bar.tex
diff --git a/support/texlab/tests/scenarios/completion/latex/include/bibliography.bib b/support/texlab/tests/scenarios/completion/latex/include/bibliography.bib
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/latex/include/bibliography.bib
diff --git a/support/texlab/tests/scenarios/completion/latex/include/foo.tex b/support/texlab/tests/scenarios/completion/latex/include/foo.tex
new file mode 100644
index 0000000000..545f78c491
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/latex/include/foo.tex
@@ -0,0 +1,7 @@
+\documentclass{article}
+
+\include{}
+\input{}
+\input{qux/}
+\addbibresource{}
+
diff --git a/support/texlab/tests/scenarios/completion/latex/include/qux/baz.tex b/support/texlab/tests/scenarios/completion/latex/include/qux/baz.tex
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/latex/include/qux/baz.tex
diff --git a/support/texlab/tests/scenarios/completion/latex/label/bar.aux b/support/texlab/tests/scenarios/completion/latex/label/bar.aux
new file mode 100644
index 0000000000..8d3449db60
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/latex/label/bar.aux
@@ -0,0 +1,25 @@
+\relax
+\@writefile{toc}{\contentsline {section}{\numberline {2}Bar}{2}\protected@file@percent }
+\newlabel{sec:bar}{{2}{2}}
+\@setckpt{bar}{
+\setcounter{page}{3}
+\setcounter{equation}{2}
+\setcounter{enumi}{0}
+\setcounter{enumii}{0}
+\setcounter{enumiii}{0}
+\setcounter{enumiv}{0}
+\setcounter{footnote}{0}
+\setcounter{mpfootnote}{0}
+\setcounter{part}{0}
+\setcounter{section}{2}
+\setcounter{subsection}{0}
+\setcounter{subsubsection}{0}
+\setcounter{paragraph}{0}
+\setcounter{subparagraph}{0}
+\setcounter{figure}{1}
+\setcounter{table}{0}
+\setcounter{parentequation}{0}
+\setcounter{caption@flags}{0}
+\setcounter{ContinuedFloat}{0}
+\setcounter{lemma}{1}
+}
diff --git a/support/texlab/tests/scenarios/completion/latex/label/bar.tex b/support/texlab/tests/scenarios/completion/latex/label/bar.tex
new file mode 100644
index 0000000000..97dea2908f
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/latex/label/bar.tex
@@ -0,0 +1,6 @@
+\section{Bar}%
+\label{sec:bar}
+
+Lorem ipsum dolor sit amet.
+\ref{}
+\eqref{}
diff --git a/support/texlab/tests/scenarios/completion/latex/label/foo.aux b/support/texlab/tests/scenarios/completion/latex/label/foo.aux
new file mode 100644
index 0000000000..cc82940c6b
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/latex/label/foo.aux
@@ -0,0 +1,10 @@
+\relax
+\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Baz\relax }}{1}\protected@file@percent }
+\providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}}
+\newlabel{fig:baz}{{1}{1}}
+\@writefile{toc}{\contentsline {section}{\numberline {1}Foo}{1}\protected@file@percent }
+\newlabel{sec:foo}{{1}{1}}
+\newlabel{eq:foo}{{1}{1}}
+\newlabel{eq:bar}{{2}{1}}
+\newlabel{thm:foo}{{1}{1}}
+\@input{bar.aux}
diff --git a/support/texlab/tests/scenarios/completion/latex/label/foo.tex b/support/texlab/tests/scenarios/completion/latex/label/foo.tex
new file mode 100644
index 0000000000..c85be2fa36
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/latex/label/foo.tex
@@ -0,0 +1,36 @@
+\documentclass{article}
+
+\usepackage{amsmath}
+\usepackage{caption}
+\usepackage{amsthm}
+\newtheorem{lemma}{Lemma}
+
+\begin{document}
+
+\section{Foo}%
+\label{sec:foo}
+
+\begin{equation}%
+\label{eq:foo}
+ 1 + 1 = 2
+\end{equation}
+
+\begin{equation}%
+\label{eq:bar}
+ 1 + 1 = 2
+\end{equation}
+
+\begin{figure}%
+\LaTeX{}
+\caption{Baz}%
+\label{fig:baz}
+\end{figure}
+
+\begin{lemma}%
+\label{thm:foo}
+ 1 + 1 = 2
+\end{lemma}
+
+\include{bar}
+
+\end{document}
diff --git a/support/texlab/tests/scenarios/completion/latex/preselect/foo.tex b/support/texlab/tests/scenarios/completion/latex/preselect/foo.tex
new file mode 100644
index 0000000000..9f62299192
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/latex/preselect/foo.tex
@@ -0,0 +1,3 @@
+\begin{document}
+
+\end{
diff --git a/support/texlab/tests/scenarios/completion/latex/theorem/foo.tex b/support/texlab/tests/scenarios/completion/latex/theorem/foo.tex
new file mode 100644
index 0000000000..04b53ecd0e
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/latex/theorem/foo.tex
@@ -0,0 +1,5 @@
+\documentclass{article}
+\usepackage{amsthm}
+\newtheorem{foo}{Foo}
+
+\begin{f}
diff --git a/support/texlab/tests/scenarios/completion/latex/tikz/foo.tex b/support/texlab/tests/scenarios/completion/latex/tikz/foo.tex
new file mode 100644
index 0000000000..fde20c6336
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/latex/tikz/foo.tex
@@ -0,0 +1,3 @@
+\usepackage{tikz}
+\usepgflibrary{}
+\usetikzlibrary{}
diff --git a/support/texlab/tests/scenarios/completion/latex/user/foo.tex b/support/texlab/tests/scenarios/completion/latex/user/foo.tex
new file mode 100644
index 0000000000..e1bcaef2ab
--- /dev/null
+++ b/support/texlab/tests/scenarios/completion/latex/user/foo.tex
@@ -0,0 +1,5 @@
+\foo
+\fo
+\begin{foo}
+\end{foo}
+\begin{fo}
diff --git a/support/texlab/tests/scenarios/definition/bibtex/string/foo.bib b/support/texlab/tests/scenarios/definition/bibtex/string/foo.bib
new file mode 100644
index 0000000000..9326d87cdd
--- /dev/null
+++ b/support/texlab/tests/scenarios/definition/bibtex/string/foo.bib
@@ -0,0 +1,7 @@
+@string{foo = "Foo"}
+
+@string{bar = "Bar"}
+
+@article{baz,
+ author = bar
+}
diff --git a/support/texlab/tests/scenarios/definition/latex/citation/bar.bib b/support/texlab/tests/scenarios/definition/latex/citation/bar.bib
new file mode 100644
index 0000000000..af2d2d9e66
--- /dev/null
+++ b/support/texlab/tests/scenarios/definition/latex/citation/bar.bib
@@ -0,0 +1,3 @@
+@article{foo,}
+
+@article{bar,}
diff --git a/support/texlab/tests/scenarios/definition/latex/citation/baz.bib b/support/texlab/tests/scenarios/definition/latex/citation/baz.bib
new file mode 100644
index 0000000000..af2d2d9e66
--- /dev/null
+++ b/support/texlab/tests/scenarios/definition/latex/citation/baz.bib
@@ -0,0 +1,3 @@
+@article{foo,}
+
+@article{bar,}
diff --git a/support/texlab/tests/scenarios/definition/latex/citation/foo.tex b/support/texlab/tests/scenarios/definition/latex/citation/foo.tex
new file mode 100644
index 0000000000..a6d704b46d
--- /dev/null
+++ b/support/texlab/tests/scenarios/definition/latex/citation/foo.tex
@@ -0,0 +1,2 @@
+\bibliography{bar}
+\cite{bar}
diff --git a/support/texlab/tests/scenarios/definition/latex/command/foo.tex b/support/texlab/tests/scenarios/definition/latex/command/foo.tex
new file mode 100644
index 0000000000..29b8ea127e
--- /dev/null
+++ b/support/texlab/tests/scenarios/definition/latex/command/foo.tex
@@ -0,0 +1,3 @@
+\newcommand{\foo}{Foo}
+
+\foo
diff --git a/support/texlab/tests/scenarios/definition/latex/label/default.tex b/support/texlab/tests/scenarios/definition/latex/label/default.tex
new file mode 100644
index 0000000000..263c0e861e
--- /dev/null
+++ b/support/texlab/tests/scenarios/definition/latex/label/default.tex
@@ -0,0 +1,2 @@
+\label{foo}
+\ref{foo}
diff --git a/support/texlab/tests/scenarios/definition/latex/label/equation.tex b/support/texlab/tests/scenarios/definition/latex/label/equation.tex
new file mode 100644
index 0000000000..436d886457
--- /dev/null
+++ b/support/texlab/tests/scenarios/definition/latex/label/equation.tex
@@ -0,0 +1,6 @@
+\begin{equation}%
+\label{eq:foo}
+ Foo
+\end{equation}
+
+\ref{eq:foo}
diff --git a/support/texlab/tests/scenarios/definition/latex/label/float.tex b/support/texlab/tests/scenarios/definition/latex/label/float.tex
new file mode 100644
index 0000000000..9f3cd97fae
--- /dev/null
+++ b/support/texlab/tests/scenarios/definition/latex/label/float.tex
@@ -0,0 +1,7 @@
+\begin{figure}
+Foo
+\caption{Bar}
+\label{fig}
+\end{figure}
+
+\ref{fig}
diff --git a/support/texlab/tests/scenarios/definition/latex/label/item.tex b/support/texlab/tests/scenarios/definition/latex/label/item.tex
new file mode 100644
index 0000000000..a04034f0f8
--- /dev/null
+++ b/support/texlab/tests/scenarios/definition/latex/label/item.tex
@@ -0,0 +1,7 @@
+\begin{enumerate}
+ \item Foo
+ \item\label{bar} Bar
+ \item Baz
+\end{enumerate}
+
+\ref{bar}
diff --git a/support/texlab/tests/scenarios/definition/latex/label/section.tex b/support/texlab/tests/scenarios/definition/latex/label/section.tex
new file mode 100644
index 0000000000..9dd7eeec33
--- /dev/null
+++ b/support/texlab/tests/scenarios/definition/latex/label/section.tex
@@ -0,0 +1,7 @@
+\section{Foo}
+\label{sec:foo}
+
+\section{Bar}
+\label{sec:bar}
+
+\ref{sec:foo}
diff --git a/support/texlab/tests/scenarios/definition/latex/label/theorem.tex b/support/texlab/tests/scenarios/definition/latex/label/theorem.tex
new file mode 100644
index 0000000000..52cac48394
--- /dev/null
+++ b/support/texlab/tests/scenarios/definition/latex/label/theorem.tex
@@ -0,0 +1,9 @@
+\usepackage{amsthm}
+\newtheorem{lemma}{Lemma}
+
+\begin{lemma}%
+\label{thm:foo}
+ Foo
+\end{lemma}
+
+\ref{thm:foo}
diff --git a/support/texlab/tests/scenarios/definition/latex/math_operator/foo.tex b/support/texlab/tests/scenarios/definition/latex/math_operator/foo.tex
new file mode 100644
index 0000000000..1953dc269c
--- /dev/null
+++ b/support/texlab/tests/scenarios/definition/latex/math_operator/foo.tex
@@ -0,0 +1,3 @@
+\DeclareMathOperator{\foo}{foo}
+
+\foo
diff --git a/support/texlab/tests/scenarios/diagnostics/bibtex/foo.bib b/support/texlab/tests/scenarios/diagnostics/bibtex/foo.bib
new file mode 100644
index 0000000000..43890b16c1
--- /dev/null
+++ b/support/texlab/tests/scenarios/diagnostics/bibtex/foo.bib
@@ -0,0 +1 @@
+@article
diff --git a/support/texlab/tests/scenarios/diagnostics/build/foo.log b/support/texlab/tests/scenarios/diagnostics/build/foo.log
new file mode 100644
index 0000000000..e51517e553
--- /dev/null
+++ b/support/texlab/tests/scenarios/diagnostics/build/foo.log
@@ -0,0 +1,59 @@
+This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018/Arch Linux) (preloaded format=latex 2019.4.26) 31 MAY 2019 17:55
+entering extended mode
+ restricted \write18 enabled.
+ %&-line parsing enabled.
+**foo.tex
+(./foo.tex
+LaTeX2e <2018-12-01>
+(/usr/share/texmf-dist/tex/latex/base/article.cls
+Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
+(/usr/share/texmf-dist/tex/latex/base/size10.clo
+File: size10.clo 2018/09/03 v1.4i Standard LaTeX file (size option)
+)
+\c@part=\count80
+\c@section=\count81
+\c@subsection=\count82
+\c@subsubsection=\count83
+\c@paragraph=\count84
+\c@subparagraph=\count85
+\c@figure=\count86
+\c@table=\count87
+\abovecaptionskip=\skip41
+\belowcaptionskip=\skip42
+\bibindent=\dimen102
+) (./foo.aux)
+\openout1 = `foo.aux'.
+
+LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 2.
+LaTeX Font Info: ... okay on input line 2.
+LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 2.
+LaTeX Font Info: ... okay on input line 2.
+LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 2.
+LaTeX Font Info: ... okay on input line 2.
+LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 2.
+LaTeX Font Info: ... okay on input line 2.
+LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 2.
+LaTeX Font Info: ... okay on input line 2.
+LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 2.
+LaTeX Font Info: ... okay on input line 2.
+
+! Undefined control sequence.
+l.4 \foo
+
+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.
+
+(./foo.aux) )
+Here is how much of TeX's memory you used:
+ 199 strings out of 492617
+ 2074 string characters out of 6135203
+ 59592 words of memory out of 5000000
+ 4199 multiletter control sequences out of 15000+600000
+ 3640 words of font info for 14 fonts, out of 8000000 for 9000
+ 1141 hyphenation exceptions out of 8191
+ 23i,1n,17p,127b,36s stack positions out of 5000i,500n,10000p,200000b,80000s
+
+No pages of output.
diff --git a/support/texlab/tests/scenarios/diagnostics/build/foo.tex b/support/texlab/tests/scenarios/diagnostics/build/foo.tex
new file mode 100644
index 0000000000..d8c1e22e35
--- /dev/null
+++ b/support/texlab/tests/scenarios/diagnostics/build/foo.tex
@@ -0,0 +1,6 @@
+\documentclass{article}
+\begin{document}
+
+\foo
+
+\end{document}
diff --git a/support/texlab/tests/scenarios/folding/bar.bib b/support/texlab/tests/scenarios/folding/bar.bib
new file mode 100644
index 0000000000..a292b387fb
--- /dev/null
+++ b/support/texlab/tests/scenarios/folding/bar.bib
@@ -0,0 +1,24 @@
+@preamble{"Foo Bar Baz"}
+
+@string{foo = "foo"}
+
+@article{Rivest:1978:MOD:359340.359342,
+ author = {Rivest, R. L. and Shamir, A. and Adleman, L.},
+ title = {A Method for Obtaining Digital Signatures and Public-key Cryptosystems},
+ journal = {Commun. ACM},
+ issue_date = {Feb. 1978},
+ volume = {21},
+ number = {2},
+ month = feb,
+ year = {1978},
+ issn = {0001-0782},
+ pages = {120--126},
+ numpages = {7},
+ url = {http://doi.acm.org/10.1145/359340.359342},
+ doi = {10.1145/359340.359342},
+ acmid = {359342},
+ publisher = {ACM},
+ address = {New York, NY, USA},
+ keywords = {authentication, cryptography, digital signatures, electronic funds transfer, electronic mail,
+ factorization, message-passing, prime number, privacy, public-key cryptosystems, security},
+}
diff --git a/support/texlab/tests/scenarios/folding/foo.tex b/support/texlab/tests/scenarios/folding/foo.tex
new file mode 100644
index 0000000000..a742bad397
--- /dev/null
+++ b/support/texlab/tests/scenarios/folding/foo.tex
@@ -0,0 +1,13 @@
+\documentclass{article}
+
+\usepackage{amsmath}
+
+\begin{document}
+
+\section{Foo}
+
+\subsection{Bar}
+
+\section{Baz}
+
+\end{document}
diff --git a/support/texlab/tests/scenarios/formatting/bibtex/default/formatted.bib b/support/texlab/tests/scenarios/formatting/bibtex/default/formatted.bib
new file mode 100644
index 0000000000..1044ed1efd
--- /dev/null
+++ b/support/texlab/tests/scenarios/formatting/bibtex/default/formatted.bib
@@ -0,0 +1,4 @@
+@article{foo,
+ author = {Foo Bar},
+ title = {Baz Qux},
+} \ No newline at end of file
diff --git a/support/texlab/tests/scenarios/formatting/bibtex/default/unformatted.bib b/support/texlab/tests/scenarios/formatting/bibtex/default/unformatted.bib
new file mode 100644
index 0000000000..e8d1b9c403
--- /dev/null
+++ b/support/texlab/tests/scenarios/formatting/bibtex/default/unformatted.bib
@@ -0,0 +1 @@
+@article{foo, author = {Foo Bar}, title = {Baz Qux}}
diff --git a/support/texlab/tests/scenarios/formatting/bibtex/infinite_line_length/formatted.bib b/support/texlab/tests/scenarios/formatting/bibtex/infinite_line_length/formatted.bib
new file mode 100644
index 0000000000..febd1a8079
--- /dev/null
+++ b/support/texlab/tests/scenarios/formatting/bibtex/infinite_line_length/formatted.bib
@@ -0,0 +1,3 @@
+@article{foo,
+ title = {Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.},
+} \ No newline at end of file
diff --git a/support/texlab/tests/scenarios/formatting/bibtex/infinite_line_length/unformatted.bib b/support/texlab/tests/scenarios/formatting/bibtex/infinite_line_length/unformatted.bib
new file mode 100644
index 0000000000..3ef68c5756
--- /dev/null
+++ b/support/texlab/tests/scenarios/formatting/bibtex/infinite_line_length/unformatted.bib
@@ -0,0 +1 @@
+@article{foo, title = {Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.} }
diff --git a/support/texlab/tests/scenarios/hover/bibtex/field/foo.bib b/support/texlab/tests/scenarios/hover/bibtex/field/foo.bib
new file mode 100644
index 0000000000..9d0a961b7a
--- /dev/null
+++ b/support/texlab/tests/scenarios/hover/bibtex/field/foo.bib
@@ -0,0 +1,4 @@
+@article{foo,
+ author = {Foo Bar},
+ bar = {Baz Qux},
+} \ No newline at end of file
diff --git a/support/texlab/tests/scenarios/hover/bibtex/string_reference/foo.bib b/support/texlab/tests/scenarios/hover/bibtex/string_reference/foo.bib
new file mode 100644
index 0000000000..434bb80185
--- /dev/null
+++ b/support/texlab/tests/scenarios/hover/bibtex/string_reference/foo.bib
@@ -0,0 +1,6 @@
+@string{foo = "foo {bar} baz"}
+
+@article{bar,
+ author = foo # bar,
+ title = "Qux",
+}
diff --git a/support/texlab/tests/scenarios/hover/bibtex/type/foo.bib b/support/texlab/tests/scenarios/hover/bibtex/type/foo.bib
new file mode 100644
index 0000000000..708bf7bbff
--- /dev/null
+++ b/support/texlab/tests/scenarios/hover/bibtex/type/foo.bib
@@ -0,0 +1,5 @@
+@article{foo,}
+
+@bar{bar,}
+
+@baz{baz,}
diff --git a/support/texlab/tests/scenarios/hover/latex/citation/foo.bib b/support/texlab/tests/scenarios/hover/latex/citation/foo.bib
new file mode 100644
index 0000000000..ce704dcff8
--- /dev/null
+++ b/support/texlab/tests/scenarios/hover/latex/citation/foo.bib
@@ -0,0 +1,5 @@
+@article{foo, author = {Foo Bar}, title = {Baz Qux}, year = {2019}}
+
+@article{bar, author = {Baz Qux}, title = {Foo Bar}, year = {2019}}
+
+@article{baz,}
diff --git a/support/texlab/tests/scenarios/hover/latex/citation/foo.tex b/support/texlab/tests/scenarios/hover/latex/citation/foo.tex
new file mode 100644
index 0000000000..7ec4a6cdf2
--- /dev/null
+++ b/support/texlab/tests/scenarios/hover/latex/citation/foo.tex
@@ -0,0 +1,4 @@
+\bibliography{foo}
+
+\cite{foo}
+\cite{baz}
diff --git a/support/texlab/tests/scenarios/hover/latex/component/foo.tex b/support/texlab/tests/scenarios/hover/latex/component/foo.tex
new file mode 100644
index 0000000000..c111318484
--- /dev/null
+++ b/support/texlab/tests/scenarios/hover/latex/component/foo.tex
@@ -0,0 +1,4 @@
+\documentclass{article}
+\usepackage{amsmath}
+\documentclass{foo}
+\usepackage{foo}
diff --git a/support/texlab/tests/scenarios/hover/latex/label/section.tex b/support/texlab/tests/scenarios/hover/latex/label/section.tex
new file mode 100644
index 0000000000..75a5d120b5
--- /dev/null
+++ b/support/texlab/tests/scenarios/hover/latex/label/section.tex
@@ -0,0 +1,5 @@
+\documentclass{article}
+\begin{document}
+\section{Foo}
+\label{sec:foo}
+\end{document}
diff --git a/support/texlab/tests/scenarios/symbol/hierarchical/enumerate.aux b/support/texlab/tests/scenarios/symbol/hierarchical/enumerate.aux
new file mode 100644
index 0000000000..40fcc334fa
--- /dev/null
+++ b/support/texlab/tests/scenarios/symbol/hierarchical/enumerate.aux
@@ -0,0 +1,3 @@
+\relax
+\newlabel{it:foo}{{1}{1}}
+\newlabel{it:qux}{{2}{1}}
diff --git a/support/texlab/tests/scenarios/symbol/hierarchical/enumerate.tex b/support/texlab/tests/scenarios/symbol/hierarchical/enumerate.tex
new file mode 100644
index 0000000000..bbf85f2ee6
--- /dev/null
+++ b/support/texlab/tests/scenarios/symbol/hierarchical/enumerate.tex
@@ -0,0 +1,12 @@
+\documentclass{article}
+
+\begin{document}
+
+\begin{enumerate}
+ \item\label{it:foo} Foo
+ \item\label{it:bar} Bar
+ \item[Baz] Baz
+ \item[Qux]\label{it:qux} Qux
+\end{enumerate}
+
+\end{document}
diff --git a/support/texlab/tests/scenarios/symbol/hierarchical/equation.aux b/support/texlab/tests/scenarios/symbol/hierarchical/equation.aux
new file mode 100644
index 0000000000..f7d3f25421
--- /dev/null
+++ b/support/texlab/tests/scenarios/symbol/hierarchical/equation.aux
@@ -0,0 +1,2 @@
+\relax
+\newlabel{eq:foo}{{1}{1}}
diff --git a/support/texlab/tests/scenarios/symbol/hierarchical/equation.tex b/support/texlab/tests/scenarios/symbol/hierarchical/equation.tex
new file mode 100644
index 0000000000..0999f270fa
--- /dev/null
+++ b/support/texlab/tests/scenarios/symbol/hierarchical/equation.tex
@@ -0,0 +1,17 @@
+\documentclass{article}
+
+\begin{document}
+
+\begin{equation}\label{eq:foo}
+ Foo
+\end{equation}
+
+\begin{equation}\label{eq:bar}
+ Bar
+\end{equation}
+
+\begin{equation}
+ Baz
+\end{equation}
+
+\end{document}
diff --git a/support/texlab/tests/scenarios/symbol/hierarchical/float.aux b/support/texlab/tests/scenarios/symbol/hierarchical/float.aux
new file mode 100644
index 0000000000..a23cc632d1
--- /dev/null
+++ b/support/texlab/tests/scenarios/symbol/hierarchical/float.aux
@@ -0,0 +1,5 @@
+\relax
+\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Foo}}{1}\protected@file@percent }
+\newlabel{fig:foo}{{1}{1}}
+\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces Bar}}{1}\protected@file@percent }
+\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces Baz}}{1}\protected@file@percent }
diff --git a/support/texlab/tests/scenarios/symbol/hierarchical/float.tex b/support/texlab/tests/scenarios/symbol/hierarchical/float.tex
new file mode 100644
index 0000000000..e8f65b9f3a
--- /dev/null
+++ b/support/texlab/tests/scenarios/symbol/hierarchical/float.tex
@@ -0,0 +1,24 @@
+\documentclass{article}
+
+\begin{document}
+
+\begin{figure}
+ Foo
+ \caption{Foo}\label{fig:foo}
+\end{figure}
+
+\begin{figure}
+ Bar
+ \caption{Bar}\label{fig:bar}
+\end{figure}
+
+\begin{figure}
+ Baz
+ \caption{Baz}
+\end{figure}
+
+\begin{figure}
+ Qux
+\end{figure}
+
+\end{document}
diff --git a/support/texlab/tests/scenarios/symbol/hierarchical/section.aux b/support/texlab/tests/scenarios/symbol/hierarchical/section.aux
new file mode 100644
index 0000000000..d8c1d2c24f
--- /dev/null
+++ b/support/texlab/tests/scenarios/symbol/hierarchical/section.aux
@@ -0,0 +1,4 @@
+\relax
+\@writefile{toc}{\contentsline {section}{\numberline {1}Foo}{1}\protected@file@percent }
+\@writefile{toc}{\contentsline {section}{\numberline {2}Bar}{1}\protected@file@percent }
+\newlabel{sec:bar}{{2}{1}}
diff --git a/support/texlab/tests/scenarios/symbol/hierarchical/section.tex b/support/texlab/tests/scenarios/symbol/hierarchical/section.tex
new file mode 100644
index 0000000000..ca2de74578
--- /dev/null
+++ b/support/texlab/tests/scenarios/symbol/hierarchical/section.tex
@@ -0,0 +1,11 @@
+\documentclass{article}
+
+\begin{document}
+
+\section{Foo}
+
+\section{Bar}\label{sec:bar}
+
+\subsection{Baz}\label{sec:baz}
+
+\end{document}
diff --git a/support/texlab/tests/scenarios/symbol/hierarchical/theorem.aux b/support/texlab/tests/scenarios/symbol/hierarchical/theorem.aux
new file mode 100644
index 0000000000..ad163aeeae
--- /dev/null
+++ b/support/texlab/tests/scenarios/symbol/hierarchical/theorem.aux
@@ -0,0 +1,3 @@
+\relax
+\newlabel{thm:foo}{{1}{1}}
+\newlabel{thm:bar}{{2}{1}}
diff --git a/support/texlab/tests/scenarios/symbol/hierarchical/theorem.tex b/support/texlab/tests/scenarios/symbol/hierarchical/theorem.tex
new file mode 100644
index 0000000000..e147cd6f90
--- /dev/null
+++ b/support/texlab/tests/scenarios/symbol/hierarchical/theorem.tex
@@ -0,0 +1,23 @@
+\documentclass{article}
+\usepackage{amsthm}
+\newtheorem{lemma}{Lemma}
+
+\begin{document}
+
+\begin{lemma}[Foo]\label{thm:foo}
+ Foo
+\end{lemma}
+
+\begin{lemma}\label{thm:bar}
+ Bar
+\end{lemma}
+
+\begin{lemma}\label{thm:baz}
+ Baz
+\end{lemma}
+
+\begin{lemma}[Qux]
+ Qux
+\end{lemma}
+
+\end{document} \ No newline at end of file
diff --git a/support/texlab/tests/scenarios/symbol/workspace/bar.bib b/support/texlab/tests/scenarios/symbol/workspace/bar.bib
new file mode 100644
index 0000000000..1fd540db29
--- /dev/null
+++ b/support/texlab/tests/scenarios/symbol/workspace/bar.bib
@@ -0,0 +1,3 @@
+@article{foo,}
+
+@string{bar = "bar"}
diff --git a/support/texlab/tests/scenarios/symbol/workspace/foo.aux b/support/texlab/tests/scenarios/symbol/workspace/foo.aux
new file mode 100644
index 0000000000..9713a1f333
--- /dev/null
+++ b/support/texlab/tests/scenarios/symbol/workspace/foo.aux
@@ -0,0 +1,17 @@
+\relax
+\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Bar\relax }}{1}\protected@file@percent }
+\providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}}
+\newlabel{fig:bar}{{1}{1}}
+\@writefile{toc}{\contentsline {section}{\numberline {1}Foo}{1}\protected@file@percent }
+\newlabel{sec:foo}{{1}{1}}
+\newlabel{eq:foo}{{1}{1}}
+\@writefile{toc}{\contentsline {section}{\numberline {2}Bar}{1}\protected@file@percent }
+\newlabel{sec:bar}{{2}{1}}
+\@writefile{toc}{\contentsline {section}{\numberline {3}Baz}{1}\protected@file@percent }
+\newlabel{sec:baz}{{3}{1}}
+\newlabel{itm:foo}{{1}{1}}
+\newlabel{itm:bar}{{2}{1}}
+\newlabel{itm:baz}{{3}{1}}
+\@writefile{toc}{\contentsline {section}{\numberline {4}Qux}{1}\protected@file@percent }
+\newlabel{sec:qux}{{4}{1}}
+\newlabel{thm:qux}{{1}{1}}
diff --git a/support/texlab/tests/scenarios/symbol/workspace/foo.tex b/support/texlab/tests/scenarios/symbol/workspace/foo.tex
new file mode 100644
index 0000000000..292cc5369b
--- /dev/null
+++ b/support/texlab/tests/scenarios/symbol/workspace/foo.tex
@@ -0,0 +1,38 @@
+\documentclass{article}
+\usepackage{caption}
+\usepackage{amsmath}
+\usepackage{amsthm}
+
+\begin{document}
+
+\section{Foo}\label{sec:foo}
+
+\begin{equation}\label{eq:foo}
+ Foo
+\end{equation}
+
+\section{Bar}\label{sec:bar}
+
+\begin{figure}
+ Bar
+ \caption{Bar}
+ \label{fig:bar}
+\end{figure}
+
+\section{Baz}\label{sec:baz}
+
+\begin{enumerate}
+ \item\label{itm:foo} Foo
+ \item\label{itm:bar} Bar
+ \item\label{itm:baz} Baz
+\end{enumerate}
+
+\section{Qux}\label{sec:qux}
+
+\newtheorem{lemma}{Lemma}
+
+\begin{lemma}[Qux]\label{thm:qux}
+ Qux
+\end{lemma}
+
+\end{document}
diff --git a/support/texlab/tests/support/mod.rs b/support/texlab/tests/support/mod.rs
new file mode 100644
index 0000000000..abd1bfe313
--- /dev/null
+++ b/support/texlab/tests/support/mod.rs
@@ -0,0 +1,635 @@
+use copy_dir::copy_dir;
+use futures::lock::Mutex;
+use futures_boxed::boxed;
+use jsonrpc::client::Result;
+use lsp_types::*;
+use serde::Serialize;
+use std::collections::HashMap;
+use std::fs::remove_dir;
+use std::path::PathBuf;
+use std::sync::Arc;
+use tempfile::{tempdir, TempDir};
+use texlab::build::BuildOptions;
+use texlab::client::LspClient;
+use texlab::diagnostics::LatexLintOptions;
+use texlab::formatting::bibtex::BibtexFormattingOptions;
+use texlab::server::LatexLspServer;
+use texlab::workspace::Uri;
+
+#[derive(Debug, PartialEq, Eq, Clone, Default)]
+pub struct MockLspClientOptions {
+ pub bibtex_formatting: Option<BibtexFormattingOptions>,
+ pub latex_lint: Option<LatexLintOptions>,
+ pub latex_build: Option<BuildOptions>,
+}
+
+#[derive(Debug, Default)]
+pub struct MockLspClient {
+ pub messages: Mutex<Vec<ShowMessageParams>>,
+ pub options: Mutex<MockLspClientOptions>,
+ pub diagnostics_by_uri: Mutex<HashMap<Uri, Vec<Diagnostic>>>,
+ pub log_messages: Mutex<Vec<LogMessageParams>>,
+}
+
+impl MockLspClient {
+ pub fn new() -> Self {
+ Self::default()
+ }
+}
+
+impl LspClient for MockLspClient {
+ #[boxed]
+ async fn configuration(&self, params: ConfigurationParams) -> Result<serde_json::Value> {
+ fn serialize<T>(options: &Option<T>) -> Result<serde_json::Value>
+ where
+ T: Serialize,
+ {
+ options
+ .as_ref()
+ .map(|options| serde_json::to_value(vec![options]).unwrap())
+ .ok_or_else(|| jsonrpc::Error::internal_error("Internal error".to_owned()))
+ }
+
+ let options = self.options.lock().await;
+ match params.items[0].section.as_ref().unwrap().as_ref() {
+ "bibtex.formatting" => serialize(&options.bibtex_formatting),
+ "latex.lint" => serialize(&options.latex_lint),
+ "latex.build" => serialize(&options.latex_build),
+ _ => panic!("Invalid language configuration!"),
+ }
+ }
+
+ #[boxed]
+ async fn show_message(&self, params: ShowMessageParams) {
+ let mut messages = self.messages.lock().await;
+ messages.push(params);
+ }
+
+ #[boxed]
+ async fn register_capability(&self, _params: RegistrationParams) -> Result<()> {
+ Ok(())
+ }
+
+ #[boxed]
+ async fn publish_diagnostics(&self, params: PublishDiagnosticsParams) {
+ let mut diagnostics_by_uri = self.diagnostics_by_uri.lock().await;
+ diagnostics_by_uri.insert(params.uri.into(), params.diagnostics);
+ }
+
+ #[boxed]
+ async fn work_done_progress_create(&self, _params: WorkDoneProgressCreateParams) -> Result<()> {
+ Ok(())
+ }
+
+ #[boxed]
+ async fn progress(&self, _params: ProgressParams) {}
+
+ #[boxed]
+ async fn log_message(&self, params: LogMessageParams) {
+ let mut messages = self.log_messages.lock().await;
+ messages.push(params);
+ }
+}
+
+pub struct Scenario {
+ pub directory: TempDir,
+ pub server: LatexLspServer<MockLspClient>,
+ pub client: Arc<MockLspClient>,
+}
+
+impl Scenario {
+ pub fn new(name: &str, distribution: Arc<Box<dyn tex::Distribution>>) -> Self {
+ let directory = tempdir().unwrap();
+ remove_dir(directory.path()).unwrap();
+ let source = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
+ .join("tests")
+ .join("scenarios")
+ .join(name);
+ copy_dir(source, directory.path()).unwrap();
+
+ let client = Arc::new(MockLspClient::new());
+ let server = LatexLspServer::new(distribution, Arc::clone(&client));
+ Self {
+ directory,
+ server,
+ client,
+ }
+ }
+
+ pub async fn initialize(&self, capabilities: &ClientCapabilities) {
+ let root_uri = Uri::from_file_path(self.directory.path()).unwrap();
+ let params = InitializeParams {
+ process_id: None,
+ root_path: Some(self.directory.path().to_string_lossy().into_owned()),
+ root_uri: Some(root_uri.into()),
+ initialization_options: None,
+ capabilities: capabilities.clone(),
+ trace: None,
+ workspace_folders: None,
+ };
+
+ self.server
+ .execute_async(|svr| svr.initialize(params))
+ .await
+ .unwrap();
+
+ self.server
+ .execute(|svr| svr.initialized(InitializedParams {}))
+ .await;
+ }
+
+ pub fn uri(&self, name: &str) -> Uri {
+ let mut path = self.directory.path().to_owned();
+ path.push(name);
+ Uri::from_file_path(path).unwrap()
+ }
+
+ pub async fn read(&self, name: &'static str) -> String {
+ let mut path = self.directory.path().to_owned();
+ path.push(name);
+ let data = tokio::fs::read(path).await.unwrap();
+ let text = String::from_utf8_lossy(&data);
+ text.replace('\r', "")
+ }
+
+ pub async fn open(&self, name: &'static str) {
+ let text = self.read(name).await;
+ let language_id = if name.ends_with(".bib") {
+ "bibtex"
+ } else {
+ "latex"
+ };
+
+ let params = DidOpenTextDocumentParams {
+ text_document: TextDocumentItem {
+ uri: self.uri(name).into(),
+ version: 0,
+ language_id: language_id.to_owned(),
+ text,
+ },
+ };
+ self.server.execute(|svr| svr.did_open(params)).await;
+ }
+}
+
+pub mod capabilities {
+ use lsp_types::*;
+
+ pub static CLIENT_FULL_CAPABILITIES: ClientCapabilities = ClientCapabilities {
+ workspace: Some(WorkspaceClientCapabilities {
+ configuration: Some(true),
+ did_change_watched_files: None,
+ workspace_folders: None,
+ apply_edit: None,
+ execute_command: None,
+ symbol: None,
+ workspace_edit: None,
+ did_change_configuration: None,
+ }),
+ text_document: Some(TextDocumentClientCapabilities {
+ synchronization: None,
+ completion: None,
+ hover: None,
+ signature_help: None,
+ references: None,
+ document_highlight: None,
+ document_symbol: Some(DocumentSymbolCapability {
+ dynamic_registration: None,
+ hierarchical_document_symbol_support: Some(true),
+ symbol_kind: None,
+ }),
+ formatting: None,
+ range_formatting: None,
+ on_type_formatting: None,
+ declaration: None,
+ definition: Some(GotoCapability {
+ dynamic_registration: None,
+ link_support: Some(true),
+ }),
+ type_definition: None,
+ implementation: None,
+ code_action: None,
+ code_lens: None,
+ document_link: None,
+ color_provider: None,
+ rename: None,
+ publish_diagnostics: None,
+ folding_range: None,
+ }),
+ experimental: None,
+ window: Some(WindowClientCapabilities {
+ work_done_progress: Some(true),
+ }),
+ };
+
+ pub static CLIENT_NO_LINK_CAPABILITIES: ClientCapabilities = ClientCapabilities {
+ workspace: Some(WorkspaceClientCapabilities {
+ configuration: Some(true),
+ did_change_watched_files: None,
+ workspace_folders: None,
+ apply_edit: None,
+ execute_command: None,
+ symbol: None,
+ workspace_edit: None,
+ did_change_configuration: None,
+ }),
+ text_document: Some(TextDocumentClientCapabilities {
+ synchronization: None,
+ completion: None,
+ hover: None,
+ signature_help: None,
+ references: None,
+ document_highlight: None,
+ document_symbol: None,
+ formatting: None,
+ range_formatting: None,
+ on_type_formatting: None,
+ declaration: None,
+ definition: Some(GotoCapability {
+ dynamic_registration: None,
+ link_support: Some(false),
+ }),
+ type_definition: None,
+ implementation: None,
+ code_action: None,
+ code_lens: None,
+ document_link: None,
+ color_provider: None,
+ rename: None,
+ publish_diagnostics: None,
+ folding_range: None,
+ }),
+ experimental: None,
+ window: Some(WindowClientCapabilities {
+ work_done_progress: Some(true),
+ }),
+ };
+}
+
+pub mod completion {
+ use super::*;
+
+ pub async fn run_list(
+ scenario_short_name: &'static str,
+ file: &'static str,
+ line: u64,
+ character: u64,
+ ) -> (Scenario, Vec<CompletionItem>) {
+ let scenario_name = format!("completion/{}", scenario_short_name);
+ let scenario = Scenario::new(&scenario_name, Arc::new(Box::new(tex::Unknown)));
+ scenario.open(file).await;
+ scenario
+ .initialize(&capabilities::CLIENT_FULL_CAPABILITIES)
+ .await;
+
+ let params = CompletionParams {
+ text_document_position: TextDocumentPositionParams {
+ text_document: TextDocumentIdentifier::new(scenario.uri(file).into()),
+ position: Position::new(line, character),
+ },
+ context: None,
+ };
+
+ let items = scenario
+ .server
+ .execute_async(|svr| svr.completion(params))
+ .await
+ .unwrap()
+ .items;
+
+ (scenario, items)
+ }
+
+ pub async fn run_empty(
+ scenario_short_name: &'static str,
+ file: &'static str,
+ line: u64,
+ character: u64,
+ ) {
+ assert!(run_list(scenario_short_name, file, line, character)
+ .await
+ .1
+ .is_empty());
+ }
+
+ pub async fn run_item(
+ scenario_short_name: &'static str,
+ file: &'static str,
+ line: u64,
+ character: u64,
+ item_name: &'static str,
+ ) -> CompletionItem {
+ let (scenario, items) = run_list(scenario_short_name, file, line, character).await;
+
+ let item = items
+ .into_iter()
+ .find(|item| item.label == item_name)
+ .unwrap();
+
+ scenario
+ .server
+ .execute_async(|svr| svr.completion_resolve(item))
+ .await
+ .unwrap()
+ }
+
+ pub mod verify {
+ use lsp_types::*;
+ use texlab::range::RangeExt;
+
+ pub fn text_edit(
+ item: &CompletionItem,
+ start_line: u64,
+ start_character: u64,
+ end_line: u64,
+ end_character: u64,
+ text: &str,
+ ) {
+ assert_eq!(
+ item.text_edit,
+ Some(TextEdit::new(
+ Range::new_simple(start_line, start_character, end_line, end_character),
+ text.into()
+ ))
+ );
+ }
+
+ pub fn detail(item: &CompletionItem, detail: &str) {
+ assert_eq!(item.detail.as_ref().unwrap(), detail);
+ }
+
+ pub fn labels(items: &[CompletionItem], expected_labels: Vec<&'static str>) {
+ let mut actual_labels: Vec<&str> =
+ items.iter().map(|item| item.label.as_ref()).collect();
+ actual_labels.sort();
+ assert_eq!(actual_labels, expected_labels);
+ }
+ }
+}
+
+pub mod definition {
+ use super::capabilities::*;
+ use super::*;
+ use texlab::definition::DefinitionResponse;
+
+ pub async fn run(
+ scenario_short_name: &'static str,
+ file: &'static str,
+ line: u64,
+ character: u64,
+ capabilities: &ClientCapabilities,
+ ) -> (Scenario, DefinitionResponse) {
+ let scenario_name = format!("definition/{}", scenario_short_name);
+ let scenario = Scenario::new(&scenario_name, Arc::new(Box::new(tex::Unknown)));
+ scenario.initialize(capabilities).await;
+ scenario.open(file).await;
+
+ let params = TextDocumentPositionParams {
+ text_document: TextDocumentIdentifier::new(scenario.uri(file).into()),
+ position: Position::new(line, character),
+ };
+
+ let response = scenario
+ .server
+ .execute_async(|svr| svr.definition(params))
+ .await
+ .unwrap();
+
+ (scenario, response)
+ }
+
+ pub async fn run_link(
+ scenario_short_name: &'static str,
+ file: &'static str,
+ line: u64,
+ character: u64,
+ ) -> (Scenario, Vec<LocationLink>) {
+ let (scenario, response) = run(
+ scenario_short_name,
+ file,
+ line,
+ character,
+ &CLIENT_FULL_CAPABILITIES,
+ )
+ .await;
+ match response {
+ DefinitionResponse::LocationLinks(links) => (scenario, links),
+ DefinitionResponse::Locations(_) => unreachable!(),
+ }
+ }
+
+ pub async fn run_location(
+ scenario_short_name: &'static str,
+ file: &'static str,
+ line: u64,
+ character: u64,
+ ) -> (Scenario, Vec<Location>) {
+ let (scenario, response) = run(
+ scenario_short_name,
+ file,
+ line,
+ character,
+ &CLIENT_NO_LINK_CAPABILITIES,
+ )
+ .await;
+ match response {
+ DefinitionResponse::LocationLinks(_) => unreachable!(),
+ DefinitionResponse::Locations(locations) => (scenario, locations),
+ }
+ }
+
+ pub mod verify {
+ use super::*;
+ use texlab::range::RangeExt;
+
+ pub fn origin_selection_range(
+ link: &LocationLink,
+ start_line: u64,
+ start_character: u64,
+ end_line: u64,
+ end_character: u64,
+ ) {
+ assert_eq!(
+ link.origin_selection_range,
+ Some(Range::new_simple(
+ start_line,
+ start_character,
+ end_line,
+ end_character
+ ))
+ );
+ }
+ }
+}
+
+pub mod folding {
+ use super::*;
+ use std::cmp::Reverse;
+
+ pub async fn run(file: &'static str) -> Vec<FoldingRange> {
+ let scenario = Scenario::new("folding", Arc::new(Box::new(tex::Unknown)));
+ scenario
+ .initialize(&capabilities::CLIENT_FULL_CAPABILITIES)
+ .await;
+ scenario.open(file).await;
+ let params = FoldingRangeParams {
+ text_document: TextDocumentIdentifier::new(scenario.uri(file).into()),
+ };
+
+ let mut foldings = scenario
+ .server
+ .execute_async(|svr| svr.folding_range(params))
+ .await
+ .unwrap();
+
+ foldings.sort_by_key(|folding| {
+ let start = Position::new(folding.start_line, folding.start_character.unwrap());
+ let end = Position::new(folding.end_line, folding.end_character.unwrap());
+ (start, Reverse(end))
+ });
+ foldings
+ }
+}
+
+pub mod formatting {
+ use super::*;
+ use texlab::formatting::bibtex::BibtexFormattingOptions;
+
+ pub async fn run_bibtex(
+ file: &'static str,
+ options: Option<BibtexFormattingOptions>,
+ ) -> (Scenario, Vec<TextEdit>) {
+ let scenario = Scenario::new("formatting/bibtex", Arc::new(Box::new(tex::Unknown)));
+ scenario
+ .initialize(&capabilities::CLIENT_FULL_CAPABILITIES)
+ .await;
+ scenario.open(file).await;
+ {
+ scenario.client.options.lock().await.bibtex_formatting = options;
+ }
+
+ let params = DocumentFormattingParams {
+ text_document: TextDocumentIdentifier::new(scenario.uri(file).into()),
+ options: FormattingOptions {
+ tab_size: 4,
+ insert_spaces: true,
+ properties: HashMap::new(),
+ },
+ };
+
+ let edits = scenario
+ .server
+ .execute_async(|svr| svr.formatting(params))
+ .await
+ .unwrap();
+ (scenario, edits)
+ }
+}
+
+pub mod hover {
+ use super::*;
+
+ pub async fn run(
+ scenario_short_name: &'static str,
+ file: &'static str,
+ line: u64,
+ character: u64,
+ ) -> Option<HoverContents> {
+ let scenario_name = format!("hover/{}", scenario_short_name);
+ let scenario = Scenario::new(&scenario_name, Arc::new(Box::new(tex::Unknown)));
+ scenario
+ .initialize(&capabilities::CLIENT_FULL_CAPABILITIES)
+ .await;
+ scenario.open(file).await;
+ let identifier = TextDocumentIdentifier::new(scenario.uri(file).into());
+ let params = TextDocumentPositionParams::new(identifier, Position::new(line, character));
+ scenario
+ .server
+ .execute_async(|svr| svr.hover(params))
+ .await
+ .unwrap()
+ .map(|hover| hover.contents)
+ }
+}
+
+pub mod symbol {
+ use super::*;
+ use texlab::symbol::SymbolResponse;
+
+ pub async fn run_hierarchical(file: &'static str) -> Vec<DocumentSymbol> {
+ let scenario = Scenario::new("symbol/hierarchical", Arc::new(Box::new(tex::Unknown)));
+ scenario
+ .initialize(&capabilities::CLIENT_FULL_CAPABILITIES)
+ .await;
+ scenario.open(file).await;
+ let params = DocumentSymbolParams {
+ text_document: TextDocumentIdentifier::new(scenario.uri(file).into()),
+ };
+
+ let response = scenario
+ .server
+ .execute_async(|svr| svr.document_symbol(params))
+ .await
+ .unwrap();
+
+ match response {
+ SymbolResponse::Hierarchical(symbols) => symbols,
+ SymbolResponse::Flat(_) => unreachable!(),
+ }
+ }
+
+ pub async fn run_workspace(query: &'static str) -> (Scenario, Vec<SymbolInformation>) {
+ let scenario = Scenario::new("symbol/workspace", Arc::new(Box::new(tex::Unknown)));
+ scenario
+ .initialize(&capabilities::CLIENT_FULL_CAPABILITIES)
+ .await;
+ scenario.open("foo.tex").await;
+ scenario.open("bar.bib").await;
+ let params = WorkspaceSymbolParams {
+ query: query.into(),
+ };
+ let symbols = scenario
+ .server
+ .execute_async(|svr| svr.workspace_symbol(params))
+ .await
+ .unwrap();
+
+ (scenario, symbols)
+ }
+
+ pub mod verify {
+ use super::*;
+ use texlab::range::RangeExt;
+
+ pub fn symbol(
+ symbol: &DocumentSymbol,
+ name: &str,
+ detail: Option<&str>,
+ selection_range: Range,
+ range: Range,
+ ) {
+ assert_eq!(symbol.name, name);
+ assert_eq!(symbol.detail.as_ref().map(AsRef::as_ref), detail);
+ assert_eq!(symbol.selection_range, selection_range);
+ assert_eq!(symbol.range, range);
+ }
+
+ pub fn symbol_info(
+ symbol: &SymbolInformation,
+ scenario: &Scenario,
+ file: &str,
+ name: &str,
+ start_line: u64,
+ start_character: u64,
+ end_line: u64,
+ end_character: u64,
+ ) {
+ assert_eq!(symbol.name, name);
+ let range = Range::new_simple(start_line, start_character, end_line, end_character);
+ assert_eq!(
+ symbol.location,
+ Location::new(scenario.uri(file).into(), range)
+ );
+ }
+ }
+}
diff --git a/support/texlab/tests/test_completion_bibtex_command.rs b/support/texlab/tests/test_completion_bibtex_command.rs
new file mode 100644
index 0000000000..1d741d6976
--- /dev/null
+++ b/support/texlab/tests/test_completion_bibtex_command.rs
@@ -0,0 +1,19 @@
+pub mod support;
+
+use support::completion::*;
+
+const SCENARIO: &str = "bibtex/command";
+
+#[tokio::test]
+async fn incomplete_entry() {
+ let item = run_item(SCENARIO, "foo.bib", 1, 15, "LaTeX").await;
+ verify::text_edit(&item, 1, 15, 1, 18, "LaTeX");
+ verify::detail(&item, "built-in");
+}
+
+#[tokio::test]
+async fn complete_entry() {
+ let item = run_item(SCENARIO, "foo.bib", 5, 15, "LaTeX").await;
+ verify::text_edit(&item, 5, 15, 5, 18, "LaTeX");
+ verify::detail(&item, "built-in");
+}
diff --git a/support/texlab/tests/test_completion_bibtex_field.rs b/support/texlab/tests/test_completion_bibtex_field.rs
new file mode 100644
index 0000000000..766bcd7019
--- /dev/null
+++ b/support/texlab/tests/test_completion_bibtex_field.rs
@@ -0,0 +1,19 @@
+pub mod support;
+
+use support::completion::*;
+
+const SCENARIO: &str = "bibtex/field";
+
+#[tokio::test]
+async fn incomplete_entry() {
+ let item = run_item(SCENARIO, "foo.bib", 1, 6, "title").await;
+ assert!(item.documentation.is_some());
+ verify::text_edit(&item, 1, 4, 1, 8, "title");
+}
+
+#[tokio::test]
+async fn complete_entry() {
+ let item = run_item(SCENARIO, "foo.bib", 4, 5, "title").await;
+ assert!(item.documentation.is_some());
+ verify::text_edit(&item, 4, 4, 4, 9, "title");
+}
diff --git a/support/texlab/tests/test_completion_bibtex_type.rs b/support/texlab/tests/test_completion_bibtex_type.rs
new file mode 100644
index 0000000000..5d56e3c178
--- /dev/null
+++ b/support/texlab/tests/test_completion_bibtex_type.rs
@@ -0,0 +1,26 @@
+pub mod support;
+
+use support::completion::*;
+
+const SCENARIO: &str = "bibtex/type";
+
+#[tokio::test]
+async fn empty_type() {
+ let item = run_item(SCENARIO, "foo.bib", 0, 1, "article").await;
+ assert!(item.documentation.is_some());
+ verify::text_edit(&item, 0, 1, 0, 1, "article");
+}
+
+#[tokio::test]
+async fn incomplete_type() {
+ let item = run_item(SCENARIO, "foo.bib", 1, 2, "article").await;
+ assert!(item.documentation.is_some());
+ verify::text_edit(&item, 1, 1, 1, 4, "article");
+}
+
+#[tokio::test]
+async fn complete_type() {
+ let item = run_item(SCENARIO, "foo.bib", 2, 8, "article").await;
+ assert!(item.documentation.is_some());
+ verify::text_edit(&item, 2, 1, 2, 8, "article");
+}
diff --git a/support/texlab/tests/test_completion_bibtex_word.rs b/support/texlab/tests/test_completion_bibtex_word.rs
new file mode 100644
index 0000000000..3f757047a3
--- /dev/null
+++ b/support/texlab/tests/test_completion_bibtex_word.rs
@@ -0,0 +1,20 @@
+pub mod support;
+
+use support::completion::*;
+
+const SCENARIO: &str = "bibtex/word";
+
+#[tokio::test]
+async fn no_text() {
+ run_empty(SCENARIO, "foo.bib", 0, 0).await;
+}
+
+#[tokio::test]
+async fn before_brace_entry() {
+ run_empty(SCENARIO, "foo.bib", 2, 14).await;
+}
+
+#[tokio::test]
+async fn before_brace_comment() {
+ run_empty(SCENARIO, "foo.bib", 6, 14).await;
+}
diff --git a/support/texlab/tests/test_completion_latex_citation.rs b/support/texlab/tests/test_completion_latex_citation.rs
new file mode 100644
index 0000000000..07ecd6690f
--- /dev/null
+++ b/support/texlab/tests/test_completion_latex_citation.rs
@@ -0,0 +1,26 @@
+pub mod support;
+
+use lsp_types::*;
+use support::completion::*;
+
+const SCENARIO: &str = "latex/citation";
+
+#[tokio::test]
+async fn valid_citation() {
+ let item = run_item(SCENARIO, "foo.tex", 5, 6, "foo:2019").await;
+ verify::text_edit(&item, 5, 6, 5, 6, "foo:2019");
+ assert_eq!(
+ item.documentation.unwrap(),
+ Documentation::MarkupContent(MarkupContent {
+ kind: MarkupKind::Markdown,
+ value: "Bar, F. (2019). *Baz Qux*.".into()
+ })
+ );
+}
+
+#[tokio::test]
+async fn invalid_citation() {
+ let item = run_item(SCENARIO, "foo.tex", 5, 6, "bar:2005").await;
+ verify::text_edit(&item, 5, 6, 5, 6, "bar:2005");
+ assert_eq!(item.documentation, None);
+}
diff --git a/support/texlab/tests/test_completion_latex_color.rs b/support/texlab/tests/test_completion_latex_color.rs
new file mode 100644
index 0000000000..43c956ef78
--- /dev/null
+++ b/support/texlab/tests/test_completion_latex_color.rs
@@ -0,0 +1,23 @@
+pub mod support;
+
+use support::completion::*;
+
+const SCENARIO: &str = "latex/color";
+
+#[tokio::test]
+async fn name() {
+ let item = run_item(SCENARIO, "foo.tex", 0, 9, "red").await;
+ verify::text_edit(&item, 0, 7, 0, 9, "red");
+}
+
+#[tokio::test]
+async fn model_definecolor() {
+ let item = run_item(SCENARIO, "foo.tex", 1, 18, "rgb").await;
+ verify::text_edit(&item, 1, 18, 1, 18, "rgb");
+}
+
+#[tokio::test]
+async fn model_definecolorset() {
+ let item = run_item(SCENARIO, "foo.tex", 2, 17, "RGB").await;
+ verify::text_edit(&item, 2, 16, 2, 17, "RGB");
+}
diff --git a/support/texlab/tests/test_completion_latex_component.rs b/support/texlab/tests/test_completion_latex_component.rs
new file mode 100644
index 0000000000..6671fa9c07
--- /dev/null
+++ b/support/texlab/tests/test_completion_latex_component.rs
@@ -0,0 +1,68 @@
+pub mod support;
+
+use support::completion::*;
+
+const SCENARIO: &str = "latex/component";
+
+#[tokio::test]
+async fn kernel_command() {
+ let item = run_item(SCENARIO, "foo.tex", 0, 1, "documentclass").await;
+ verify::text_edit(&item, 0, 1, 0, 14, "documentclass");
+ verify::detail(&item, "built-in");
+}
+
+#[tokio::test]
+async fn kernel_command_glyph() {
+ let item = run_item(SCENARIO, "foo.tex", 7, 7, "varepsilon").await;
+ verify::text_edit(&item, 7, 1, 7, 7, "varepsilon");
+ verify::detail(&item, "ε, built-in");
+}
+
+#[tokio::test]
+async fn kernel_environment() {
+ let item = run_item(SCENARIO, "foo.tex", 6, 10, "document").await;
+ verify::text_edit(&item, 6, 7, 6, 10, "document");
+ verify::detail(&item, "built-in");
+}
+
+#[tokio::test]
+async fn class_import() {
+ let item = run_item(SCENARIO, "foo.tex", 0, 19, "book").await;
+ verify::text_edit(&item, 0, 15, 0, 19, "book");
+ assert!(item.documentation.is_some());
+}
+
+#[tokio::test]
+async fn class_command() {
+ let item = run_item(SCENARIO, "foo.tex", 2, 5, "chapter").await;
+ verify::text_edit(&item, 2, 1, 2, 5, "chapter");
+ verify::detail(&item, "book.cls");
+}
+
+#[tokio::test]
+async fn class_environment() {
+ let item = run_item(SCENARIO, "foo.tex", 4, 13, "theindex").await;
+ verify::text_edit(&item, 4, 7, 4, 13, "theindex");
+ verify::detail(&item, "book.cls");
+}
+
+#[tokio::test]
+async fn package_import() {
+ let item = run_item(SCENARIO, "foo.tex", 1, 15, "amsmath").await;
+ verify::text_edit(&item, 1, 12, 1, 19, "amsmath");
+ assert!(item.documentation.is_some());
+}
+
+#[tokio::test]
+async fn package_command() {
+ let item = run_item(SCENARIO, "foo.tex", 3, 7, "varDelta").await;
+ verify::text_edit(&item, 3, 1, 3, 7, "varDelta");
+ verify::detail(&item, "amsmath.sty");
+}
+
+#[tokio::test]
+async fn package_environment() {
+ let item = run_item(SCENARIO, "foo.tex", 5, 5, "align").await;
+ verify::text_edit(&item, 5, 5, 5, 9, "align");
+ verify::detail(&item, "amsmath.sty");
+}
diff --git a/support/texlab/tests/test_completion_latex_include.rs b/support/texlab/tests/test_completion_latex_include.rs
new file mode 100644
index 0000000000..b657804317
--- /dev/null
+++ b/support/texlab/tests/test_completion_latex_include.rs
@@ -0,0 +1,29 @@
+pub mod support;
+
+use support::completion::*;
+
+const SCENARIO: &str = "latex/include";
+
+#[tokio::test]
+async fn include_root() {
+ let (_, items) = run_list(SCENARIO, "foo.tex", 2, 9).await;
+ verify::labels(&items, vec!["bar", "foo", "qux"]);
+}
+
+#[tokio::test]
+async fn input_root() {
+ let (_, items) = run_list(SCENARIO, "foo.tex", 3, 7).await;
+ verify::labels(&items, vec!["bar.tex", "foo.tex", "qux"]);
+}
+
+#[tokio::test]
+async fn input_subdirectory() {
+ let (_, items) = run_list(SCENARIO, "foo.tex", 4, 11).await;
+ verify::labels(&items, vec!["baz.tex"]);
+}
+
+#[tokio::test]
+async fn bibliography() {
+ let (_, items) = run_list(SCENARIO, "foo.tex", 5, 16).await;
+ verify::labels(&items, vec!["bibliography.bib", "qux"]);
+}
diff --git a/support/texlab/tests/test_completion_latex_label.rs b/support/texlab/tests/test_completion_latex_label.rs
new file mode 100644
index 0000000000..78f302672e
--- /dev/null
+++ b/support/texlab/tests/test_completion_latex_label.rs
@@ -0,0 +1,34 @@
+pub mod support;
+
+use lsp_types::Documentation;
+use support::completion::*;
+
+const SCENARIO: &str = "latex/label";
+
+#[tokio::test]
+async fn default() {
+ let (_, items) = run_list(SCENARIO, "bar.tex", 4, 5).await;
+ assert_eq!(items.len(), 6);
+ verify::text_edit(&items[0], 4, 5, 4, 5, "sec:bar");
+ verify::text_edit(&items[1], 4, 5, 4, 5, "sec:foo");
+ verify::text_edit(&items[2], 4, 5, 4, 5, "eq:foo");
+ verify::text_edit(&items[3], 4, 5, 4, 5, "eq:bar");
+ verify::text_edit(&items[4], 4, 5, 4, 5, "fig:baz");
+ verify::text_edit(&items[5], 4, 5, 4, 5, "thm:foo");
+ verify::detail(&items[0], "Section 2 (Bar)");
+ verify::detail(&items[1], "Section 1 (Foo)");
+ verify::detail(&items[2], "Equation (1)");
+ verify::detail(&items[3], "Equation (2)");
+ verify::detail(&items[4], "Figure 1");
+ verify::detail(&items[5], "Lemma 1");
+ assert_eq!(
+ *items[4].documentation.as_ref().unwrap(),
+ Documentation::String("Baz".into())
+ );
+}
+
+#[tokio::test]
+async fn equation() {
+ let (_, items) = run_list(SCENARIO, "bar.tex", 5, 7).await;
+ verify::labels(&items, vec!["eq:bar", "eq:foo"]);
+}
diff --git a/support/texlab/tests/test_completion_latex_preselect.rs b/support/texlab/tests/test_completion_latex_preselect.rs
new file mode 100644
index 0000000000..8c56a8ec9f
--- /dev/null
+++ b/support/texlab/tests/test_completion_latex_preselect.rs
@@ -0,0 +1,11 @@
+pub mod support;
+
+use support::completion::*;
+
+const SCENARIO: &str = "latex/preselect";
+
+#[tokio::test]
+async fn environment() {
+ let item = run_item(SCENARIO, "foo.tex", 2, 5, "document").await;
+ assert_eq!(item.preselect, Some(true));
+}
diff --git a/support/texlab/tests/test_completion_latex_theorem.rs b/support/texlab/tests/test_completion_latex_theorem.rs
new file mode 100644
index 0000000000..25cb419c84
--- /dev/null
+++ b/support/texlab/tests/test_completion_latex_theorem.rs
@@ -0,0 +1,12 @@
+pub mod support;
+
+use support::completion::*;
+
+const SCENARIO: &str = "latex/theorem";
+
+#[tokio::test]
+async fn newtheorem() {
+ let item = run_item(SCENARIO, "foo.tex", 4, 7, "foo").await;
+ verify::text_edit(&item, 4, 7, 4, 8, "foo");
+ verify::detail(&item, "user-defined");
+}
diff --git a/support/texlab/tests/test_completion_latex_tikz.rs b/support/texlab/tests/test_completion_latex_tikz.rs
new file mode 100644
index 0000000000..d3558fb118
--- /dev/null
+++ b/support/texlab/tests/test_completion_latex_tikz.rs
@@ -0,0 +1,21 @@
+// let item = run_completion_item("latex/tikz", "foo.tex", 1, 15, "arrows").await;
+// verify_text_edit(&item, 1, 15, 1, 15, "arrows");
+// let item = run_completion_item("latex/tikz", "foo.tex", 2, 16, "arrows").await;
+// verify_text_edit(&item, 2, 16, 2, 16, "arrows");
+pub mod support;
+
+use support::completion::*;
+
+const SCENARIO: &str = "latex/tikz";
+
+#[tokio::test]
+async fn pgf_library() {
+ let item = run_item(SCENARIO, "foo.tex", 1, 15, "arrows").await;
+ verify::text_edit(&item, 1, 15, 1, 15, "arrows");
+}
+
+#[tokio::test]
+async fn tikz_library() {
+ let item = run_item(SCENARIO, "foo.tex", 2, 16, "arrows").await;
+ verify::text_edit(&item, 2, 16, 2, 16, "arrows");
+}
diff --git a/support/texlab/tests/test_completion_latex_user.rs b/support/texlab/tests/test_completion_latex_user.rs
new file mode 100644
index 0000000000..d17a5c3f6a
--- /dev/null
+++ b/support/texlab/tests/test_completion_latex_user.rs
@@ -0,0 +1,19 @@
+pub mod support;
+
+use support::completion::*;
+
+const SCENARIO: &str = "latex/user";
+
+#[tokio::test]
+async fn command() {
+ let item = run_item(SCENARIO, "foo.tex", 1, 3, "foo").await;
+ verify::text_edit(&item, 1, 1, 1, 3, "foo");
+ verify::detail(&item, "user-defined");
+}
+
+#[tokio::test]
+async fn environment() {
+ let item = run_item(SCENARIO, "foo.tex", 4, 7, "foo").await;
+ verify::text_edit(&item, 4, 7, 4, 9, "foo");
+ verify::detail(&item, "user-defined");
+}
diff --git a/support/texlab/tests/test_definition_bibtex_string.rs b/support/texlab/tests/test_definition_bibtex_string.rs
new file mode 100644
index 0000000000..99382de534
--- /dev/null
+++ b/support/texlab/tests/test_definition_bibtex_string.rs
@@ -0,0 +1,18 @@
+pub mod support;
+
+use lsp_types::Range;
+use support::definition::*;
+use texlab::range::RangeExt;
+
+const SCENARIO: &str = "bibtex/string";
+
+#[tokio::test]
+async fn link() {
+ let (scenario, mut links) = run_link(SCENARIO, "foo.bib", 5, 14).await;
+ assert_eq!(links.len(), 1);
+ let link = links.pop().unwrap();
+ verify::origin_selection_range(&link, 5, 13, 5, 16);
+ assert_eq!(link.target_uri, scenario.uri("foo.bib").into());
+ assert_eq!(link.target_range, Range::new_simple(2, 0, 2, 20));
+ assert_eq!(link.target_selection_range, Range::new_simple(2, 8, 2, 11));
+}
diff --git a/support/texlab/tests/test_definition_latex_citation.rs b/support/texlab/tests/test_definition_latex_citation.rs
new file mode 100644
index 0000000000..20c39dfe9d
--- /dev/null
+++ b/support/texlab/tests/test_definition_latex_citation.rs
@@ -0,0 +1,27 @@
+pub mod support;
+
+use lsp_types::Range;
+use support::definition::*;
+use texlab::range::RangeExt;
+
+const SCENARIO: &str = "latex/citation";
+
+#[tokio::test]
+async fn link() {
+ let (scenario, mut links) = run_link(SCENARIO, "foo.tex", 1, 7).await;
+ assert_eq!(links.len(), 1);
+ let link = links.pop().unwrap();
+ verify::origin_selection_range(&link, 1, 6, 1, 9);
+ assert_eq!(link.target_uri, scenario.uri("bar.bib").into());
+ assert_eq!(link.target_range, Range::new_simple(2, 0, 2, 14));
+ assert_eq!(link.target_selection_range, Range::new_simple(2, 9, 2, 12));
+}
+
+#[tokio::test]
+async fn location() {
+ let (scenario, mut locations) = run_location(SCENARIO, "foo.tex", 1, 7).await;
+ assert_eq!(locations.len(), 1);
+ let location = locations.pop().unwrap();
+ assert_eq!(location.uri, scenario.uri("bar.bib").into());
+ assert_eq!(location.range, Range::new_simple(2, 9, 2, 12));
+}
diff --git a/support/texlab/tests/test_definition_latex_command.rs b/support/texlab/tests/test_definition_latex_command.rs
new file mode 100644
index 0000000000..eba32f9a17
--- /dev/null
+++ b/support/texlab/tests/test_definition_latex_command.rs
@@ -0,0 +1,18 @@
+pub mod support;
+
+use lsp_types::Range;
+use support::definition::*;
+use texlab::range::RangeExt;
+
+const SCENARIO: &str = "latex/command";
+
+#[tokio::test]
+async fn link() {
+ let (scenario, mut links) = run_link(SCENARIO, "foo.tex", 2, 2).await;
+ assert_eq!(links.len(), 1);
+ let link = links.pop().unwrap();
+ verify::origin_selection_range(&link, 2, 0, 2, 4);
+ assert_eq!(link.target_uri, scenario.uri("foo.tex").into());
+ assert_eq!(link.target_range, Range::new_simple(0, 0, 0, 22));
+ assert_eq!(link.target_selection_range, Range::new_simple(0, 0, 0, 22));
+}
diff --git a/support/texlab/tests/test_definition_latex_label.rs b/support/texlab/tests/test_definition_latex_label.rs
new file mode 100644
index 0000000000..3979b2cabe
--- /dev/null
+++ b/support/texlab/tests/test_definition_latex_label.rs
@@ -0,0 +1,73 @@
+pub mod support;
+
+use lsp_types::Range;
+use support::definition::*;
+use texlab::range::RangeExt;
+
+const SCENARIO: &str = "latex/label";
+
+#[tokio::test]
+async fn default_link() {
+ let (scenario, mut links) = run_link(SCENARIO, "default.tex", 1, 7).await;
+ assert_eq!(links.len(), 1);
+ let link = links.pop().unwrap();
+ verify::origin_selection_range(&link, 1, 5, 1, 8);
+ assert_eq!(link.target_uri, scenario.uri("default.tex").into());
+ assert_eq!(link.target_range, Range::new_simple(0, 0, 0, 11));
+ assert_eq!(link.target_selection_range, Range::new_simple(0, 0, 0, 11));
+}
+
+#[tokio::test]
+async fn equation_link() {
+ let (scenario, mut links) = run_link(SCENARIO, "equation.tex", 5, 8).await;
+ assert_eq!(links.len(), 1);
+ let link = links.pop().unwrap();
+ verify::origin_selection_range(&link, 5, 5, 5, 11);
+ assert_eq!(link.target_uri, scenario.uri("equation.tex").into());
+ assert_eq!(link.target_range, Range::new_simple(0, 0, 3, 14));
+ assert_eq!(link.target_selection_range, Range::new_simple(1, 0, 1, 14));
+}
+
+#[tokio::test]
+async fn float_link() {
+ let (scenario, mut links) = run_link(SCENARIO, "float.tex", 6, 6).await;
+ assert_eq!(links.len(), 1);
+ let link = links.pop().unwrap();
+ verify::origin_selection_range(&link, 6, 5, 6, 8);
+ assert_eq!(link.target_uri, scenario.uri("float.tex").into());
+ assert_eq!(link.target_range, Range::new_simple(0, 0, 4, 12));
+ assert_eq!(link.target_selection_range, Range::new_simple(3, 0, 3, 11));
+}
+
+#[tokio::test]
+async fn item_link() {
+ let (scenario, mut links) = run_link(SCENARIO, "item.tex", 6, 6).await;
+ assert_eq!(links.len(), 1);
+ let link = links.pop().unwrap();
+ verify::origin_selection_range(&link, 6, 5, 6, 8);
+ assert_eq!(link.target_uri, scenario.uri("item.tex").into());
+ assert_eq!(link.target_range, Range::new_simple(0, 0, 4, 15));
+ assert_eq!(link.target_selection_range, Range::new_simple(2, 9, 2, 20));
+}
+
+#[tokio::test]
+async fn section_link() {
+ let (scenario, mut links) = run_link(SCENARIO, "section.tex", 6, 6).await;
+ assert_eq!(links.len(), 1);
+ let link = links.pop().unwrap();
+ verify::origin_selection_range(&link, 6, 5, 6, 12);
+ assert_eq!(link.target_uri, scenario.uri("section.tex").into());
+ assert_eq!(link.target_range, Range::new_simple(0, 0, 3, 0));
+ assert_eq!(link.target_selection_range, Range::new_simple(1, 0, 1, 15));
+}
+
+#[tokio::test]
+async fn theorem_link() {
+ let (scenario, mut links) = run_link(SCENARIO, "theorem.tex", 8, 7).await;
+ assert_eq!(links.len(), 1);
+ let link = links.pop().unwrap();
+ verify::origin_selection_range(&link, 8, 5, 8, 12);
+ assert_eq!(link.target_uri, scenario.uri("theorem.tex").into());
+ assert_eq!(link.target_range, Range::new_simple(3, 0, 6, 11));
+ assert_eq!(link.target_selection_range, Range::new_simple(4, 0, 4, 15));
+}
diff --git a/support/texlab/tests/test_definition_latex_math_operator.rs b/support/texlab/tests/test_definition_latex_math_operator.rs
new file mode 100644
index 0000000000..7cea12261d
--- /dev/null
+++ b/support/texlab/tests/test_definition_latex_math_operator.rs
@@ -0,0 +1,18 @@
+pub mod support;
+
+use lsp_types::Range;
+use support::definition::*;
+use texlab::range::RangeExt;
+
+const SCENARIO: &str = "latex/math_operator";
+
+#[tokio::test]
+async fn link() {
+ let (scenario, mut links) = run_link(SCENARIO, "foo.tex", 2, 2).await;
+ assert_eq!(links.len(), 1);
+ let link = links.pop().unwrap();
+ verify::origin_selection_range(&link, 2, 0, 2, 4);
+ assert_eq!(link.target_uri, scenario.uri("foo.tex").into());
+ assert_eq!(link.target_range, Range::new_simple(0, 0, 0, 31));
+ assert_eq!(link.target_selection_range, Range::new_simple(0, 0, 0, 31));
+}
diff --git a/support/texlab/tests/test_diagnostics_bibtex.rs b/support/texlab/tests/test_diagnostics_bibtex.rs
new file mode 100644
index 0000000000..8198e9c152
--- /dev/null
+++ b/support/texlab/tests/test_diagnostics_bibtex.rs
@@ -0,0 +1,36 @@
+pub mod support;
+
+use lsp_types::*;
+use std::sync::Arc;
+use support::*;
+use texlab::diagnostics::BibtexErrorCode;
+
+#[tokio::test]
+async fn did_change_update() {
+ let scenario = Scenario::new("diagnostics/bibtex", Arc::new(Box::new(tex::Unknown)));
+ scenario.open("foo.bib").await;
+ {
+ let diagnostics_by_uri = scenario.client.diagnostics_by_uri.lock().await;
+ let diagnostics = &diagnostics_by_uri[&scenario.uri("foo.bib")];
+ assert_eq!(diagnostics.len(), 1);
+ assert_eq!(
+ diagnostics[0].message,
+ BibtexErrorCode::MissingBeginBrace.message()
+ );
+ assert_eq!(diagnostics[0].range.start.line, 0);
+ }
+ let params = DidChangeTextDocumentParams {
+ text_document: VersionedTextDocumentIdentifier::new(scenario.uri("foo.bib").into(), 0),
+ content_changes: vec![TextDocumentContentChangeEvent {
+ range: None,
+ range_length: None,
+ text: "@article{foo,}\n".into(),
+ }],
+ };
+ scenario.server.execute(|svr| svr.did_change(params)).await;
+ {
+ let diagnostics_by_uri = scenario.client.diagnostics_by_uri.lock().await;
+ let diagnostics = &diagnostics_by_uri[&scenario.uri("foo.bib")];
+ assert_eq!(diagnostics.len(), 0);
+ }
+}
diff --git a/support/texlab/tests/test_diagnostics_build.rs b/support/texlab/tests/test_diagnostics_build.rs
new file mode 100644
index 0000000000..9c953bee7a
--- /dev/null
+++ b/support/texlab/tests/test_diagnostics_build.rs
@@ -0,0 +1,25 @@
+pub mod support;
+
+use std::sync::Arc;
+use support::*;
+use tokio::fs;
+
+#[tokio::test]
+async fn did_change_update() {
+ let scenario = Scenario::new("diagnostics/build", Arc::new(Box::new(tex::Unknown)));
+ scenario.open("foo.tex").await;
+ {
+ let diagnostics_by_uri = scenario.client.diagnostics_by_uri.lock().await;
+ let diagnostics = &diagnostics_by_uri[&scenario.uri("foo.tex")];
+ assert_eq!(diagnostics.len(), 1);
+ assert_eq!(diagnostics[0].message, "Undefined control sequence.");
+ }
+ let log_path = scenario.uri("foo.log").to_file_path().unwrap();
+ fs::write(log_path, "").await.unwrap();
+ scenario.server.execute(|_| ()).await;
+ {
+ let diagnostics_by_uri = scenario.client.diagnostics_by_uri.lock().await;
+ let diagnostics = &diagnostics_by_uri[&scenario.uri("foo.tex")];
+ assert!(diagnostics.is_empty());
+ }
+}
diff --git a/support/texlab/tests/test_folding.rs b/support/texlab/tests/test_folding.rs
new file mode 100644
index 0000000000..0fafe553f0
--- /dev/null
+++ b/support/texlab/tests/test_folding.rs
@@ -0,0 +1,66 @@
+pub mod support;
+
+use lsp_types::*;
+use support::folding::*;
+
+#[tokio::test]
+async fn bibtex() {
+ let foldings = run("bar.bib").await;
+ assert_eq!(
+ foldings,
+ vec![
+ FoldingRange {
+ start_line: 0,
+ start_character: Some(0),
+ end_line: 0,
+ end_character: Some(23),
+ kind: Some(FoldingRangeKind::Region)
+ },
+ FoldingRange {
+ start_line: 2,
+ start_character: Some(0),
+ end_line: 2,
+ end_character: Some(19),
+ kind: Some(FoldingRangeKind::Region)
+ },
+ FoldingRange {
+ start_line: 4,
+ start_character: Some(0),
+ end_line: 23,
+ end_character: Some(0),
+ kind: Some(FoldingRangeKind::Region)
+ }
+ ]
+ );
+}
+
+#[tokio::test]
+async fn latex() {
+ let foldings = run("foo.tex").await;
+ assert_eq!(
+ foldings,
+ vec![
+ FoldingRange {
+ start_line: 4,
+ start_character: Some(16),
+ end_line: 12,
+ end_character: Some(0),
+ kind: Some(FoldingRangeKind::Region)
+ },
+ FoldingRange {
+ start_line: 6,
+ start_character: Some(13),
+ end_line: 9,
+ end_character: Some(0),
+ kind: Some(FoldingRangeKind::Region)
+ },
+ FoldingRange {
+ start_line: 8,
+ start_character: Some(16),
+ end_line: 9,
+ end_character: Some(0),
+ kind: Some(FoldingRangeKind::Region)
+ },
+ ]
+ );
+}
diff --git a/support/texlab/tests/test_formatting_bibtex.rs b/support/texlab/tests/test_formatting_bibtex.rs
new file mode 100644
index 0000000000..541b519d58
--- /dev/null
+++ b/support/texlab/tests/test_formatting_bibtex.rs
@@ -0,0 +1,34 @@
+pub mod support;
+
+use lsp_types::*;
+use support::formatting::*;
+use texlab::formatting::bibtex::BibtexFormattingOptions;
+use texlab::range::RangeExt;
+
+#[tokio::test]
+async fn default_settings() {
+ let (scenario, edits) = run_bibtex("default/unformatted.bib", None).await;
+ assert_eq!(edits.len(), 1);
+ assert_eq!(
+ edits[0].new_text,
+ scenario.read("default/formatted.bib").await
+ );
+ assert_eq!(edits[0].range, Range::new_simple(0, 0, 0, 52));
+}
+
+#[tokio::test]
+async fn infinite_line_length() {
+ let (scenario, edits) = run_bibtex(
+ "infinite_line_length/unformatted.bib",
+ Some(BibtexFormattingOptions {
+ line_length: Some(0),
+ }),
+ )
+ .await;
+ assert_eq!(edits.len(), 1);
+ assert_eq!(
+ edits[0].new_text,
+ scenario.read("infinite_line_length/formatted.bib").await
+ );
+ assert_eq!(edits[0].range, Range::new_simple(0, 0, 0, 149));
+}
diff --git a/support/texlab/tests/test_hover_bibtex_field.rs b/support/texlab/tests/test_hover_bibtex_field.rs
new file mode 100644
index 0000000000..06f12349ac
--- /dev/null
+++ b/support/texlab/tests/test_hover_bibtex_field.rs
@@ -0,0 +1,28 @@
+pub mod support;
+
+use lsp_types::*;
+use support::hover::*;
+use texlab::syntax::LANGUAGE_DATA;
+
+const SCENARIO: &str = "bibtex/field";
+
+#[tokio::test]
+async fn known() {
+ let contents = run(SCENARIO, "foo.bib", 1, 4).await.unwrap();
+ assert_eq!(
+ contents,
+ HoverContents::Markup(MarkupContent {
+ kind: MarkupKind::Markdown,
+ value: LANGUAGE_DATA
+ .field_documentation("author")
+ .unwrap()
+ .to_owned()
+ })
+ );
+}
+
+#[tokio::test]
+async fn unknown() {
+ let contents = run(SCENARIO, "foo.bib", 2, 5).await;
+ assert_eq!(contents, None);
+}
diff --git a/support/texlab/tests/test_hover_bibtex_string_reference.rs b/support/texlab/tests/test_hover_bibtex_string_reference.rs
new file mode 100644
index 0000000000..d67f028990
--- /dev/null
+++ b/support/texlab/tests/test_hover_bibtex_string_reference.rs
@@ -0,0 +1,24 @@
+pub mod support;
+
+use lsp_types::*;
+use support::hover::*;
+
+const SCENARIO: &str = "bibtex/string_reference";
+
+#[tokio::test]
+async fn valid() {
+ let contents = run(SCENARIO, "foo.bib", 3, 15).await.unwrap();
+ assert_eq!(
+ contents,
+ HoverContents::Markup(MarkupContent {
+ kind: MarkupKind::PlainText,
+ value: "\"foo {bar} baz\"".into(),
+ })
+ );
+}
+
+#[tokio::test]
+async fn invalid() {
+ let contents = run(SCENARIO, "foo.bib", 3, 20).await;
+ assert_eq!(contents, None);
+}
diff --git a/support/texlab/tests/test_hover_bibtex_type.rs b/support/texlab/tests/test_hover_bibtex_type.rs
new file mode 100644
index 0000000000..23db7084d5
--- /dev/null
+++ b/support/texlab/tests/test_hover_bibtex_type.rs
@@ -0,0 +1,28 @@
+pub mod support;
+
+use lsp_types::*;
+use support::hover::*;
+use texlab::syntax::LANGUAGE_DATA;
+
+const SCENARIO: &str = "bibtex/type";
+
+#[tokio::test]
+async fn known() {
+ let contents = run(SCENARIO, "foo.bib", 0, 5).await.unwrap();
+ assert_eq!(
+ contents,
+ HoverContents::Markup(MarkupContent {
+ kind: MarkupKind::Markdown,
+ value: LANGUAGE_DATA
+ .entry_type_documentation("article")
+ .unwrap()
+ .to_owned()
+ })
+ );
+}
+
+#[tokio::test]
+async fn unknown() {
+ let contents = run(SCENARIO, "foo.bib", 2, 2).await;
+ assert_eq!(contents, None);
+}
diff --git a/support/texlab/tests/test_hover_latex_citation.rs b/support/texlab/tests/test_hover_latex_citation.rs
new file mode 100644
index 0000000000..cbefafd27b
--- /dev/null
+++ b/support/texlab/tests/test_hover_latex_citation.rs
@@ -0,0 +1,24 @@
+pub mod support;
+
+use lsp_types::*;
+use support::hover::*;
+
+const SCENARIO: &str = "latex/citation";
+
+#[tokio::test]
+async fn valid() {
+ let contents = run(SCENARIO, "foo.tex", 2, 7).await.unwrap();
+ assert_eq!(
+ contents,
+ HoverContents::Markup(MarkupContent {
+ kind: MarkupKind::Markdown,
+ value: "Bar, F. (2019). *Baz Qux*.".into()
+ })
+ );
+}
+
+#[tokio::test]
+async fn invalid() {
+ let contents = run(SCENARIO, "foo.bib", 3, 7).await;
+ assert_eq!(contents, None);
+}
diff --git a/support/texlab/tests/test_hover_latex_component.rs b/support/texlab/tests/test_hover_latex_component.rs
new file mode 100644
index 0000000000..de5c9c8b6c
--- /dev/null
+++ b/support/texlab/tests/test_hover_latex_component.rs
@@ -0,0 +1,27 @@
+pub mod support;
+
+use support::hover::*;
+
+const SCENARIO: &str = "latex/component";
+
+#[tokio::test]
+async fn class_known() {
+ run(SCENARIO, "foo.tex", 0, 18).await.unwrap();
+}
+
+#[tokio::test]
+async fn class_unknown() {
+ let contents = run(SCENARIO, "foo.tex", 2, 16).await;
+ assert_eq!(contents, None);
+}
+
+#[tokio::test]
+async fn package_known() {
+ run(SCENARIO, "foo.tex", 1, 17).await.unwrap();
+}
+
+#[tokio::test]
+async fn package_unknown() {
+ let contents = run(SCENARIO, "foo.tex", 3, 14).await;
+ assert_eq!(contents, None);
+}
diff --git a/support/texlab/tests/test_hover_latex_label.rs b/support/texlab/tests/test_hover_latex_label.rs
new file mode 100644
index 0000000000..94a96ad533
--- /dev/null
+++ b/support/texlab/tests/test_hover_latex_label.rs
@@ -0,0 +1,59 @@
+pub mod support;
+
+use lsp_types::*;
+use std::sync::Arc;
+use support::capabilities::CLIENT_FULL_CAPABILITIES;
+use support::*;
+use tokio::fs;
+
+const SCENARIO: &str = "hover/latex/label";
+
+#[tokio::test]
+async fn reload_aux() {
+ let scenario = Scenario::new(SCENARIO, Arc::new(Box::new(tex::Unknown)));
+ scenario.initialize(&CLIENT_FULL_CAPABILITIES).await;
+ scenario.open("section.tex").await;
+ let position = Position::new(3, 10);
+ let identifier = TextDocumentIdentifier::new(scenario.uri("section.tex").into());
+ let params = TextDocumentPositionParams::new(identifier, position);
+ let contents = scenario
+ .server
+ .execute_async(|svr| svr.hover(params.clone()))
+ .await
+ .unwrap()
+ .unwrap()
+ .contents;
+
+ assert_eq!(
+ contents,
+ HoverContents::Markup(MarkupContent {
+ kind: MarkupKind::PlainText,
+ value: "Section (Foo)".into()
+ })
+ );
+
+ let aux_path = scenario
+ .uri("section.tex")
+ .to_file_path()
+ .unwrap()
+ .with_extension("aux");
+ fs::write(aux_path, "\\newlabel{sec:foo}{{1}{1}}")
+ .await
+ .unwrap();
+
+ let contents = scenario
+ .server
+ .execute_async(|svr| svr.hover(params))
+ .await
+ .unwrap()
+ .unwrap()
+ .contents;
+
+ assert_eq!(
+ contents,
+ HoverContents::Markup(MarkupContent {
+ kind: MarkupKind::PlainText,
+ value: "Section 1 (Foo)".into()
+ })
+ );
+}
diff --git a/support/texlab/tests/test_symbol_hierarchical.rs b/support/texlab/tests/test_symbol_hierarchical.rs
new file mode 100644
index 0000000000..d83c0db455
--- /dev/null
+++ b/support/texlab/tests/test_symbol_hierarchical.rs
@@ -0,0 +1,167 @@
+pub mod support;
+
+use lsp_types::Range;
+use support::symbol::*;
+use texlab::range::RangeExt;
+
+#[tokio::test]
+async fn enumerate() {
+ let mut symbols = run_hierarchical("enumerate.tex").await;
+ assert_eq!(symbols.len(), 1);
+ verify::symbol(
+ &symbols[0],
+ "Enumerate",
+ None,
+ Range::new_simple(4, 0, 9, 15),
+ Range::new_simple(4, 0, 9, 15),
+ );
+
+ let children = symbols[0].children.take().unwrap();
+ assert_eq!(children.len(), 4);
+ verify::symbol(
+ &children[0],
+ "1",
+ Some("it:foo"),
+ Range::new_simple(5, 9, 5, 23),
+ Range::new_simple(5, 4, 6, 4),
+ );
+ verify::symbol(
+ &children[1],
+ "Item",
+ Some("it:bar"),
+ Range::new_simple(6, 9, 6, 23),
+ Range::new_simple(6, 4, 7, 4),
+ );
+ verify::symbol(
+ &children[2],
+ "Baz",
+ None,
+ Range::new_simple(7, 4, 7, 14),
+ Range::new_simple(7, 4, 8, 4),
+ );
+ verify::symbol(
+ &children[3],
+ "Qux",
+ Some("it:qux"),
+ Range::new_simple(8, 14, 8, 28),
+ Range::new_simple(8, 4, 9, 0),
+ );
+}
+
+#[tokio::test]
+async fn equation() {
+ let symbols = run_hierarchical("equation.tex").await;
+ assert_eq!(symbols.len(), 3);
+ verify::symbol(
+ &symbols[0],
+ "Equation (1)",
+ Some("eq:foo"),
+ Range::new_simple(4, 16, 4, 30),
+ Range::new_simple(4, 0, 6, 14),
+ );
+ verify::symbol(
+ &symbols[1],
+ "Equation",
+ Some("eq:bar"),
+ Range::new_simple(8, 16, 8, 30),
+ Range::new_simple(8, 0, 10, 14),
+ );
+ verify::symbol(
+ &symbols[2],
+ "Equation",
+ None,
+ Range::new_simple(12, 0, 14, 14),
+ Range::new_simple(12, 0, 14, 14),
+ );
+}
+
+#[tokio::test]
+async fn float() {
+ let symbols = run_hierarchical("float.tex").await;
+ assert_eq!(symbols.len(), 3);
+ verify::symbol(
+ &symbols[0],
+ "Figure 1: Foo",
+ Some("fig:foo"),
+ Range::new_simple(6, 17, 6, 32),
+ Range::new_simple(4, 0, 7, 12),
+ );
+ verify::symbol(
+ &symbols[1],
+ "Figure: Bar",
+ Some("fig:bar"),
+ Range::new_simple(11, 17, 11, 32),
+ Range::new_simple(9, 0, 12, 12),
+ );
+ verify::symbol(
+ &symbols[2],
+ "Figure: Baz",
+ None,
+ Range::new_simple(14, 0, 17, 12),
+ Range::new_simple(14, 0, 17, 12),
+ );
+}
+
+#[tokio::test]
+async fn section() {
+ let mut symbols = run_hierarchical("section.tex").await;
+ assert_eq!(symbols.len(), 2);
+ verify::symbol(
+ &symbols[0],
+ "Foo",
+ None,
+ Range::new_simple(4, 0, 4, 13),
+ Range::new_simple(4, 0, 6, 0),
+ );
+ verify::symbol(
+ &symbols[1],
+ "2 Bar",
+ Some("sec:bar"),
+ Range::new_simple(6, 0, 6, 13),
+ Range::new_simple(6, 0, 10, 0),
+ );
+
+ let children = symbols[1].children.take().unwrap();
+ assert_eq!(children.len(), 1);
+ verify::symbol(
+ &children[0],
+ "Baz",
+ Some("sec:baz"),
+ Range::new_simple(8, 0, 8, 16),
+ Range::new_simple(8, 0, 10, 0),
+ );
+}
+
+#[tokio::test]
+async fn theorem() {
+ let symbols = run_hierarchical("theorem.tex").await;
+ assert_eq!(symbols.len(), 4);
+ verify::symbol(
+ &symbols[0],
+ "Lemma 1 (Foo)",
+ Some("thm:foo"),
+ Range::new_simple(6, 18, 6, 33),
+ Range::new_simple(6, 0, 8, 11),
+ );
+ verify::symbol(
+ &symbols[1],
+ "Lemma 2",
+ Some("thm:bar"),
+ Range::new_simple(10, 13, 10, 28),
+ Range::new_simple(10, 0, 12, 11),
+ );
+ verify::symbol(
+ &symbols[2],
+ "Lemma",
+ Some("thm:baz"),
+ Range::new_simple(14, 13, 14, 28),
+ Range::new_simple(14, 0, 16, 11),
+ );
+ verify::symbol(
+ &symbols[3],
+ "Lemma (Qux)",
+ None,
+ Range::new_simple(18, 0, 20, 11),
+ Range::new_simple(18, 0, 20, 11),
+ );
+}
diff --git a/support/texlab/tests/test_symbol_workspace.rs b/support/texlab/tests/test_symbol_workspace.rs
new file mode 100644
index 0000000000..cb6421c086
--- /dev/null
+++ b/support/texlab/tests/test_symbol_workspace.rs
@@ -0,0 +1,48 @@
+pub mod support;
+
+use support::symbol::*;
+
+#[tokio::test]
+async fn filter_type_section() {
+ let (scenario, symbols) = run_workspace("section").await;
+ assert_eq!(symbols.len(), 4);
+ verify::symbol_info(&symbols[0], &scenario, "foo.tex", "1 Foo", 07, 0, 13, 0);
+ verify::symbol_info(&symbols[1], &scenario, "foo.tex", "2 Bar", 13, 0, 21, 0);
+ verify::symbol_info(&symbols[2], &scenario, "foo.tex", "3 Baz", 21, 0, 29, 0);
+ verify::symbol_info(&symbols[3], &scenario, "foo.tex", "4 Qux", 29, 0, 37, 0);
+}
+
+#[tokio::test]
+async fn filter_type_figure() {
+ let (scenario, symbols) = run_workspace("figure").await;
+ assert_eq!(symbols.len(), 1);
+ let name = "Figure 1: Bar";
+ verify::symbol_info(&symbols[0], &scenario, "foo.tex", name, 15, 0, 19, 12);
+}
+
+#[tokio::test]
+async fn filter_type_item() {
+ let (scenario, symbols) = run_workspace("item").await;
+ assert_eq!(symbols.len(), 3);
+ verify::symbol_info(&symbols[0], &scenario, "foo.tex", "1", 24, 4, 25, 4);
+ verify::symbol_info(&symbols[1], &scenario, "foo.tex", "2", 25, 4, 26, 4);
+ verify::symbol_info(&symbols[2], &scenario, "foo.tex", "3", 26, 4, 27, 0);
+}
+
+#[tokio::test]
+async fn filter_type_math() {
+ let (scenario, symbols) = run_workspace("math").await;
+ assert_eq!(symbols.len(), 2);
+ let name1 = "Equation (1)";
+ let name2 = "Lemma 1 (Qux)";
+ verify::symbol_info(&symbols[0], &scenario, "foo.tex", name1, 9, 0, 11, 14);
+ verify::symbol_info(&symbols[1], &scenario, "foo.tex", name2, 33, 0, 35, 11);
+}
+
+#[tokio::test]
+async fn filter_bibtex() {
+ let (scenario, symbols) = run_workspace("bibtex").await;
+ assert_eq!(symbols.len(), 2);
+ verify::symbol_info(&symbols[0], &scenario, "bar.bib", "foo", 0, 0, 0, 14);
+ verify::symbol_info(&symbols[1], &scenario, "bar.bib", "bar", 2, 0, 2, 20);
+}