diff options
author | Norbert Preining <norbert@preining.info> | 2023-04-12 03:01:14 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-04-12 03:01:14 +0000 |
commit | 45c7bac9080d91b53c686e776fc6217d7f139b86 (patch) | |
tree | 9dd0ad4713ddbc97580545398e8a3c84ac52bf49 /support/texlab/tests/lsp | |
parent | e6c62f5e4d4a4d5ab654dad1652e83a5a4a42891 (diff) |
CTAN sync 202304120301
Diffstat (limited to 'support/texlab/tests/lsp')
110 files changed, 0 insertions, 5350 deletions
diff --git a/support/texlab/tests/lsp/fixture.rs b/support/texlab/tests/lsp/fixture.rs deleted file mode 100644 index ebebe1f5e6..0000000000 --- a/support/texlab/tests/lsp/fixture.rs +++ /dev/null @@ -1,266 +0,0 @@ -use std::{ - path::{Path, PathBuf}, - sync::Once, - thread::JoinHandle, -}; - -use anyhow::Result; -use lsp_server::Connection; -use lsp_types::{ - notification::{DidOpenTextDocument, Exit, Initialized}, - request::{Initialize, Shutdown}, - ClientCapabilities, DidOpenTextDocumentParams, InitializeParams, InitializedParams, Location, - Position, Range, TextDocumentIdentifier, TextDocumentItem, TextDocumentPositionParams, Url, -}; -use tempfile::{tempdir, TempDir}; -use texlab::{db::Language, LspClient, Server}; - -#[derive(Debug)] -pub struct Fixture { - pub documents: Vec<Document>, -} - -impl Fixture { - pub fn parse(input: &str) -> Fixture { - let mut documents = Vec::new(); - - let mut start = 0; - for end in input - .match_indices("%!") - .skip(1) - .map(|(i, _)| i) - .chain(std::iter::once(input.len())) - { - documents.push(Document::parse(&input[start..end])); - start = end; - } - - Self { documents } - } - - pub fn setup(&self, client: &LspClient, dir: &Path) -> Result<()> { - for document in &self.documents { - let text = String::from(&document.text); - let path = dir.join(&document.path); - std::fs::create_dir_all(path.parent().unwrap())?; - std::fs::write(&path, &text)?; - - let uri = Url::from_file_path(&path).unwrap(); - let language = Language::from_path(&path).unwrap_or(Language::Tex); - let language_id = String::from(match language { - Language::Tex => "latex", - Language::Bib => "bibtex", - Language::Log | Language::TexlabRoot | Language::Tectonic => continue, - }); - - client.send_notification::<DidOpenTextDocument>(DidOpenTextDocumentParams { - text_document: TextDocumentItem::new(uri, language_id, 0, text), - })?; - } - - Ok(()) - } -} - -#[derive(Debug)] -pub struct Document { - pub path: PathBuf, - pub text: String, - pub cursor: Option<Position>, - pub ranges: Vec<Range>, -} - -impl Document { - pub fn parse(input: &str) -> Self { - let mut lines = Vec::new(); - - let (path, input) = input - .trim() - .strip_prefix("%! ") - .map(|input| input.split_once('\n').unwrap_or((input, ""))) - .unwrap(); - - let mut ranges = Vec::new(); - let mut cursor = None; - - for line in input.lines().map(|line| line.trim_end()) { - if line.chars().all(|c| matches!(c, ' ' | '^' | '|' | '!')) && !line.is_empty() { - let index = (lines.len() - 1) as u32; - - cursor = cursor.or_else(|| { - let character = line.find('|')?; - Some(Position::new(index, character as u32)) - }); - - if let Some(start) = line.find('!') { - let position = Position::new(index, start as u32); - ranges.push(Range::new(position, position)); - } - - if let Some(start) = line.find('^') { - let end = line.rfind('^').unwrap() + 1; - ranges.push(Range::new( - Position::new(index, start as u32), - Position::new(index, end as u32), - )); - } - } else { - lines.push(line); - } - } - - Self { - path: PathBuf::from(path), - text: lines.join("\n"), - cursor, - ranges, - } - } -} - -static LOGGER: Once = Once::new(); - -#[derive(Debug)] -pub struct TestBed { - fixture: Fixture, - locations: Vec<Location>, - directory: TempDir, - client: LspClient, - client_thread: Option<JoinHandle<()>>, - server_thread: Option<JoinHandle<()>>, -} - -impl Drop for TestBed { - fn drop(&mut self) { - let _ = self.client.send_request::<Shutdown>(()); - let _ = self.client.send_notification::<Exit>(()); - self.client_thread.take().unwrap().join().unwrap(); - self.server_thread.take().unwrap().join().unwrap(); - } -} - -impl TestBed { - pub fn new(fixture: &str) -> Result<Self> { - LOGGER.call_once(|| { - if option_env!("TEST_LOG") == Some("1") { - fern::Dispatch::new() - .filter(|metadata| { - metadata.target().contains("texlab") - || metadata.target().contains("lsp_server") - }) - .level(log::LevelFilter::Trace) - .chain(std::io::stderr()) - .apply() - .unwrap() - } - }); - - let fixture = Fixture::parse(fixture); - let (server_conn, client_conn) = Connection::memory(); - - let client = LspClient::new(client_conn.sender); - - let server_thread = std::thread::spawn(move || Server::new(server_conn).run().unwrap()); - let client_thread = { - let client = client.clone(); - std::thread::spawn(move || { - for message in &client_conn.receiver { - match message { - lsp_server::Message::Request(request) => { - client - .send_error( - request.id, - lsp_server::ErrorCode::MethodNotFound.into(), - "Method not found".into(), - ) - .unwrap(); - } - lsp_server::Message::Response(response) => { - client.recv_response(response).unwrap(); - } - lsp_server::Message::Notification(_) => {} - } - } - }) - }; - - let directory = tempdir()?; - let locations = fixture - .documents - .iter() - .flat_map(|document| { - let uri = Url::from_file_path(directory.path().join(&document.path)).unwrap(); - document - .ranges - .iter() - .map(move |range| Location::new(uri.clone(), *range)) - }) - .collect(); - - Ok(TestBed { - fixture, - locations, - directory, - client, - client_thread: Some(client_thread), - server_thread: Some(server_thread), - }) - } - - pub fn initialize(&self, capabilities: ClientCapabilities) -> Result<()> { - self.client.send_request::<Initialize>(InitializeParams { - capabilities, - initialization_options: Some(serde_json::json!({ "skipDistro": true })), - ..Default::default() - })?; - - self.client - .send_notification::<Initialized>(InitializedParams {})?; - - self.fixture.setup(&self.client, &self.directory.path())?; - Ok(()) - } - - pub fn client(&self) -> &LspClient { - &self.client - } - - pub fn cursor(&self) -> Option<TextDocumentPositionParams> { - let (document, cursor) = self - .fixture - .documents - .iter() - .find_map(|document| document.cursor.map(|cursor| (document, cursor)))?; - - let uri = Url::from_file_path(self.directory.path().join(&document.path)).unwrap(); - let id = TextDocumentIdentifier::new(uri); - Some(TextDocumentPositionParams::new(id, cursor)) - } - - pub fn locations(&self) -> &[Location] { - &self.locations - } - - pub fn directory(&self) -> &Path { - self.directory.path() - } - - pub fn documents(&self) -> &[Document] { - &self.fixture.documents - } - - pub fn redact(&self, uri: &Url) -> Url { - let root = if cfg!(windows) { - PathBuf::from("C:/") - } else { - PathBuf::from("/") - }; - - let path = uri.to_file_path().unwrap(); - let path = path.strip_prefix(self.directory()).unwrap_or(&path); - let path = root.join(path); - - let uri = Url::from_file_path(path).unwrap(); - Url::parse(&uri.as_str().replace("file:///C:/", "file:///")).unwrap() - } -} diff --git a/support/texlab/tests/lsp/main.rs b/support/texlab/tests/lsp/main.rs deleted file mode 100644 index aeb4f8993c..0000000000 --- a/support/texlab/tests/lsp/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod fixture; -mod text_document; -mod workspace; diff --git a/support/texlab/tests/lsp/text_document.rs b/support/texlab/tests/lsp/text_document.rs deleted file mode 100644 index cfab1d04c8..0000000000 --- a/support/texlab/tests/lsp/text_document.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod completion; -mod definition; -mod document_highlight; -mod document_link; -mod document_symbol; -mod folding_range; -mod formatting; -mod hover; -mod inlay_hint; -mod references; -mod rename; diff --git a/support/texlab/tests/lsp/text_document/completion.rs b/support/texlab/tests/lsp/text_document/completion.rs deleted file mode 100644 index 3c2e7962d4..0000000000 --- a/support/texlab/tests/lsp/text_document/completion.rs +++ /dev/null @@ -1,854 +0,0 @@ -use insta::assert_json_snapshot; -use itertools::Itertools; -use lsp_types::{ - request::{Completion, ResolveCompletionItem}, - CompletionItem, CompletionParams, CompletionResponse, CompletionTextEdit, Range, -}; - -use crate::fixture::TestBed; - -fn complete(fixture: &str) -> Vec<CompletionItem> { - let test_bed = TestBed::new(fixture).unwrap(); - test_bed - .initialize( - serde_json::from_value(serde_json::json!({ - "textDocument": { - "completion": { - "completionItem": { - "documentationFormat": ["plaintext", "markdown"] - } - } - } - })) - .unwrap(), - ) - .unwrap(); - - let text_document_position = test_bed.cursor().unwrap(); - let position = text_document_position.position; - let range = test_bed - .locations() - .first() - .map_or_else(|| Range::new(position, position), |location| location.range); - - let items = match test_bed - .client() - .send_request::<Completion>(CompletionParams { - text_document_position, - partial_result_params: Default::default(), - work_done_progress_params: Default::default(), - context: None, - }) - .unwrap() - { - Some(CompletionResponse::Array(items)) => items, - Some(CompletionResponse::List(list)) => list.items, - None => Vec::new(), - }; - - for item in &items { - if let Some(CompletionTextEdit::Edit(edit)) = item.text_edit.as_ref() { - assert_eq!(edit.range, range); - } - } - - items - .into_iter() - .take(5) - .map(|item| { - let mut item = test_bed - .client() - .send_request::<ResolveCompletionItem>(item) - .unwrap(); - - item.data = None; - item.kind = None; - item.sort_text = None; - item.documentation = None; - item.text_edit = None; - item - }) - .sorted_by(|item1, item2| item1.label.cmp(&item2.label)) - .collect() -} - -#[test] -fn acronym_ref_simple() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second} -\acrshort{f} - | - ^"# - )); -} - -#[test] -fn acronym_ref_empty() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second} -\acrshort{} - |"# - )); -} - -#[test] -fn acronym_ref_after_group() { - assert_eq!( - complete( - r#" -%! main.tex -\newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second} -\acrshort{} - |"#, - ), - Vec::new() - ); -} - -#[test] -fn acronym_ref_open_brace() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second} -\acrshort{f - | - ^"# - )); -} - -#[test] -fn acronym_package_ref() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\acrodef{fpsLabel}[FPS]{Frames per Second} -\ac{f - | - ^"# - )); -} - -#[test] -fn glossary_ref_simple() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second} -\gls{f} - | - ^"# - )); -} - -#[test] -fn glossary_ref_open_brace() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second} -\gls{f - | - ^"# - )); -} - -#[test] -fn argument_empty() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\usepackage{amsfonts} -\mathbb{} - |"# - )); -} - -#[test] -fn argument_word() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\usepackage{amsfonts} -\mathbb{A} - | - ^"# - )); -} - -#[test] -fn argument_open_brace() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\usepackage{amsfonts} -\mathbb{ - | -Test"# - )); -} - -#[test] -fn argument_open_brace_unrelated() { - assert_eq!( - complete( - r#" -%! main.tex -\usepackage{amsfonts} -\mathbb{}{ - | -Test"#, - ), - Vec::new() - ); -} - -#[test] -fn begin_environment_without_snippet_support() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\beg - | - ^^^"# - )); -} - -#[test] -fn citation() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\documentclass{article} -\bibliography{main} -\begin{document} -\cite{ - | -\end{document} - -%! main.bib -@article{foo:2019, - author = {Foo Bar}, - title = {Baz Qux}, - year = {2019}, -} - -@article{bar:2005,}"# - )); -} - -#[test] -fn citation_open_brace() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\addbibresource{main.bib} -\cite{ - | - -%! main.bib -@article{foo,}"# - )); -} - -#[test] -fn citation_open_brace_multiple() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\addbibresource{main.bib} -\cite{foo,a - | - ^ - -%! main.bib -@article{foo,}"# - )); -} - -#[test] -fn citation_acronym() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\addbibresource{main.bib} -\DeclareAcronym{foo}{cite={}} - | - -%! main.bib -@article{foo,}"# - )); -} - -#[test] -fn citation_after_brace() { - assert_eq!( - complete( - r#" -%! main.tex -\documentclass{article} -\bibliography{main} -\begin{document} -\cite{} - | -\end{document} - -%! main.bib -@article{foo,}"#, - ), - Vec::new() - ); -} - -#[test] -fn color_model_definition_simple() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\definecolor{foo}{} - |"# - )); -} - -#[test] -fn color_model_definition_open_brace() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\definecolor{foo}{ - |"# - )); -} - -#[test] -fn color_model_definition_set_simple() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\definecolorset{} - |"# - )); -} - -#[test] -fn color_model_definition_set_open_brace() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\definecolorset{ - |"# - )); -} - -#[test] -fn color_simple() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\color{} - |"# - )); -} - -#[test] -fn color_word() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\color{re} - | - ^^"# - )); -} - -#[test] -fn color_open_brace() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\color{ - |"# - )); -} - -#[test] -fn component_command_simple() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\ - |"# - )); -} - -#[test] -fn component_command_simple_before() { - assert_eq!( - complete( - r#" -%! main.tex -\ -|"#, - ), - Vec::new() - ); -} - -#[test] -fn component_command_simple_package() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\usepackage{lipsum} -\lips - | - ^^^^"# - )); -} - -#[test] -fn component_command_bibtex() { - assert_json_snapshot!(complete( - r#" -%! main.bib -@article{b, - c = {\LaT } - | - ^^^ -}"# - )); -} - -#[test] -fn component_environment_simple() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\begin{doc - | - ^^^"# - )); -} - -#[test] -fn component_environment_simple_end() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\begin{document} -\end{ - |"# - )); -} - -#[test] -fn component_environment_class() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\documentclass{article} -\begin{thein} - | - ^^^^^"# - )); -} - -#[test] -fn component_environment_command_definition() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\newcommand{\foo}{\begin{doc} - | - ^^^"# - )); -} - -#[test] -fn entry_type_at_empty() { - assert_json_snapshot!(complete( - r#" -%! main.bib -@ - |"# - )); -} - -#[test] -fn entry_type_before_preamble() { - assert_json_snapshot!(complete( - r#" -%! main.bib -@preamble - | - ^^^^^^^^"# - )); -} - -#[test] -fn entry_type_before_string() { - assert_json_snapshot!(complete( - r#" -%! main.bib -@string - | - ^^^^^^"# - )); -} - -#[test] -fn entry_type_before_article() { - assert_json_snapshot!(complete( - r#" -%! main.bib -@article - | - ^^^^^^^"# - )); -} - -#[test] -fn entry_type_after_preamble() { - assert_json_snapshot!(complete( - r#" -%! main.bib -@preamble{ - | - ^^^^^^^^"# - )); -} - -#[test] -fn entry_type_after_string() { - assert_json_snapshot!(complete( - r#" -%! main.bib -@string{ - | - ^^^^^^"# - )); -} - -#[test] -fn entry_type_complete_entry() { - assert_json_snapshot!(complete( - r#" -%! main.bib -@article{foo, author = {foo}} - | - ^^^^^^^"# - )); -} - -#[test] -fn field_empty_entry_open() { - assert_json_snapshot!(complete( - r#" -%! main.bib -@article{foo, - |"# - )); -} - -#[test] -fn field_empty_entry_closed() { - assert_json_snapshot!(complete( - r#" -%! main.bib -@article{foo,} - |"# - )); -} - -#[test] -fn field_entry_field_name() { - assert_json_snapshot!(complete( - r#" -%! main.bib -@article{foo, a - | - ^"# - )); -} - -#[test] -fn field_entry_two_fields_name_open() { - assert_json_snapshot!(complete( - r#" -%! main.bib -@article{foo, author = bar, edit - | - ^^^^"# - )); -} - -#[test] -fn field_entry_two_fields_name_closed() { - assert_json_snapshot!(complete( - r#" -%! main.bib -@article{foo, author = bar, edit} - | - ^^^^"# - )); -} - -#[test] -fn import_package_open_brace() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\usepackage{lips - | - ^^^^"# - )); -} - -#[test] -fn import_package_closed_brace() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\usepackage{lips} - | - ^^^^"# - )); -} - -#[test] -fn import_class_open_brace() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\documentclass{art \foo - | - ^^^"# - )); -} - -#[test] -fn import_class_closed_brace() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\documentclass{art} - | - ^^^"# - )); -} - -#[test] -fn label() { - assert_json_snapshot!(complete( - r#" -%! foo.tex -\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} - -%! bar.tex -\section{Bar}% -\label{sec:bar} - -Lorem ipsum dolor sit amet. -\ref{} - | - -%! foo.aux -\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}"# - )); -} - -#[test] -fn theorem_begin() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\newtheorem{lemma}{Lemma} -\begin{lem - | - ^^^"# - )); -} - -#[test] -fn theorem_end() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\newtheorem{lemma}{Lemma} -\begin{} -\end{lem - | - ^^^"# - )); -} - -#[test] -fn tikz_library_open_brace() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\usepgflibrary{ - |"# - )); -} - -#[test] -fn tikz_library_closed_brace() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\usepgflibrary{} - |"# - )); -} - -#[test] -fn test_user_command() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\foobar -\fooba - | - ^^^^^ -\begin{foo} -\end{foo} -\begin{fo}"# - )); -} - -#[test] -fn test_user_environment() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\foobar -\fooba -\begin{foo} -\end{foo} -\begin{fo} - | - ^^"# - )); -} - -#[test] -fn test_project_resolution_import() { - assert_json_snapshot!(complete( - r#" -%! main.tex -\documentclass{article} -\import{sub}{sub/sub.tex} -\lipsu - | - ^^^^^ - -%! sub/sub.tex -\input{child.tex} - -%! sub/child.tex -\usepackage{lipsum}"# - )); -} - -#[test] -fn test_project_resolution_texlabroot() { - assert_json_snapshot!(complete( - r#" -%! src/main.tex -\documentclass{article} -\include{src/foo} -\lipsu - | - ^^^^^ - -%! src/foo.tex -\include{src/bar} - -%! src/bar.tex -\usepackage{lipsum} - -%! .texlabroot"# - )); -} - -#[test] -fn issue_857_1() { - assert_json_snapshot!(complete( - r#" -%! bug.tex -\documentclass{article} -\newcommand{\ö}{foo} -\newcommand{\öö}{bar} -\newcommand{\ööabc}{baz} -\begin{document} -\ö - | - ^ -\end{document} -"# - )); -} - -#[test] -fn issue_864() { - assert_json_snapshot!(complete( - r#" -%! bug.tex -\documentclass{article} -\def\あいうえお{} -\begin{document} -\あ - | - ^ -\end{document}"# - )) -} diff --git a/support/texlab/tests/lsp/text_document/definition.rs b/support/texlab/tests/lsp/text_document/definition.rs deleted file mode 100644 index 78eed633c8..0000000000 --- a/support/texlab/tests/lsp/text_document/definition.rs +++ /dev/null @@ -1,156 +0,0 @@ -use itertools::Itertools; -use lsp_types::{ - request::GotoDefinition, ClientCapabilities, GotoDefinitionParams, GotoDefinitionResponse, - LocationLink, -}; - -use crate::fixture::TestBed; - -fn check(fixture: &str) { - let test_bed = TestBed::new(fixture).unwrap(); - test_bed.initialize(ClientCapabilities::default()).unwrap(); - - let text_document_position_params = test_bed.cursor().unwrap(); - let cursor = text_document_position_params.position; - - let origin_selection = test_bed - .locations() - .iter() - .filter(|location| location.uri == text_document_position_params.text_document.uri) - .find(|location| cursor >= location.range.start && cursor <= location.range.end); - - let mut expected_links: Vec<_> = test_bed - .locations() - .iter() - .filter(|location| Some(*location) != origin_selection) - .batching(|it| { - let target_selection_range = it.next()?.range; - let target = it.next()?; - Some(LocationLink { - origin_selection_range: origin_selection.map(|sel| sel.range), - target_uri: target.uri.clone(), - target_range: target.range, - target_selection_range, - }) - }) - .collect(); - - let mut actual_links = match test_bed - .client() - .send_request::<GotoDefinition>(GotoDefinitionParams { - text_document_position_params, - partial_result_params: Default::default(), - work_done_progress_params: Default::default(), - }) - .unwrap() - { - Some(GotoDefinitionResponse::Link(links)) => links, - Some(GotoDefinitionResponse::Array(_)) => unreachable!(), - Some(GotoDefinitionResponse::Scalar(_)) => unreachable!(), - None => Vec::new(), - }; - - sort_links(&mut actual_links); - sort_links(&mut expected_links); - assert_eq!(actual_links, expected_links); -} - -fn sort_links(links: &mut Vec<LocationLink>) { - links.sort_by(|a, b| { - let left = (&a.target_uri, a.target_range.start); - let right = (&b.target_uri, b.target_range.start); - left.cmp(&right) - }); -} - -#[test] -fn command_definition() { - check( - r#" -%! main.tex -\DeclareMathOperator{\foo}{foo} - ^^^^ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -\foo - | -^^^^"#, - ) -} - -#[test] -fn document() { - check( - r#" -%! foo.tex -\addbibresource{baz.bib} - | - ^^^^^^^ - -%! bar.bib -@article{foo, bar = {baz}} - -%! baz.bib -@article{foo, bar = {baz}} -! -!"#, - ) -} - -#[test] -fn entry() { - check( - r#" -%! foo.tex -\addbibresource{baz.bib} -\cite{foo} - | - ^^^ - -%! bar.bib -@article{foo, bar = {baz}} - -%! baz.bib -@article{foo, bar = {baz}} - ^^^ -^^^^^^^^^^^^^^^^^^^^^^^^^^"#, - ) -} - -#[test] -fn string_simple() { - check( - r#" -%! main.bib -@string{foo = {bar}} - ^^^ -^^^^^^^^^^^^^^^^^^^^ -@article{bar, author = foo} - | - ^^^"#, - ) -} - -#[test] -fn string_join() { - check( - r#" -%! main.bib -@string{foo = {bar}} - ^^^ -^^^^^^^^^^^^^^^^^^^^ -@article{bar, author = foo # "bar"} - | - ^^^"#, - ) -} - -#[test] -fn string_field() { - check( - r#" -%! main.bib -@string{foo = {bar}} -@article{bar, author = foo # "bar"} - |"#, - ) -} diff --git a/support/texlab/tests/lsp/text_document/document_highlight.rs b/support/texlab/tests/lsp/text_document/document_highlight.rs deleted file mode 100644 index 5cfb8fbee8..0000000000 --- a/support/texlab/tests/lsp/text_document/document_highlight.rs +++ /dev/null @@ -1,51 +0,0 @@ -use assert_unordered::assert_eq_unordered; -use lsp_types::{ - request::DocumentHighlightRequest, ClientCapabilities, DocumentHighlight, - DocumentHighlightKind, DocumentHighlightParams, -}; - -use crate::fixture::TestBed; - -fn check(fixture: &str, highlight_kinds: &[DocumentHighlightKind]) { - let test_bed = TestBed::new(fixture).unwrap(); - test_bed.initialize(ClientCapabilities::default()).unwrap(); - - let expected: Vec<_> = test_bed - .locations() - .iter() - .zip(highlight_kinds) - .map(|(location, kind)| DocumentHighlight { - range: location.range, - kind: Some(*kind), - }) - .collect(); - - let text_document_position_params = test_bed.cursor().unwrap(); - let actual = test_bed - .client() - .send_request::<DocumentHighlightRequest>(DocumentHighlightParams { - text_document_position_params, - partial_result_params: Default::default(), - work_done_progress_params: Default::default(), - }) - .unwrap() - .unwrap_or_default(); - - assert_eq_unordered!(actual, expected); -} - -#[test] -fn test_label() { - check( - r#" -%! main.tex -\label{foo} - | - ^^^ -\ref{foo} - ^^^ -\label{bar} -"#, - &[DocumentHighlightKind::WRITE, DocumentHighlightKind::READ], - ) -} diff --git a/support/texlab/tests/lsp/text_document/document_link.rs b/support/texlab/tests/lsp/text_document/document_link.rs deleted file mode 100644 index 6aab6105de..0000000000 --- a/support/texlab/tests/lsp/text_document/document_link.rs +++ /dev/null @@ -1,52 +0,0 @@ -use insta::assert_json_snapshot; -use lsp_types::{ - request::DocumentLinkRequest, ClientCapabilities, DocumentLink, DocumentLinkParams, -}; - -use crate::fixture::TestBed; - -fn find_links(fixture: &str) -> Vec<DocumentLink> { - let test_bed = TestBed::new(fixture).unwrap(); - test_bed.initialize(ClientCapabilities::default()).unwrap(); - - let text_document_position = test_bed.cursor().unwrap(); - let mut links = test_bed - .client() - .send_request::<DocumentLinkRequest>(DocumentLinkParams { - text_document: text_document_position.text_document, - work_done_progress_params: Default::default(), - partial_result_params: Default::default(), - }) - .unwrap() - .unwrap_or_default(); - - for link in &mut links { - link.target = Some(test_bed.redact(link.target.as_ref().unwrap())); - } - - links -} - -#[test] -fn document_include() { - assert_json_snapshot!(find_links( - r#" -%! foo.tex -\input{bar.tex} -| - -%! bar.tex"#, - )) -} - -#[test] -fn document_import() { - assert_json_snapshot!(find_links( - r#" -%! foo.tex -\import{.}{bar/baz} -| - -%! bar/baz.tex"#, - )) -} diff --git a/support/texlab/tests/lsp/text_document/document_symbol.rs b/support/texlab/tests/lsp/text_document/document_symbol.rs deleted file mode 100644 index 6ac00176b9..0000000000 --- a/support/texlab/tests/lsp/text_document/document_symbol.rs +++ /dev/null @@ -1,441 +0,0 @@ -use insta::assert_json_snapshot; -use lsp_types::{ - notification::DidChangeConfiguration, request::DocumentSymbolRequest, - DidChangeConfigurationParams, DocumentSymbolParams, DocumentSymbolResponse, -}; - -use crate::fixture::TestBed; - -fn find_symbols( - fixture: &str, - capabilities: serde_json::Value, - settings: serde_json::Value, -) -> DocumentSymbolResponse { - let test_bed = TestBed::new(fixture).unwrap(); - - test_bed - .initialize(serde_json::from_value(capabilities).unwrap()) - .unwrap(); - - test_bed - .client() - .send_notification::<DidChangeConfiguration>(DidChangeConfigurationParams { settings }) - .unwrap(); - - let text_document = test_bed.cursor().unwrap().text_document; - - let mut response = test_bed - .client() - .send_request::<DocumentSymbolRequest>(DocumentSymbolParams { - text_document, - work_done_progress_params: Default::default(), - partial_result_params: Default::default(), - }) - .unwrap() - .unwrap_or_else(|| DocumentSymbolResponse::Flat(vec![])); - - if let DocumentSymbolResponse::Flat(symbols) = &mut response { - for symbol in symbols { - symbol.location.uri = test_bed.redact(&symbol.location.uri); - } - } - - response -} - -#[test] -fn enumerate_nested() { - assert_json_snapshot!(find_symbols( - r#" -%! main.tex -\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} -| - -%! main.aux -\relax -\newlabel{it:foo}{{1}{1}} -\newlabel{it:qux}{{2}{1}}"#, - serde_json::json!({ - "textDocument": { - "documentSymbol": { - "hierarchicalDocumentSymbolSupport": true, - }, - }, - }), - serde_json::Value::Null, - )); -} - -#[test] -fn enumerate_flat() { - assert_json_snapshot!(find_symbols( - r#" -%! main.tex -\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} -| - -%! main.aux -\relax -\newlabel{it:foo}{{1}{1}} -\newlabel{it:qux}{{2}{1}}"#, - serde_json::json!({}), - serde_json::Value::Null, - )); -} - -#[test] -fn equation_nested() { - assert_json_snapshot!(find_symbols( - r#" -%! main.tex -\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} -| - -%! main.aux -\relax -\newlabel{eq:foo}{{1}{1}}"#, - serde_json::json!({ - "textDocument": { - "documentSymbol": { - "hierarchicalDocumentSymbolSupport": true, - }, - }, - }), - serde_json::Value::Null, - )); -} - -#[test] -fn equation_flat() { - assert_json_snapshot!(find_symbols( - r#" -%! main.tex -\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} -| - -%! main.aux -\relax -\newlabel{eq:foo}{{1}{1}}"#, - serde_json::json!({}), - serde_json::Value::Null, - )); -} - -#[test] -fn float_nested() { - assert_json_snapshot!(find_symbols( - r#" -%! main.tex -\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} -| - -%! main.aux -\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 }"#, - serde_json::json!({ - "textDocument": { - "documentSymbol": { - "hierarchicalDocumentSymbolSupport": true, - }, - }, - }), - serde_json::Value::Null, - )); -} - -#[test] -fn float_flat() { - assert_json_snapshot!(find_symbols( - r#" -%! main.tex -\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} -| - -%! main.aux -\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 }"#, - serde_json::json!({}), - serde_json::Value::Null, - )); -} - -#[test] -fn section_nested() { - assert_json_snapshot!(find_symbols( - r#" -%! main.tex -\documentclass{article} - -\begin{document} - -\section{Foo} - -\section{Bar}\label{sec:bar} - -\subsection{Baz}\label{sec:baz} - -\end{document} -| - -%! main.aux -\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}}"#, - serde_json::json!({ - "textDocument": { - "documentSymbol": { - "hierarchicalDocumentSymbolSupport": true, - }, - }, - }), - serde_json::Value::Null, - )); -} - -#[test] -fn section_flat() { - assert_json_snapshot!(find_symbols( - r#" -%! main.tex -\documentclass{article} - -\begin{document} - -\section{Foo} - -\section{Bar}\label{sec:bar} - -\subsection{Baz}\label{sec:baz} - -\end{document} -| - -%! main.aux -\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}}"#, - serde_json::json!({}), - serde_json::Value::Null, - )); -} - -#[test] -fn theorem_nested() { - assert_json_snapshot!(find_symbols( - r#" -%! main.tex -\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} -| - -%! main.aux -\relax -\newlabel{thm:foo}{{1}{1}} -\newlabel{thm:bar}{{2}{1}}"#, - serde_json::json!({ - "textDocument": { - "documentSymbol": { - "hierarchicalDocumentSymbolSupport": true, - }, - }, - }), - serde_json::Value::Null, - )); -} - -#[test] -fn theorem_flat() { - assert_json_snapshot!(find_symbols( - r#" -%! main.tex -\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} -| - -%! main.aux -\relax -\newlabel{thm:foo}{{1}{1}} -\newlabel{thm:bar}{{2}{1}}"#, - serde_json::json!({}), - serde_json::Value::Null, - )); -} - -#[test] -fn ignored_patterns() { - assert_json_snapshot!(find_symbols( - r#" -%! main.tex -\documentclass{article} - -\begin{document} - -\begin{equation}\label{eq:foo} - Foo -\end{equation} - -\begin{enumerate} - \item Foo - \item Bar -\end{enumerate} - -\end{document} -|"#, - serde_json::json!({}), - serde_json::json!({ - "symbols": { - "ignoredPatterns": ["Item", "Enumerate"] - } - }), - )); -} diff --git a/support/texlab/tests/lsp/text_document/folding_range.rs b/support/texlab/tests/lsp/text_document/folding_range.rs deleted file mode 100644 index 063ca7533d..0000000000 --- a/support/texlab/tests/lsp/text_document/folding_range.rs +++ /dev/null @@ -1,66 +0,0 @@ -use insta::assert_json_snapshot; -use lsp_types::{ - request::FoldingRangeRequest, ClientCapabilities, FoldingRange, FoldingRangeParams, -}; - -use crate::fixture::TestBed; - -fn find_foldings(fixture: &str) -> Vec<FoldingRange> { - let test_bed = TestBed::new(fixture).unwrap(); - - test_bed.initialize(ClientCapabilities::default()).unwrap(); - - let text_document = test_bed.cursor().unwrap().text_document; - test_bed - .client() - .send_request::<FoldingRangeRequest>(FoldingRangeParams { - text_document, - work_done_progress_params: Default::default(), - partial_result_params: Default::default(), - }) - .unwrap() - .unwrap_or_default() -} - -#[test] -fn latex() { - assert_json_snapshot!(find_foldings( - r#" -%! main.tex -\begin{document} - \section{Foo} - foo - \subsection{Bar} - bar - \section{Baz} - baz - \section{Qux} -\end{document} -|"# - )); -} - -#[test] -fn bibtex() { - assert_json_snapshot!(find_foldings( - r#" -%! main.bib -some junk -here - -@article{foo, - author = {bar}, - title = {baz} -} - -@string{foo = "bar"} - -@comment{foo, - author = {bar}, - title = {baz} -} - -@preamble{"foo"} -|"# - )); -} diff --git a/support/texlab/tests/lsp/text_document/formatting.rs b/support/texlab/tests/lsp/text_document/formatting.rs deleted file mode 100644 index 295022c76a..0000000000 --- a/support/texlab/tests/lsp/text_document/formatting.rs +++ /dev/null @@ -1,134 +0,0 @@ -use insta::assert_snapshot; -use lsp_types::{ - request::Formatting, ClientCapabilities, DocumentFormattingParams, FormattingOptions, -}; -use texlab::util::{line_index::LineIndex, line_index_ext::LineIndexExt}; - -use crate::fixture::TestBed; - -fn format(fixture: &str) -> String { - let test_bed = TestBed::new(fixture).unwrap(); - test_bed.initialize(ClientCapabilities::default()).unwrap(); - - let text_document = test_bed.cursor().unwrap().text_document; - let edits = test_bed - .client() - .send_request::<Formatting>(DocumentFormattingParams { - text_document, - work_done_progress_params: Default::default(), - options: FormattingOptions { - insert_spaces: true, - tab_size: 4, - ..Default::default() - }, - }) - .unwrap() - .unwrap_or_default(); - - let old_text = &test_bed.documents()[0].text; - let line_index = LineIndex::new(old_text); - let mut new_text = String::from(old_text); - for edit in edits.into_iter().rev() { - let range = line_index.offset_lsp_range(edit.range); - new_text.replace_range::<std::ops::Range<usize>>(range.into(), &edit.new_text); - } - - new_text -} - -#[test] -fn bibtex_internal_wrap_long_lines() { - assert_snapshot!(format( - r#" -%! main.bib -@article{foo, bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. -Lorem ipsum dolor sit amet, -consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.},} -|"#, - )); -} - -#[test] -fn bibtex_internal_multiple_entries() { - assert_snapshot!(format( - r#" -%! main.bib -@article{foo, bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, -consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.},} - -@article{foo, bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, -consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.},}" -|"#, - )); -} - -#[test] -fn bibtex_internal_trailing_comma() { - assert_snapshot!(format( - r#" -%! main.bib -@article{foo, bar = baz} -|"#, - )); -} - -#[test] -fn bibtex_internal_insert_braces() { - assert_snapshot!(format( - r#" -%! main.bib -@article{foo, bar = baz, -|"#, - )); -} - -#[test] -fn bibtex_internal_command() { - assert_snapshot!(format( - r#" -%! main.bib -@article{foo, bar = "\baz",} -|"#, - )); -} - -#[test] -fn bibtex_internal_join_strings() { - assert_snapshot!(format( - r#" -%! main.bib -@article{foo, bar = "baz" # "qux"} -|"#, - )); -} - -#[test] -fn bibtex_internal_parens() { - assert_snapshot!(format( - r#" -%! main.bib -@article(foo,) -|"#, - )); -} - -#[test] -fn bibtex_internal_string() { - assert_snapshot!(format( - r#" -%! main.bib -@string{foo="bar"} -|"#, - )); -} - -#[test] -fn bibtex_internal_preamble() { - assert_snapshot!(format( - r#" -%! main.bib -@preamble{ - "foo bar baz" } -|"#, - )); -} diff --git a/support/texlab/tests/lsp/text_document/hover.rs b/support/texlab/tests/lsp/text_document/hover.rs deleted file mode 100644 index 5dafceb781..0000000000 --- a/support/texlab/tests/lsp/text_document/hover.rs +++ /dev/null @@ -1,246 +0,0 @@ -use insta::assert_json_snapshot; -use lsp_types::{request::HoverRequest, ClientCapabilities, HoverContents, HoverParams}; - -use crate::fixture::TestBed; - -fn find_hover(fixture: &str) -> Option<HoverContents> { - let test_bed = TestBed::new(fixture).unwrap(); - - test_bed.initialize(ClientCapabilities::default()).unwrap(); - - let text_document_position_params = test_bed.cursor().unwrap(); - - test_bed - .client() - .send_request::<HoverRequest>(HoverParams { - text_document_position_params, - work_done_progress_params: Default::default(), - }) - .unwrap() - .map(|hover| { - assert_eq!(hover.range, Some(test_bed.locations()[0].range)); - hover.contents - }) -} - -#[test] -fn empty_latex_document() { - assert_eq!( - find_hover( - r#" -%! main.tex - -|"# - ), - None, - ); -} - -#[test] -fn empty_bibtex_document() { - assert_eq!( - find_hover( - r#" -%! main.bib - -|"# - ), - None, - ); -} - -#[test] -fn citation_inside_cite() { - assert_json_snapshot!(find_hover( - r#" -%! main.bib -@article{foo, author = {Foo Bar}, title = {Baz Qux}, year = 1337} - -%! main.tex -\addbibresource{main.bib} -\cite{foo} - | - ^^^"# - )); -} - -#[test] -fn citation_inside_entry() { - assert_json_snapshot!(find_hover( - r#" -%! main.bib -@article{foo, author = {Foo Bar}, title = {Baz Qux}, year = 1337} - | - ^^^ - -%! main.tex -\addbibresource{main.bib} -\cite{foo}"# - )); -} - -#[test] -fn component_known_package() { - assert_json_snapshot!(find_hover( - r#" -%! main.tex -\usepackage{amsmath} - | - ^^^^^^^"# - )); -} - -#[test] -fn component_unknown_class() { - assert_eq!( - find_hover( - r#" -%! main.tex -\documentclass{abcdefghijklmnop} - |"# - ), - None, - ); -} - -#[test] -fn entry_type_known_type() { - assert_json_snapshot!(find_hover( - r#" -%! main.bib -@article{foo,} - | -^^^^^^^^"# - )); -} - -#[test] -fn entry_type_unknown_field() { - assert_eq!( - find_hover( - r#" -%! main.bib -@foo{bar,} - |"# - ), - None, - ); -} - -#[test] -fn entry_type_key() { - assert_eq!( - find_hover( - r#" -%! main.bib -@foo{bar,} - |"# - ), - None, - ); -} - -#[test] -fn field_known() { - assert_json_snapshot!(find_hover( - r#" -%! main.bib -@article{foo, author = bar} - | - ^^^^^^"# - )); -} - -#[test] -fn field_unknown() { - assert_eq!( - find_hover( - r#" -%! main.bib -@article{foo, bar = baz} - |"# - ), - None, - ); -} - -#[test] -fn section() { - assert_json_snapshot!(find_hover( - r#" -%! main.tex -\section{Foo} -\label{sec:foo} - | - ^^^^^^^"#, - )); -} - -#[test] -fn string_inside_reference() { - assert_json_snapshot!(find_hover( - r#" -%! main.bib -@string{foo = "Foo"} -@string{bar = "Bar"} -@article{baz, author = bar} - | - ^^^"# - )); -} - -#[test] -fn string_inside_field() { - assert_eq!( - find_hover( - r#" -%! main.bib -@string{foo = "Foo"} -@string{bar = "Bar"} -@article{baz, author = bar} - |"# - ), - None, - ); -} - -#[test] -fn label_theorem_child_file() { - assert_json_snapshot!(find_hover( - r#" -%! main.tex -\documentclass{article} -\newtheorem{lemma}{Lemma} -\include{child} -\ref{thm:foo} - | - ^^^^^^^ - -%! child.tex -\begin{lemma}\label{thm:foo} - 1 + 1 = 2 -\end{lemma}"# - )); -} - -#[test] -fn label_theorem_child_file_mumber() { - assert_json_snapshot!(find_hover( - r#" -%! main.tex -\documentclass{article} -\newtheorem{lemma}{Lemma} -\include{child} -\ref{thm:foo} - | - ^^^^^^^ - -%! child.tex -\begin{lemma}[Foo]\label{thm:foo} - 1 + 1 = 2 -\end{lemma} - -%! child.aux -\newlabel{thm:foo}{{1}{1}{Foo}{lemma.1}{}}"# - )); -} diff --git a/support/texlab/tests/lsp/text_document/inlay_hint.rs b/support/texlab/tests/lsp/text_document/inlay_hint.rs deleted file mode 100644 index d8ae8e304a..0000000000 --- a/support/texlab/tests/lsp/text_document/inlay_hint.rs +++ /dev/null @@ -1,57 +0,0 @@ -use insta::assert_json_snapshot; -use lsp_types::{ - request::InlayHintRequest, ClientCapabilities, InlayHint, InlayHintParams, Position, Range, -}; - -use crate::fixture::TestBed; - -fn find_hints(fixture: &str) -> Vec<InlayHint> { - let test_bed = TestBed::new(fixture).unwrap(); - test_bed.initialize(ClientCapabilities::default()).unwrap(); - - let cursor = test_bed.cursor().unwrap(); - - test_bed - .client() - .send_request::<InlayHintRequest>(InlayHintParams { - text_document: cursor.text_document, - range: Range::new(Position::new(0, 0), cursor.position), - work_done_progress_params: Default::default(), - }) - .unwrap() - .unwrap_or_default() -} - -#[test] -fn label_definition() { - assert_json_snapshot!(find_hints( - r#" -%! main.tex -\documentclass{article} -\usepackage{caption} -\begin{document} -\section{Foo}\label{sec:foo} -\section{Bar}\label{sec:bar} -\subsection{Baz}\label{sec:baz} -\begin{figure} - Test - \label{fig:qux} - \caption{Qux} -\end{figure} -\end{document} - | - -%! main.aux -\relax -\providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} -\newlabel{fig:qux}{{\caption@xref {fig:qux}{ on input line 15}}{1}} -\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Qux\relax }}{1}{}\protected@file@percent } -\@writefile{toc}{\contentsline {section}{\numberline {1}Foo}{1}{}\protected@file@percent } -\newlabel{sec:foo}{{1}{1}} -\@writefile{toc}{\contentsline {section}{\numberline {2}Bar}{1}{}\protected@file@percent } -\newlabel{sec:bar}{{2}{1}} -\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Baz}{1}{}\protected@file@percent } -\newlabel{sec:baz}{{2.1}{1}} -\gdef \@abspage@last{1}"#, - )); -} diff --git a/support/texlab/tests/lsp/text_document/references.rs b/support/texlab/tests/lsp/text_document/references.rs deleted file mode 100644 index 9933babbd4..0000000000 --- a/support/texlab/tests/lsp/text_document/references.rs +++ /dev/null @@ -1,270 +0,0 @@ -use lsp_types::{ - request::References, ClientCapabilities, Location, ReferenceContext, ReferenceParams, -}; - -use crate::fixture::TestBed; - -fn sort(locations: &mut Vec<Location>) { - locations.sort_by(|a, b| (&a.uri, a.range.start).cmp(&(&b.uri, b.range.start))); -} - -fn check(fixture: &str, context: ReferenceContext) { - let test_bed = TestBed::new(fixture).unwrap(); - - test_bed.initialize(ClientCapabilities::default()).unwrap(); - - let text_document_position = test_bed.cursor().unwrap(); - - let mut expected = test_bed.locations().to_vec(); - - let mut actual = test_bed - .client() - .send_request::<References>(ReferenceParams { - text_document_position, - context, - partial_result_params: Default::default(), - work_done_progress_params: Default::default(), - }) - .unwrap() - .unwrap_or_default(); - - sort(&mut actual); - sort(&mut expected); - assert_eq!(actual, expected); -} - -#[test] -fn entry_definition() { - check( - r#" -%! foo.bib -@article{foo,} - | - -%! bar.tex -\cite{foo} - ^^^ -\addbibresource{foo.bib} -"#, - ReferenceContext { - include_declaration: false, - }, - ) -} - -#[test] -fn entry_definition_include_decl() { - check( - r#" -%! foo.bib -@article{foo,} - | - ^^^ - -%! bar.tex -\cite{foo} - ^^^ -\addbibresource{foo.bib} -"#, - ReferenceContext { - include_declaration: true, - }, - ) -} - -#[test] -fn entry_reference() { - check( - r#" -%! foo.bib -@article{foo,} - -%! bar.tex -\cite{foo} - | - ^^^ -\addbibresource{foo.bib} -"#, - ReferenceContext { - include_declaration: false, - }, - ) -} - -#[test] -fn entry_reference_include_decl() { - check( - r#" -%! foo.bib -@article{foo,} - ^^^ - -%! bar.tex -\cite{foo} - | - ^^^ -\addbibresource{foo.bib} -"#, - ReferenceContext { - include_declaration: true, - }, - ) -} - -#[test] -fn label_definition() { - check( - r#" -%! foo.tex -\label{foo} - | - -%! bar.tex -\ref{foo} - ^^^ -\input{foo.tex} -"#, - ReferenceContext { - include_declaration: false, - }, - ) -} - -#[test] -fn label_definition_include_decl() { - check( - r#" -%! foo.tex -\label{foo} - | - ^^^ - -%! bar.tex -\ref{foo} - ^^^ -\input{foo.tex} -"#, - ReferenceContext { - include_declaration: true, - }, - ) -} - -#[test] -fn label_reference() { - check( - r#" -%! foo.tex -\label{foo} -\input{bar.tex} - -%! bar.tex -\ref{foo} - | - ^^^ - -%! baz.tex -\ref{foo} - ^^^ -\input{bar.tex} -"#, - ReferenceContext { - include_declaration: false, - }, - ) -} - -#[test] -fn label_reference_include_decl() { - check( - r#" -%! foo.tex -\label{foo} - ^^^ -\input{bar.tex} - -%! bar.tex -\ref{foo} - | - ^^^ - -%! baz.tex -\ref{foo} - ^^^ -\input{bar.tex} -"#, - ReferenceContext { - include_declaration: true, - }, - ) -} - -#[test] -fn string_reference() { - check( - r#" -%! main.bib -@string{foo = {Foo}} -@string{bar = {Bar}} -@article{baz, author = foo} - | - ^^^ -"#, - ReferenceContext { - include_declaration: false, - }, - ) -} - -#[test] -fn string_reference_include_decl() { - check( - r#" -%! main.bib -@string{foo = {Foo}} - ^^^ -@string{bar = {Bar}} -@article{baz, author = foo} - | - ^^^ -"#, - ReferenceContext { - include_declaration: true, - }, - ) -} - -#[test] -fn string_definition() { - check( - r#" -%! main.bib -@string{foo = {Foo}} - | -@string{bar = {Bar}} -@article{baz, author = foo} - ^^^ -"#, - ReferenceContext { - include_declaration: false, - }, - ) -} - -#[test] -fn string_definition_include_decl() { - check( - r#" -%! main.bib -@string{foo = {Foo}} - | - ^^^ -@string{bar = {Bar}} -@article{baz, author = foo} - ^^^ -"#, - ReferenceContext { - include_declaration: true, - }, - ) -} diff --git a/support/texlab/tests/lsp/text_document/rename.rs b/support/texlab/tests/lsp/text_document/rename.rs deleted file mode 100644 index 183443809a..0000000000 --- a/support/texlab/tests/lsp/text_document/rename.rs +++ /dev/null @@ -1,106 +0,0 @@ -use std::collections::HashMap; - -use lsp_types::{request::Rename, ClientCapabilities, RenameParams, TextEdit, Url, WorkspaceEdit}; - -use crate::fixture::TestBed; - -fn check(fixture: &str, new_name: &str) { - let test_bed = TestBed::new(fixture).unwrap(); - - test_bed.initialize(ClientCapabilities::default()).unwrap(); - - let mut expected_changes: HashMap<Url, Vec<TextEdit>> = HashMap::new(); - for location in test_bed.locations() { - expected_changes - .entry(location.uri.clone()) - .or_default() - .push(TextEdit::new(location.range, new_name.to_string())); - } - - let text_document_position = test_bed.cursor().unwrap(); - let actual_edit = test_bed - .client() - .send_request::<Rename>(RenameParams { - text_document_position, - new_name: new_name.to_string(), - work_done_progress_params: Default::default(), - }) - .unwrap() - .unwrap_or_default(); - - assert_eq!(actual_edit, WorkspaceEdit::new(expected_changes)); -} - -#[test] -fn command() { - check( - r#" -%! foo.tex -\baz - | - ^^^ -\include{bar.tex} - -%! bar.tex -\baz - ^^^ -"#, - "qux", - ) -} - -#[test] -fn entry() { - check( - r#" -%! main.bib -@article{foo, bar = baz} - | - ^^^ - -%! main.tex -\addbibresource{main.bib} -\cite{foo} - ^^^ -"#, - "qux", - ) -} - -#[test] -fn citation() { - check( - r#" -%! main.bib -@article{foo, bar = baz} - ^^^ - -%! main.tex -\addbibresource{main.bib} -\cite{foo} - | - ^^^ -"#, - "qux", - ) -} - -#[test] -fn label() { - check( - r#" -%! foo.tex -\label{foo}\include{bar} - | - ^^^ - -%! bar.tex -\ref{foo} - ^^^ - -%! baz.tex -\ref{foo} -"#, - "bar", - ) -} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__acronym_package_ref.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__acronym_package_ref.snap deleted file mode 100644 index 19c84e95fc..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__acronym_package_ref.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\acrodef{fpsLabel}[FPS]{Frames per Second}\n\\ac{f\n |\n ^\"#)" ---- -[ - { - "label": "fpsLabel", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__acronym_ref_empty.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__acronym_ref_empty.snap deleted file mode 100644 index 23e5b695ef..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__acronym_ref_empty.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second}\n\\acrshort{}\n |\"#)" ---- -[ - { - "label": "fpsLabel", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__acronym_ref_open_brace.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__acronym_ref_open_brace.snap deleted file mode 100644 index 25171b679c..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__acronym_ref_open_brace.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second}\n\\acrshort{f\n |\n ^\"#)" ---- -[ - { - "label": "fpsLabel", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__acronym_ref_simple.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__acronym_ref_simple.snap deleted file mode 100644 index 1d3f3329c1..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__acronym_ref_simple.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second}\n\\acrshort{f}\n |\n ^\"#)" ---- -[ - { - "label": "fpsLabel", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__argument_empty.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__argument_empty.snap deleted file mode 100644 index ecc48b5a7f..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__argument_empty.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\usepackage{amsfonts}\n\\mathbb{}\n |\"#)" ---- -[ - { - "label": "A", - "preselect": false - }, - { - "label": "B", - "preselect": false - }, - { - "label": "C", - "preselect": false - }, - { - "label": "D", - "preselect": false - }, - { - "label": "E", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__argument_open_brace.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__argument_open_brace.snap deleted file mode 100644 index 530527a384..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__argument_open_brace.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\usepackage{amsfonts}\n\\mathbb{\n |\nTest\"#)" ---- -[ - { - "label": "A", - "preselect": false - }, - { - "label": "B", - "preselect": false - }, - { - "label": "C", - "preselect": false - }, - { - "label": "D", - "preselect": false - }, - { - "label": "E", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__argument_word.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__argument_word.snap deleted file mode 100644 index c98249c781..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__argument_word.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\usepackage{amsfonts}\n\\mathbb{A}\n |\n ^\"#)" ---- -[ - { - "label": "A", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__begin_environment_without_snippet_support.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__begin_environment_without_snippet_support.snap deleted file mode 100644 index bb9e30ae55..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__begin_environment_without_snippet_support.snap +++ /dev/null @@ -1,31 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\beg\n |\n ^^^\"#)" ---- -[ - { - "label": "AtBeginDocument", - "detail": "built-in", - "preselect": false - }, - { - "label": "AtBeginDvi", - "detail": "built-in", - "preselect": false - }, - { - "label": "begin", - "detail": "built-in", - "preselect": false - }, - { - "label": "begingroup", - "detail": "built-in", - "preselect": false - }, - { - "label": "bigwedge", - "detail": "⋀, built-in", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__citation.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__citation.snap deleted file mode 100644 index b8755fdef0..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__citation.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\documentclass{article}\n\\bibliography{main}\n\\begin{document}\n\\cite{\n |\n\\end{document}\n\n%! main.bib\n@article{foo:2019,\n author = {Foo Bar},\n title = {Baz Qux},\n year = {2019},\n}\n\n@article{bar:2005,}\"#)" ---- -[ - { - "label": "bar:2005", - "preselect": false, - "filterText": "bar:2005 @article bar:2005" - }, - { - "label": "foo:2019", - "preselect": false, - "filterText": "foo:2019 @article foo:2019 author Foo Bar title Baz Qux year 2019" - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__citation_acronym.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__citation_acronym.snap deleted file mode 100644 index 36478c45c8..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__citation_acronym.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\addbibresource{main.bib}\n\\DeclareAcronym{foo}{cite={}}\n |\n\n%! main.bib\n@article{foo,}\"#)" ---- -[ - { - "label": "foo", - "preselect": false, - "filterText": "foo @article foo" - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__citation_open_brace.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__citation_open_brace.snap deleted file mode 100644 index 41a1d9ced3..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__citation_open_brace.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\addbibresource{main.bib}\n\\cite{\n |\n\n%! main.bib\n@article{foo,}\"#)" ---- -[ - { - "label": "foo", - "preselect": false, - "filterText": "foo @article foo" - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__citation_open_brace_multiple.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__citation_open_brace_multiple.snap deleted file mode 100644 index 8ef509b463..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__citation_open_brace_multiple.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\addbibresource{main.bib}\n\\cite{foo,a\n |\n ^\n\n%! main.bib\n@article{foo,}\"#)" ---- -[ - { - "label": "foo", - "preselect": false, - "filterText": "foo @article foo" - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_model_definition_open_brace.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_model_definition_open_brace.snap deleted file mode 100644 index 421335a4a5..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_model_definition_open_brace.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\definecolor{foo}{\n |\"#)" ---- -[ - { - "label": "HTML", - "preselect": false - }, - { - "label": "RGB", - "preselect": false - }, - { - "label": "cmyk", - "preselect": false - }, - { - "label": "gray", - "preselect": false - }, - { - "label": "rgb", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_model_definition_set_open_brace.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_model_definition_set_open_brace.snap deleted file mode 100644 index 5d7338e48e..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_model_definition_set_open_brace.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\definecolorset{\n |\"#)" ---- -[ - { - "label": "HTML", - "preselect": false - }, - { - "label": "RGB", - "preselect": false - }, - { - "label": "cmyk", - "preselect": false - }, - { - "label": "gray", - "preselect": false - }, - { - "label": "rgb", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_model_definition_set_simple.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_model_definition_set_simple.snap deleted file mode 100644 index 811b47c9ee..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_model_definition_set_simple.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\definecolorset{}\n |\"#)" ---- -[ - { - "label": "HTML", - "preselect": false - }, - { - "label": "RGB", - "preselect": false - }, - { - "label": "cmyk", - "preselect": false - }, - { - "label": "gray", - "preselect": false - }, - { - "label": "rgb", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_model_definition_simple.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_model_definition_simple.snap deleted file mode 100644 index dbb34f08d9..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_model_definition_simple.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\definecolor{foo}{}\n |\"#)" ---- -[ - { - "label": "HTML", - "preselect": false - }, - { - "label": "RGB", - "preselect": false - }, - { - "label": "cmyk", - "preselect": false - }, - { - "label": "gray", - "preselect": false - }, - { - "label": "rgb", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_open_brace.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_open_brace.snap deleted file mode 100644 index e30fc4c1b0..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_open_brace.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\color{\n |\"#)" ---- -[ - { - "label": "Apricot", - "preselect": false - }, - { - "label": "Aquamarine", - "preselect": false - }, - { - "label": "Bittersweet", - "preselect": false - }, - { - "label": "Black", - "preselect": false - }, - { - "label": "Blue", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_simple.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_simple.snap deleted file mode 100644 index 5aab0d8e3b..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_simple.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\color{}\n |\"#)" ---- -[ - { - "label": "Apricot", - "preselect": false - }, - { - "label": "Aquamarine", - "preselect": false - }, - { - "label": "Bittersweet", - "preselect": false - }, - { - "label": "Black", - "preselect": false - }, - { - "label": "Blue", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_word.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_word.snap deleted file mode 100644 index fe803dc6cc..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__color_word.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\color{re}\n |\n ^^\"#)" ---- -[ - { - "label": "BrickRed", - "preselect": false - }, - { - "label": "Red", - "preselect": false - }, - { - "label": "RedOrange", - "preselect": false - }, - { - "label": "RedViolet", - "preselect": false - }, - { - "label": "red", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_command_bibtex.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_command_bibtex.snap deleted file mode 100644 index 616fb22a6b..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_command_bibtex.snap +++ /dev/null @@ -1,31 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.bib\n@article{b,\n c = {\\LaT }\n |\n ^^^\n}\"#)" ---- -[ - { - "label": "LaTeX", - "detail": "built-in", - "preselect": false - }, - { - "label": "LaTeXe", - "detail": "built-in", - "preselect": false - }, - { - "label": "LastDeclaredEncoding", - "detail": "built-in", - "preselect": false - }, - { - "label": "last", - "detail": "built-in", - "preselect": false - }, - { - "label": "latexreleaseversion", - "detail": "built-in", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_command_simple.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_command_simple.snap deleted file mode 100644 index 0e40056a6e..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_command_simple.snap +++ /dev/null @@ -1,31 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\\n |\"#)" ---- -[ - { - "label": "!", - "detail": "built-in", - "preselect": false - }, - { - "label": "\"", - "detail": "built-in", - "preselect": false - }, - { - "label": "#", - "detail": "built-in", - "preselect": false - }, - { - "label": "$", - "detail": "$, built-in", - "preselect": false - }, - { - "label": "%", - "detail": "built-in", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_command_simple_package.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_command_simple_package.snap deleted file mode 100644 index 360229fa7a..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_command_simple_package.snap +++ /dev/null @@ -1,31 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\usepackage{lipsum}\n\\lips\n |\n ^^^^\"#)" ---- -[ - { - "label": "LipsumPar", - "detail": "lipsum.sty", - "preselect": false - }, - { - "label": "LipsumProtect", - "detail": "lipsum.sty", - "preselect": false - }, - { - "label": "LipsumRestoreAll", - "detail": "lipsum.sty", - "preselect": false - }, - { - "label": "lipsum", - "detail": "lipsum.sty", - "preselect": false - }, - { - "label": "lipsumexp", - "detail": "lipsum.sty", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_environment_class.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_environment_class.snap deleted file mode 100644 index a2e5e17ac4..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_environment_class.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\documentclass{article}\n\\begin{thein}\n |\n ^^^^^\"#)" ---- -[ - { - "label": "theindex", - "detail": "article.cls", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_environment_command_definition.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_environment_command_definition.snap deleted file mode 100644 index 28d9c6e82c..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_environment_command_definition.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\newcommand{\\foo}{\\begin{doc}\n |\n ^^^\"#)" ---- -[ - { - "label": "document", - "detail": "built-in", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_environment_simple.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_environment_simple.snap deleted file mode 100644 index f892dba5a7..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_environment_simple.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\begin{doc\n |\n ^^^\"#)" ---- -[ - { - "label": "document", - "detail": "built-in", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_environment_simple_end.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_environment_simple_end.snap deleted file mode 100644 index 95a2e1db04..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__component_environment_simple_end.snap +++ /dev/null @@ -1,31 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\begin{document}\n\\end{\n |\"#)" ---- -[ - { - "label": "abstract", - "detail": "built-in", - "preselect": false - }, - { - "label": "array", - "detail": "built-in", - "preselect": false - }, - { - "label": "center", - "detail": "built-in", - "preselect": false - }, - { - "label": "csname", - "detail": "built-in", - "preselect": false - }, - { - "label": "document", - "detail": "built-in", - "preselect": true - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_after_preamble.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_after_preamble.snap deleted file mode 100644 index 0fd8b00254..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_after_preamble.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.bib\n@preamble{\n |\n ^^^^^^^^\"#)" ---- -[ - { - "label": "preamble", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_after_string.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_after_string.snap deleted file mode 100644 index 6844fc1862..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_after_string.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.bib\n@string{\n |\n ^^^^^^\"#)" ---- -[ - { - "label": "string", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_at_empty.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_at_empty.snap deleted file mode 100644 index e74f5fed37..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_at_empty.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.bib\n@\n |\"#)" ---- -[ - { - "label": "article", - "preselect": false - }, - { - "label": "artwork", - "preselect": false - }, - { - "label": "audio", - "preselect": false - }, - { - "label": "bibnote", - "preselect": false - }, - { - "label": "book", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_before_article.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_before_article.snap deleted file mode 100644 index f9defdee01..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_before_article.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.bib\n@article\n |\n ^^^^^^^\"#)" ---- -[ - { - "label": "article", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_before_preamble.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_before_preamble.snap deleted file mode 100644 index aad03a392b..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_before_preamble.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.bib\n@preamble\n |\n ^^^^^^^^\"#)" ---- -[ - { - "label": "preamble", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_before_string.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_before_string.snap deleted file mode 100644 index e30c60a45c..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_before_string.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.bib\n@string\n |\n ^^^^^^\"#)" ---- -[ - { - "label": "string", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_complete_entry.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_complete_entry.snap deleted file mode 100644 index 2724026a26..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__entry_type_complete_entry.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.bib\n@article{foo, author = {foo}}\n |\n ^^^^^^^\"#)" ---- -[ - { - "label": "article", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__field_empty_entry_closed.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__field_empty_entry_closed.snap deleted file mode 100644 index a5a1d7838e..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__field_empty_entry_closed.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.bib\n@article{foo,}\n |\"#)" ---- -[ - { - "label": "abstract", - "preselect": false - }, - { - "label": "addendum", - "preselect": false - }, - { - "label": "address", - "preselect": false - }, - { - "label": "afterword", - "preselect": false - }, - { - "label": "annotation", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__field_empty_entry_open.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__field_empty_entry_open.snap deleted file mode 100644 index 693d4ed141..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__field_empty_entry_open.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.bib\n@article{foo,\n |\"#)" ---- -[ - { - "label": "abstract", - "preselect": false - }, - { - "label": "addendum", - "preselect": false - }, - { - "label": "address", - "preselect": false - }, - { - "label": "afterword", - "preselect": false - }, - { - "label": "annotation", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__field_entry_field_name.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__field_entry_field_name.snap deleted file mode 100644 index cb0d41ed5d..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__field_entry_field_name.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.bib\n@article{foo, a\n |\n ^\"#)" ---- -[ - { - "label": "abstract", - "preselect": false - }, - { - "label": "addendum", - "preselect": false - }, - { - "label": "address", - "preselect": false - }, - { - "label": "afterword", - "preselect": false - }, - { - "label": "annotation", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__field_entry_two_fields_name_closed.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__field_entry_two_fields_name_closed.snap deleted file mode 100644 index 66dbf62785..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__field_entry_two_fields_name_closed.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.bib\n@article{foo, author = bar, edit}\n |\n ^^^^\"#)" ---- -[ - { - "label": "edition", - "preselect": false - }, - { - "label": "editor", - "preselect": false - }, - { - "label": "editora", - "preselect": false - }, - { - "label": "editoratype", - "preselect": false - }, - { - "label": "editorb", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__field_entry_two_fields_name_open.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__field_entry_two_fields_name_open.snap deleted file mode 100644 index 221f78f335..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__field_entry_two_fields_name_open.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.bib\n@article{foo, author = bar, edit\n |\n ^^^^\"#)" ---- -[ - { - "label": "edition", - "preselect": false - }, - { - "label": "editor", - "preselect": false - }, - { - "label": "editora", - "preselect": false - }, - { - "label": "editoratype", - "preselect": false - }, - { - "label": "editorb", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__glossary_ref_open_brace.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__glossary_ref_open_brace.snap deleted file mode 100644 index 1be95d5d99..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__glossary_ref_open_brace.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second}\n\\gls{f\n |\n ^\"#)" ---- -[ - { - "label": "fpsLabel", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__glossary_ref_simple.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__glossary_ref_simple.snap deleted file mode 100644 index 81e9299d69..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__glossary_ref_simple.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second}\n\\gls{f}\n |\n ^\"#)" ---- -[ - { - "label": "fpsLabel", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__import_class_closed_brace.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__import_class_closed_brace.snap deleted file mode 100644 index 9ed7978612..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__import_class_closed_brace.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\documentclass{art}\n |\n ^^^\"#)" ---- -[ - { - "label": "article", - "preselect": false - }, - { - "label": "articleingud", - "preselect": false - }, - { - "label": "articoletteracdp", - "preselect": false - }, - { - "label": "artikel1", - "preselect": false - }, - { - "label": "artikel2", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__import_class_open_brace.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__import_class_open_brace.snap deleted file mode 100644 index b650b621c6..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__import_class_open_brace.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\documentclass{art \\foo\n |\n ^^^\"#)" ---- -[ - { - "label": "article", - "preselect": false - }, - { - "label": "articleingud", - "preselect": false - }, - { - "label": "articoletteracdp", - "preselect": false - }, - { - "label": "artikel1", - "preselect": false - }, - { - "label": "artikel2", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__import_package_closed_brace.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__import_package_closed_brace.snap deleted file mode 100644 index f8cad5526c..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__import_package_closed_brace.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\usepackage{lips}\n |\n ^^^^\"#)" ---- -[ - { - "label": "lips", - "preselect": false - }, - { - "label": "lipsum", - "preselect": false - }, - { - "label": "lisp-simple-alloc", - "preselect": false - }, - { - "label": "lisp-string", - "preselect": false - }, - { - "label": "lwarp-lips", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__import_package_open_brace.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__import_package_open_brace.snap deleted file mode 100644 index d234241e24..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__import_package_open_brace.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\usepackage{lips\n |\n ^^^^\"#)" ---- -[ - { - "label": "lips", - "preselect": false - }, - { - "label": "lipsum", - "preselect": false - }, - { - "label": "lisp-simple-alloc", - "preselect": false - }, - { - "label": "lisp-string", - "preselect": false - }, - { - "label": "lwarp-lips", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__issue_857_1.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__issue_857_1.snap deleted file mode 100644 index 2b8f89b48d..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__issue_857_1.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! bug.tex\n\\documentclass{article}\n\\newcommand{\\ö}{foo}\n\\newcommand{\\öö}{bar}\n\\newcommand{\\ööabc}{baz}\n\\begin{document}\n\\ö\n |\n ^\n\\end{document}\n\"#)" ---- -[ - { - "label": "ö", - "detail": "user-defined", - "preselect": false - }, - { - "label": "öö", - "detail": "user-defined", - "preselect": false - }, - { - "label": "ööabc", - "detail": "user-defined", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__issue_864.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__issue_864.snap deleted file mode 100644 index 11adde5924..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__issue_864.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! bug.tex\n\\documentclass{article}\n\\def\\あいうえお{}\n\\begin{document}\n\\あ\n |\n ^\n\\end{document}\"#)" ---- -[ - { - "label": "あいうえお", - "detail": "user-defined", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__label.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__label.snap deleted file mode 100644 index a186c56920..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__label.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! foo.tex\n\\documentclass{article}\n\n\\usepackage{amsmath}\n\\usepackage{caption}\n\\usepackage{amsthm}\n\\newtheorem{lemma}{Lemma}\n\n\\begin{document}\n\n\\section{Foo}%\n\\label{sec:foo}\n\n\\begin{equation}%\n\\label{eq:foo}\n 1 + 1 = 2\n\\end{equation}\n\n\\begin{equation}%\n\\label{eq:bar}\n 1 + 1 = 2\n\\end{equation}\n\n\\begin{figure}%\n\\LaTeX{}\n\\caption{Baz}%\n\\label{fig:baz}\n\\end{figure}\n\n\\begin{lemma}%\n\\label{thm:foo}\n 1 + 1 = 2\n\\end{lemma}\n\n\\include{bar}\n\n\\end{document}\n\n%! bar.tex\n\\section{Bar}%\n\\label{sec:bar}\n\nLorem ipsum dolor sit amet.\n\\ref{}\n |\n\n%! foo.aux\n\\relax\n\\@writefile{lof}{\\contentsline {figure}{\\numberline {1}{\\ignorespaces Baz\\relax }}{1}\\protected@file@percent }\n\\providecommand*\\caption@xref[2]{\\@setref\\relax\\@undefined{#1}}\n\\newlabel{fig:baz}{{1}{1}}\n\\@writefile{toc}{\\contentsline {section}{\\numberline {1}Foo}{1}\\protected@file@percent }\n\\newlabel{sec:foo}{{1}{1}}\n\\newlabel{eq:foo}{{1}{1}}\n\\newlabel{eq:bar}{{2}{1}}\n\\newlabel{thm:foo}{{1}{1}}\n\\@input{bar.aux}\"#)" ---- -[ - { - "label": "eq:bar", - "detail": "Equation (2)", - "preselect": false, - "filterText": "eq:bar Equation (2)" - }, - { - "label": "eq:foo", - "detail": "Equation (1)", - "preselect": false, - "filterText": "eq:foo Equation (1)" - }, - { - "label": "fig:baz", - "detail": "Figure 1", - "preselect": false, - "filterText": "fig:baz Figure 1: Baz" - }, - { - "label": "sec:bar", - "detail": "Section (Bar)", - "preselect": false, - "filterText": "sec:bar Section (Bar)" - }, - { - "label": "sec:foo", - "detail": "Section 1 (Foo)", - "preselect": false, - "filterText": "sec:foo Section 1 (Foo)" - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__project_resolution_import.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__project_resolution_import.snap deleted file mode 100644 index 351dc96deb..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__project_resolution_import.snap +++ /dev/null @@ -1,31 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\documentclass{article}\n\\import{sub}{sub/sub.tex}\n\\lipsu\n |\n ^^^^^\n\n%! sub/sub.tex\n\\input{child.tex}\n\n%! sub/child.tex\n\\usepackage{lipsum}\"#)" ---- -[ - { - "label": "LipsumPar", - "detail": "lipsum.sty", - "preselect": false - }, - { - "label": "LipsumProtect", - "detail": "lipsum.sty", - "preselect": false - }, - { - "label": "LipsumRestoreAll", - "detail": "lipsum.sty", - "preselect": false - }, - { - "label": "lipsum", - "detail": "lipsum.sty", - "preselect": false - }, - { - "label": "lipsumexp", - "detail": "lipsum.sty", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__project_resolution_texlabroot.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__project_resolution_texlabroot.snap deleted file mode 100644 index 8ddefbc6ad..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__project_resolution_texlabroot.snap +++ /dev/null @@ -1,31 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! src/main.tex\n\\documentclass{article}\n\\include{src/foo}\n\\lipsu\n |\n ^^^^^\n\n%! src/foo.tex\n\\include{src/bar}\n\n%! src/bar.tex\n\\usepackage{lipsum}\n\n%! .texlabroot\"#)" ---- -[ - { - "label": "LipsumPar", - "detail": "lipsum.sty", - "preselect": false - }, - { - "label": "LipsumProtect", - "detail": "lipsum.sty", - "preselect": false - }, - { - "label": "LipsumRestoreAll", - "detail": "lipsum.sty", - "preselect": false - }, - { - "label": "lipsum", - "detail": "lipsum.sty", - "preselect": false - }, - { - "label": "lipsumexp", - "detail": "lipsum.sty", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__theorem_begin.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__theorem_begin.snap deleted file mode 100644 index f60725667f..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__theorem_begin.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\newtheorem{lemma}{Lemma}\n\\begin{lem\n |\n ^^^\"#)" ---- -[ - { - "label": "lemma", - "detail": "user-defined", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__theorem_end.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__theorem_end.snap deleted file mode 100644 index 0ec951db1d..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__theorem_end.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\newtheorem{lemma}{Lemma}\n\\begin{}\n\\end{lem\n |\n ^^^\"#)" ---- -[ - { - "label": "lemma", - "detail": "user-defined", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__tikz_library_closed_brace.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__tikz_library_closed_brace.snap deleted file mode 100644 index e727fbbc1d..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__tikz_library_closed_brace.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\usepgflibrary{}\n |\"#)" ---- -[ - { - "label": "arrows", - "preselect": false - }, - { - "label": "arrows.meta", - "preselect": false - }, - { - "label": "arrows.spaced", - "preselect": false - }, - { - "label": "curvilinear", - "preselect": false - }, - { - "label": "datavisualization.barcharts", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__tikz_library_open_brace.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__tikz_library_open_brace.snap deleted file mode 100644 index 668b445c91..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__tikz_library_open_brace.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\usepgflibrary{\n |\"#)" ---- -[ - { - "label": "arrows", - "preselect": false - }, - { - "label": "arrows.meta", - "preselect": false - }, - { - "label": "arrows.spaced", - "preselect": false - }, - { - "label": "curvilinear", - "preselect": false - }, - { - "label": "datavisualization.barcharts", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__user_command.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__user_command.snap deleted file mode 100644 index 83e2e701ea..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__user_command.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\foobar\n\\fooba\n |\n ^^^^^\n\\begin{foo}\n\\end{foo}\n\\begin{fo}\"#)" ---- -[ - { - "label": "foobar", - "detail": "user-defined", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__user_environment.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__user_environment.snap deleted file mode 100644 index c46a9beb26..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__completion__user_environment.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: tests/lsp/text_document/completion.rs -expression: "complete(r#\"\n%! main.tex\n\\foobar\n\\fooba\n\\begin{foo}\n\\end{foo}\n\\begin{fo}\n |\n ^^\"#)" ---- -[ - { - "label": "filecontents", - "detail": "built-in", - "preselect": false - }, - { - "label": "foo", - "detail": "user-defined", - "preselect": false - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_link__document_import.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_link__document_import.snap deleted file mode 100644 index b27d0f7a32..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_link__document_import.snap +++ /dev/null @@ -1,19 +0,0 @@ ---- -source: tests/lsp/text_document/document_link.rs -expression: "find_links(r#\"\n%! foo.tex\n\\import{.}{bar/baz}\n|\n\n%! bar/baz.tex\"#)" ---- -[ - { - "range": { - "start": { - "line": 0, - "character": 11 - }, - "end": { - "line": 0, - "character": 18 - } - }, - "target": "file:///bar/baz.tex" - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_link__document_include.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_link__document_include.snap deleted file mode 100644 index fd88cb4a8c..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_link__document_include.snap +++ /dev/null @@ -1,19 +0,0 @@ ---- -source: tests/lsp/text_document/document_link.rs -expression: "find_links(r#\"\n%! foo.tex\n\\input{bar.tex}\n|\n\n%! bar.tex\"#)" ---- -[ - { - "range": { - "start": { - "line": 0, - "character": 7 - }, - "end": { - "line": 0, - "character": 14 - } - }, - "target": "file:///bar.tex" - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__enumerate_flat.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__enumerate_flat.snap deleted file mode 100644 index cd18c3f06e..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__enumerate_flat.snap +++ /dev/null @@ -1,96 +0,0 @@ ---- -source: tests/lsp/text_document/document_symbol.rs -expression: "find_symbols(r#\"\n%! main.tex\n\\documentclass{article}\n\n\\begin{document}\n\n\\begin{enumerate}\n \\item\\label{it:foo} Foo\n \\item\\label{it:bar} Bar\n \\item[Baz] Baz\n \\item[Qux]\\label{it:qux} Qux\n\\end{enumerate}\n\n\\end{document}\n|\n\n%! main.aux\n\\relax\n\\newlabel{it:foo}{{1}{1}}\n\\newlabel{it:qux}{{2}{1}}\"#,\n serde_json::json!({}), serde_json::Value::Null)" ---- -[ - { - "name": "Enumerate", - "kind": 10, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 4, - "character": 0 - }, - "end": { - "line": 9, - "character": 15 - } - } - } - }, - { - "name": "1", - "kind": 22, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 5, - "character": 4 - }, - "end": { - "line": 5, - "character": 27 - } - } - } - }, - { - "name": "Item", - "kind": 22, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 6, - "character": 4 - }, - "end": { - "line": 6, - "character": 27 - } - } - } - }, - { - "name": "Baz", - "kind": 22, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 7, - "character": 4 - }, - "end": { - "line": 7, - "character": 18 - } - } - } - }, - { - "name": "2", - "kind": 22, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 8, - "character": 4 - }, - "end": { - "line": 8, - "character": 32 - } - } - } - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__enumerate_nested.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__enumerate_nested.snap deleted file mode 100644 index 8f777b6d8f..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__enumerate_nested.snap +++ /dev/null @@ -1,140 +0,0 @@ ---- -source: tests/lsp/text_document/document_symbol.rs -expression: "find_symbols(r#\"\n%! main.tex\n\\documentclass{article}\n\n\\begin{document}\n\n\\begin{enumerate}\n \\item\\label{it:foo} Foo\n \\item\\label{it:bar} Bar\n \\item[Baz] Baz\n \\item[Qux]\\label{it:qux} Qux\n\\end{enumerate}\n\n\\end{document}\n|\n\n%! main.aux\n\\relax\n\\newlabel{it:foo}{{1}{1}}\n\\newlabel{it:qux}{{2}{1}}\"#,\n serde_json::json!({\n \"textDocument\" :\n {\n \"documentSymbol\" :\n { \"hierarchicalDocumentSymbolSupport\" : true, },\n },\n }), serde_json::Value::Null)" ---- -[ - { - "name": "Enumerate", - "kind": 10, - "deprecated": false, - "range": { - "start": { - "line": 4, - "character": 0 - }, - "end": { - "line": 9, - "character": 15 - } - }, - "selectionRange": { - "start": { - "line": 4, - "character": 0 - }, - "end": { - "line": 9, - "character": 15 - } - }, - "children": [ - { - "name": "1", - "detail": "it:foo", - "kind": 22, - "deprecated": false, - "range": { - "start": { - "line": 5, - "character": 4 - }, - "end": { - "line": 5, - "character": 27 - } - }, - "selectionRange": { - "start": { - "line": 5, - "character": 9 - }, - "end": { - "line": 5, - "character": 23 - } - }, - "children": [] - }, - { - "name": "Item", - "detail": "it:bar", - "kind": 22, - "deprecated": false, - "range": { - "start": { - "line": 6, - "character": 4 - }, - "end": { - "line": 6, - "character": 27 - } - }, - "selectionRange": { - "start": { - "line": 6, - "character": 9 - }, - "end": { - "line": 6, - "character": 23 - } - }, - "children": [] - }, - { - "name": "Baz", - "kind": 22, - "deprecated": false, - "range": { - "start": { - "line": 7, - "character": 4 - }, - "end": { - "line": 7, - "character": 18 - } - }, - "selectionRange": { - "start": { - "line": 7, - "character": 4 - }, - "end": { - "line": 7, - "character": 18 - } - }, - "children": [] - }, - { - "name": "2", - "detail": "it:qux", - "kind": 22, - "deprecated": false, - "range": { - "start": { - "line": 8, - "character": 4 - }, - "end": { - "line": 8, - "character": 32 - } - }, - "selectionRange": { - "start": { - "line": 8, - "character": 14 - }, - "end": { - "line": 8, - "character": 28 - } - }, - "children": [] - } - ] - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__equation_flat.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__equation_flat.snap deleted file mode 100644 index d37fe4cbbf..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__equation_flat.snap +++ /dev/null @@ -1,60 +0,0 @@ ---- -source: tests/lsp/text_document/document_symbol.rs -expression: "find_symbols(r#\"\n%! main.tex\n\\documentclass{article}\n\n\\begin{document}\n\n\\begin{equation}\\label{eq:foo}\n Foo\n\\end{equation}\n\n\\begin{equation}\\label{eq:bar}\n Bar\n\\end{equation}\n\n\\begin{equation}\n Baz\n\\end{equation}\n\n\\end{document}\n|\n\n%! main.aux\n\\relax\n\\newlabel{eq:foo}{{1}{1}}\"#,\n serde_json::json!({}), serde_json::Value::Null)" ---- -[ - { - "name": "Equation (1)", - "kind": 14, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 4, - "character": 0 - }, - "end": { - "line": 6, - "character": 14 - } - } - } - }, - { - "name": "Equation", - "kind": 14, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 8, - "character": 0 - }, - "end": { - "line": 10, - "character": 14 - } - } - } - }, - { - "name": "Equation", - "kind": 14, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 12, - "character": 0 - }, - "end": { - "line": 14, - "character": 14 - } - } - } - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__equation_nested.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__equation_nested.snap deleted file mode 100644 index 5965400814..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__equation_nested.snap +++ /dev/null @@ -1,86 +0,0 @@ ---- -source: tests/lsp/text_document/document_symbol.rs -expression: "find_symbols(r#\"\n%! main.tex\n\\documentclass{article}\n\n\\begin{document}\n\n\\begin{equation}\\label{eq:foo}\n Foo\n\\end{equation}\n\n\\begin{equation}\\label{eq:bar}\n Bar\n\\end{equation}\n\n\\begin{equation}\n Baz\n\\end{equation}\n\n\\end{document}\n|\n\n%! main.aux\n\\relax\n\\newlabel{eq:foo}{{1}{1}}\"#,\n serde_json::json!({\n \"textDocument\" :\n {\n \"documentSymbol\" :\n { \"hierarchicalDocumentSymbolSupport\" : true, },\n },\n }), serde_json::Value::Null)" ---- -[ - { - "name": "Equation (1)", - "detail": "eq:foo", - "kind": 14, - "deprecated": false, - "range": { - "start": { - "line": 4, - "character": 0 - }, - "end": { - "line": 6, - "character": 14 - } - }, - "selectionRange": { - "start": { - "line": 4, - "character": 16 - }, - "end": { - "line": 4, - "character": 30 - } - }, - "children": [] - }, - { - "name": "Equation", - "detail": "eq:bar", - "kind": 14, - "deprecated": false, - "range": { - "start": { - "line": 8, - "character": 0 - }, - "end": { - "line": 10, - "character": 14 - } - }, - "selectionRange": { - "start": { - "line": 8, - "character": 16 - }, - "end": { - "line": 8, - "character": 30 - } - }, - "children": [] - }, - { - "name": "Equation", - "kind": 14, - "deprecated": false, - "range": { - "start": { - "line": 12, - "character": 0 - }, - "end": { - "line": 14, - "character": 14 - } - }, - "selectionRange": { - "start": { - "line": 12, - "character": 0 - }, - "end": { - "line": 14, - "character": 14 - } - }, - "children": [] - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__float_flat.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__float_flat.snap deleted file mode 100644 index e93be78925..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__float_flat.snap +++ /dev/null @@ -1,60 +0,0 @@ ---- -source: tests/lsp/text_document/document_symbol.rs -expression: "find_symbols(r#\"\n%! main.tex\n\\documentclass{article}\n\n\\begin{document}\n\n\\begin{figure}\n Foo\n \\caption{Foo}\\label{fig:foo}\n\\end{figure}\n\n\\begin{figure}\n Bar\n \\caption{Bar}\\label{fig:bar}\n\\end{figure}\n\n\\begin{figure}\n Baz\n \\caption{Baz}\n\\end{figure}\n\n\\begin{figure}\n Qux\n\\end{figure}\n\n\\end{document}\n|\n\n%! main.aux\n\\relax\n\\@writefile{lof}{\\contentsline {figure}{\\numberline {1}{\\ignorespaces Foo}}{1}\\protected@file@percent }\n\\newlabel{fig:foo}{{1}{1}}\n\\@writefile{lof}{\\contentsline {figure}{\\numberline {2}{\\ignorespaces Bar}}{1}\\protected@file@percent }\n\\@writefile{lof}{\\contentsline {figure}{\\numberline {3}{\\ignorespaces Baz}}{1}\\protected@file@percent }\"#,\n serde_json::json!({}), serde_json::Value::Null)" ---- -[ - { - "name": "Figure 1: Foo", - "kind": 6, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 4, - "character": 0 - }, - "end": { - "line": 7, - "character": 12 - } - } - } - }, - { - "name": "Figure: Bar", - "kind": 6, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 9, - "character": 0 - }, - "end": { - "line": 12, - "character": 12 - } - } - } - }, - { - "name": "Figure: Baz", - "kind": 6, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 14, - "character": 0 - }, - "end": { - "line": 17, - "character": 12 - } - } - } - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__float_nested.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__float_nested.snap deleted file mode 100644 index a625beb1fb..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__float_nested.snap +++ /dev/null @@ -1,86 +0,0 @@ ---- -source: tests/lsp/text_document/document_symbol.rs -expression: "find_symbols(r#\"\n%! main.tex\n\\documentclass{article}\n\n\\begin{document}\n\n\\begin{figure}\n Foo\n \\caption{Foo}\\label{fig:foo}\n\\end{figure}\n\n\\begin{figure}\n Bar\n \\caption{Bar}\\label{fig:bar}\n\\end{figure}\n\n\\begin{figure}\n Baz\n \\caption{Baz}\n\\end{figure}\n\n\\begin{figure}\n Qux\n\\end{figure}\n\n\\end{document}\n|\n\n%! main.aux\n\\relax\n\\@writefile{lof}{\\contentsline {figure}{\\numberline {1}{\\ignorespaces Foo}}{1}\\protected@file@percent }\n\\newlabel{fig:foo}{{1}{1}}\n\\@writefile{lof}{\\contentsline {figure}{\\numberline {2}{\\ignorespaces Bar}}{1}\\protected@file@percent }\n\\@writefile{lof}{\\contentsline {figure}{\\numberline {3}{\\ignorespaces Baz}}{1}\\protected@file@percent }\"#,\n serde_json::json!({\n \"textDocument\" :\n {\n \"documentSymbol\" :\n { \"hierarchicalDocumentSymbolSupport\" : true, },\n },\n }), serde_json::Value::Null)" ---- -[ - { - "name": "Figure 1: Foo", - "detail": "fig:foo", - "kind": 6, - "deprecated": false, - "range": { - "start": { - "line": 4, - "character": 0 - }, - "end": { - "line": 7, - "character": 12 - } - }, - "selectionRange": { - "start": { - "line": 6, - "character": 17 - }, - "end": { - "line": 6, - "character": 32 - } - }, - "children": [] - }, - { - "name": "Figure: Bar", - "detail": "fig:bar", - "kind": 6, - "deprecated": false, - "range": { - "start": { - "line": 9, - "character": 0 - }, - "end": { - "line": 12, - "character": 12 - } - }, - "selectionRange": { - "start": { - "line": 11, - "character": 17 - }, - "end": { - "line": 11, - "character": 32 - } - }, - "children": [] - }, - { - "name": "Figure: Baz", - "kind": 6, - "deprecated": false, - "range": { - "start": { - "line": 14, - "character": 0 - }, - "end": { - "line": 17, - "character": 12 - } - }, - "selectionRange": { - "start": { - "line": 14, - "character": 0 - }, - "end": { - "line": 17, - "character": 12 - } - }, - "children": [] - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__ignored_patterns.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__ignored_patterns.snap deleted file mode 100644 index 90c445fc01..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__ignored_patterns.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/lsp/text_document/document_symbol.rs -expression: "find_symbols(r#\"\n%! main.tex\n\\documentclass{article}\n\n\\begin{document}\n\n\\begin{equation}\\label{eq:foo}\n Foo\n\\end{equation}\n \n\\begin{enumerate}\n \\item Foo\n \\item Bar\n\\end{enumerate}\n\n\\end{document}\n|\"#,\n serde_json::json!({}),\n serde_json::json!({\n \"symbols\" : { \"ignoredPatterns\" : [\"Item\", \"Enumerate\"] }\n }))" ---- -[ - { - "name": "Equation", - "kind": 14, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 4, - "character": 0 - }, - "end": { - "line": 6, - "character": 14 - } - } - } - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__section_flat.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__section_flat.snap deleted file mode 100644 index 85d9cef9e8..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__section_flat.snap +++ /dev/null @@ -1,60 +0,0 @@ ---- -source: tests/lsp/text_document/document_symbol.rs -expression: "find_symbols(r#\"\n%! main.tex\n\\documentclass{article}\n\n\\begin{document}\n\n\\section{Foo}\n\n\\section{Bar}\\label{sec:bar}\n\n\\subsection{Baz}\\label{sec:baz}\n\n\\end{document}\n|\n\n%! main.aux\n\\relax\n\\@writefile{toc}{\\contentsline {section}{\\numberline {1}Foo}{1}\\protected@file@percent }\n\\@writefile{toc}{\\contentsline {section}{\\numberline {2}Bar}{1}\\protected@file@percent }\n\\newlabel{sec:bar}{{2}{1}}\"#,\n serde_json::json!({}), serde_json::Value::Null)" ---- -[ - { - "name": "Foo", - "kind": 2, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 4, - "character": 0 - }, - "end": { - "line": 4, - "character": 13 - } - } - } - }, - { - "name": "2 Bar", - "kind": 2, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 6, - "character": 0 - }, - "end": { - "line": 8, - "character": 31 - } - } - } - }, - { - "name": "Baz", - "kind": 2, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 8, - "character": 0 - }, - "end": { - "line": 8, - "character": 31 - } - } - } - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__section_nested.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__section_nested.snap deleted file mode 100644 index bac292bf01..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__section_nested.snap +++ /dev/null @@ -1,87 +0,0 @@ ---- -source: tests/lsp/text_document/document_symbol.rs -expression: "find_symbols(r#\"\n%! main.tex\n\\documentclass{article}\n\n\\begin{document}\n\n\\section{Foo}\n\n\\section{Bar}\\label{sec:bar}\n\n\\subsection{Baz}\\label{sec:baz}\n\n\\end{document}\n|\n\n%! main.aux\n\\relax\n\\@writefile{toc}{\\contentsline {section}{\\numberline {1}Foo}{1}\\protected@file@percent }\n\\@writefile{toc}{\\contentsline {section}{\\numberline {2}Bar}{1}\\protected@file@percent }\n\\newlabel{sec:bar}{{2}{1}}\"#,\n serde_json::json!({\n \"textDocument\" :\n {\n \"documentSymbol\" :\n { \"hierarchicalDocumentSymbolSupport\" : true, },\n },\n }), serde_json::Value::Null)" ---- -[ - { - "name": "Foo", - "kind": 2, - "deprecated": false, - "range": { - "start": { - "line": 4, - "character": 0 - }, - "end": { - "line": 4, - "character": 13 - } - }, - "selectionRange": { - "start": { - "line": 4, - "character": 0 - }, - "end": { - "line": 4, - "character": 13 - } - }, - "children": [] - }, - { - "name": "2 Bar", - "detail": "sec:bar", - "kind": 2, - "deprecated": false, - "range": { - "start": { - "line": 6, - "character": 0 - }, - "end": { - "line": 8, - "character": 31 - } - }, - "selectionRange": { - "start": { - "line": 6, - "character": 13 - }, - "end": { - "line": 6, - "character": 28 - } - }, - "children": [ - { - "name": "Baz", - "detail": "sec:baz", - "kind": 2, - "deprecated": false, - "range": { - "start": { - "line": 8, - "character": 0 - }, - "end": { - "line": 8, - "character": 31 - } - }, - "selectionRange": { - "start": { - "line": 8, - "character": 16 - }, - "end": { - "line": 8, - "character": 31 - } - }, - "children": [] - } - ] - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__theorem_flat.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__theorem_flat.snap deleted file mode 100644 index 55ab44980c..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__theorem_flat.snap +++ /dev/null @@ -1,78 +0,0 @@ ---- -source: tests/lsp/text_document/document_symbol.rs -expression: "find_symbols(r#\"\n%! main.tex\n\\documentclass{article}\n\\usepackage{amsthm}\n\\newtheorem{lemma}{Lemma}\n\n\\begin{document}\n\n\\begin{lemma}[Foo]\\label{thm:foo}\n Foo\n\\end{lemma}\n\n\\begin{lemma}\\label{thm:bar}\n Bar\n\\end{lemma}\n\n\\begin{lemma}\\label{thm:baz}\n Baz\n\\end{lemma}\n\n\\begin{lemma}[Qux]\n Qux\n\\end{lemma}\n\n\\end{document}\n|\n\n%! main.aux\n\\relax\n\\newlabel{thm:foo}{{1}{1}}\n\\newlabel{thm:bar}{{2}{1}}\"#,\n serde_json::json!({}), serde_json::Value::Null)" ---- -[ - { - "name": "Lemma 1 (Foo)", - "kind": 13, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 6, - "character": 0 - }, - "end": { - "line": 8, - "character": 11 - } - } - } - }, - { - "name": "Lemma 2", - "kind": 13, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 10, - "character": 0 - }, - "end": { - "line": 12, - "character": 11 - } - } - } - }, - { - "name": "Lemma", - "kind": 13, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 14, - "character": 0 - }, - "end": { - "line": 16, - "character": 11 - } - } - } - }, - { - "name": "Lemma (Qux)", - "kind": 13, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 18, - "character": 0 - }, - "end": { - "line": 20, - "character": 11 - } - } - } - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__theorem_nested.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__theorem_nested.snap deleted file mode 100644 index 82bdd6d1d9..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__document_symbol__theorem_nested.snap +++ /dev/null @@ -1,113 +0,0 @@ ---- -source: tests/lsp/text_document/document_symbol.rs -expression: "find_symbols(r#\"\n%! main.tex\n\\documentclass{article}\n\\usepackage{amsthm}\n\\newtheorem{lemma}{Lemma}\n\n\\begin{document}\n\n\\begin{lemma}[Foo]\\label{thm:foo}\n Foo\n\\end{lemma}\n\n\\begin{lemma}\\label{thm:bar}\n Bar\n\\end{lemma}\n\n\\begin{lemma}\\label{thm:baz}\n Baz\n\\end{lemma}\n\n\\begin{lemma}[Qux]\n Qux\n\\end{lemma}\n\n\\end{document}\n|\n\n%! main.aux\n\\relax\n\\newlabel{thm:foo}{{1}{1}}\n\\newlabel{thm:bar}{{2}{1}}\"#,\n serde_json::json!({\n \"textDocument\" :\n {\n \"documentSymbol\" :\n { \"hierarchicalDocumentSymbolSupport\" : true, },\n },\n }), serde_json::Value::Null)" ---- -[ - { - "name": "Lemma 1 (Foo)", - "detail": "thm:foo", - "kind": 13, - "deprecated": false, - "range": { - "start": { - "line": 6, - "character": 0 - }, - "end": { - "line": 8, - "character": 11 - } - }, - "selectionRange": { - "start": { - "line": 6, - "character": 18 - }, - "end": { - "line": 6, - "character": 33 - } - }, - "children": [] - }, - { - "name": "Lemma 2", - "detail": "thm:bar", - "kind": 13, - "deprecated": false, - "range": { - "start": { - "line": 10, - "character": 0 - }, - "end": { - "line": 12, - "character": 11 - } - }, - "selectionRange": { - "start": { - "line": 10, - "character": 13 - }, - "end": { - "line": 10, - "character": 28 - } - }, - "children": [] - }, - { - "name": "Lemma", - "detail": "thm:baz", - "kind": 13, - "deprecated": false, - "range": { - "start": { - "line": 14, - "character": 0 - }, - "end": { - "line": 16, - "character": 11 - } - }, - "selectionRange": { - "start": { - "line": 14, - "character": 13 - }, - "end": { - "line": 14, - "character": 28 - } - }, - "children": [] - }, - { - "name": "Lemma (Qux)", - "kind": 13, - "deprecated": false, - "range": { - "start": { - "line": 18, - "character": 0 - }, - "end": { - "line": 20, - "character": 11 - } - }, - "selectionRange": { - "start": { - "line": 18, - "character": 0 - }, - "end": { - "line": 20, - "character": 11 - } - }, - "children": [] - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__folding_range__bibtex.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__folding_range__bibtex.snap deleted file mode 100644 index 2063cc39e5..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__folding_range__bibtex.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: tests/lsp/text_document/folding_range.rs -expression: "find_foldings(r#\"\n%! main.bib\nsome junk\nhere\n\n@article{foo,\n author = {bar},\n title = {baz}\n}\n\n@string{foo = \"bar\"}\n\n@comment{foo,\n author = {bar},\n title = {baz}\n}\n\n@preamble{\"foo\"}\n|\"#)" ---- -[ - { - "startLine": 3, - "startCharacter": 0, - "endLine": 6, - "endCharacter": 1, - "kind": "region" - }, - { - "startLine": 8, - "startCharacter": 0, - "endLine": 8, - "endCharacter": 20, - "kind": "region" - }, - { - "startLine": 15, - "startCharacter": 0, - "endLine": 15, - "endCharacter": 16, - "kind": "region" - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__folding_range__latex.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__folding_range__latex.snap deleted file mode 100644 index 74632eda56..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__folding_range__latex.snap +++ /dev/null @@ -1,41 +0,0 @@ ---- -source: tests/lsp/text_document/folding_range.rs -expression: "find_foldings(r#\"\n%! main.tex\n\\begin{document}\n \\section{Foo}\n foo\n \\subsection{Bar}\n bar\n \\section{Baz}\n baz\n \\section{Qux}\n\\end{document}\n|\"#)" ---- -[ - { - "startLine": 0, - "startCharacter": 0, - "endLine": 8, - "endCharacter": 14, - "kind": "region" - }, - { - "startLine": 1, - "startCharacter": 4, - "endLine": 4, - "endCharacter": 7, - "kind": "region" - }, - { - "startLine": 3, - "startCharacter": 4, - "endLine": 4, - "endCharacter": 7, - "kind": "region" - }, - { - "startLine": 5, - "startCharacter": 4, - "endLine": 6, - "endCharacter": 7, - "kind": "region" - }, - { - "startLine": 7, - "startCharacter": 4, - "endLine": 7, - "endCharacter": 17, - "kind": "region" - } -] diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_command.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_command.snap deleted file mode 100644 index b98dd68758..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_command.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: tests/lsp/text_document/formatting.rs -expression: "format(r#\"\n%! main.bib\n@article{foo, bar = \"\\baz\",}\n|\"#)" ---- -@article{foo, - bar = "\baz", -} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_insert_braces.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_insert_braces.snap deleted file mode 100644 index a95f5d3006..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_insert_braces.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: tests/lsp/text_document/formatting.rs -expression: "format(r#\"\n%! main.bib\n@article{foo, bar = baz,\n|\"#)" ---- -@article{foo, - bar = baz, -} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_join_strings.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_join_strings.snap deleted file mode 100644 index 3ea6bf18ad..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_join_strings.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: tests/lsp/text_document/formatting.rs -expression: "format(r#\"\n%! main.bib\n@article{foo, bar = \"baz\" # \"qux\"}\n|\"#)" ---- -@article{foo, - bar = "baz" # "qux", -} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_multiple_entries.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_multiple_entries.snap deleted file mode 100644 index 966f133a76..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_multiple_entries.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tests/lsp/text_document/formatting.rs -expression: "format(r#\"\n%! main.bib\n@article{foo, bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, \nconsectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.},}\n\n@article{foo, bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, \nconsectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.},}\"\n|\"#)" ---- -@article{foo, - bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum - dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit - amet, consectetur adipiscing elit.}, -} - -@article{foo, - bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum - dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit - amet, consectetur adipiscing elit.}, -}" diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_parens.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_parens.snap deleted file mode 100644 index ca317db108..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_parens.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: tests/lsp/text_document/formatting.rs -expression: "format(r#\"\n%! main.bib\n@article(foo,)\n|\"#)" ---- -@article{foo, -} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_preamble.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_preamble.snap deleted file mode 100644 index 6448e3a791..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_preamble.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: tests/lsp/text_document/formatting.rs -expression: "format(r#\"\n%! main.bib\n@preamble{\n \"foo bar baz\" }\n|\"#)" ---- -@preamble{"foo bar baz"} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_string.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_string.snap deleted file mode 100644 index a1739290fd..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_string.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: tests/lsp/text_document/formatting.rs -expression: "format(r#\"\n%! main.bib\n@string{foo=\"bar\"}\n|\"#)" ---- -@string{foo = "bar"} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_trailing_comma.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_trailing_comma.snap deleted file mode 100644 index dd5c7b49f0..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_trailing_comma.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: tests/lsp/text_document/formatting.rs -expression: "format(r#\"\n%! main.bib\n@article{foo, bar = baz}\n|\"#)" ---- -@article{foo, - bar = baz, -} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_wrap_long_lines.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_wrap_long_lines.snap deleted file mode 100644 index c52b8a9317..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__formatting__bibtex_internal_wrap_long_lines.snap +++ /dev/null @@ -1,9 +0,0 @@ ---- -source: tests/lsp/text_document/formatting.rs -expression: "format(r#\"\n%! main.bib\n@article{foo, bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit.\nLorem ipsum dolor sit amet,\nconsectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.},}\n|\"#)" ---- -@article{foo, - bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum - dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit - amet, consectetur adipiscing elit.}, -} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__citation_inside_cite.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__citation_inside_cite.snap deleted file mode 100644 index 6e6c6b264c..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__citation_inside_cite.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: tests/lsp/text_document/hover.rs -expression: "find_hover(r#\"\n%! main.bib\n@article{foo, author = {Foo Bar}, title = {Baz Qux}, year = 1337}\n\n%! main.tex\n\\addbibresource{main.bib}\n\\cite{foo}\n |\n ^^^\"#)" ---- -{ - "kind": "markdown", - "value": "F. Bar: \"Baz Qux\". (1337)." -} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__citation_inside_entry.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__citation_inside_entry.snap deleted file mode 100644 index c13c16051d..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__citation_inside_entry.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: tests/lsp/text_document/hover.rs -expression: "find_hover(r#\"\n%! main.bib\n@article{foo, author = {Foo Bar}, title = {Baz Qux}, year = 1337}\n |\n ^^^\n\n%! main.tex\n\\addbibresource{main.bib}\n\\cite{foo}\"#)" ---- -{ - "kind": "markdown", - "value": "F. Bar: \"Baz Qux\". (1337)." -} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__component_known_package.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__component_known_package.snap deleted file mode 100644 index ea1801d4ed..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__component_known_package.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: tests/lsp/text_document/hover.rs -expression: "find_hover(r#\"\n%! main.tex\n\\usepackage{amsmath}\n |\n ^^^^^^^\"#)" ---- -{ - "kind": "plaintext", - "value": "The package provides the principal packages in the AMS-LaTeX distribution. It adapts for use in LaTeX most of the mathematical features found in AMS-TeX; it is highly recommended as an adjunct to serious mathematical typesetting in LaTeX. When amsmath is loaded, AMS-LaTeX packages amsbsy (for bold symbols), amsopn (for operator names) and amstext (for text embedded in mathematics) are also loaded. amsmath is part of the LaTeX required distribution; however, several contributed packages add still further to its appeal; examples are empheq, which provides functions for decorating and highlighting mathematics, and ntheorem, for specifying theorem (and similar) definitions." -} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__entry_type_known_type.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__entry_type_known_type.snap deleted file mode 100644 index f3b146fb21..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__entry_type_known_type.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: tests/lsp/text_document/hover.rs -expression: "find_hover(r#\"\n%! main.bib\n@article{foo,}\n |\n^^^^^^^^\"#)" ---- -{ - "kind": "markdown", - "value": "An article in a journal, magazine, newspaper, or other periodical which forms a \n self-contained unit with its own title. The title of the periodical is given in the \n journaltitle field. If the issue has its own title in addition to the main title of \n the periodical, it goes in the issuetitle field. Note that editor and related \n fields refer to the journal while translator and related fields refer to the article.\n\nRequired fields: `author`, `title`, `journaltitle`, `year/date`" -} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__field_known.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__field_known.snap deleted file mode 100644 index 42d630c287..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__field_known.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: tests/lsp/text_document/hover.rs -expression: "find_hover(r#\"\n%! main.bib\n@article{foo, author = bar}\n |\n ^^^^^^\"#)" ---- -{ - "kind": "markdown", - "value": "The author(s) of the `title`." -} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__label_theorem_child_file.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__label_theorem_child_file.snap deleted file mode 100644 index 19b36c4ebb..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__label_theorem_child_file.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: tests/lsp/text_document/hover.rs -expression: "find_hover(r#\"\n%! main.tex\n\\documentclass{article}\n\\newtheorem{lemma}{Lemma}\n\\include{child}\n\\ref{thm:foo}\n |\n ^^^^^^^\n\n%! child.tex\n\\begin{lemma}\\label{thm:foo}\n 1 + 1 = 2\n\\end{lemma}\"#)" ---- -{ - "kind": "plaintext", - "value": "Lemma" -} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__label_theorem_child_file_mumber.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__label_theorem_child_file_mumber.snap deleted file mode 100644 index 78ccef8e46..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__label_theorem_child_file_mumber.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: tests/lsp/text_document/hover.rs -expression: "find_hover(r#\"\n%! main.tex\n\\documentclass{article}\n\\newtheorem{lemma}{Lemma}\n\\include{child}\n\\ref{thm:foo}\n |\n ^^^^^^^\n\n%! child.tex\n\\begin{lemma}[Foo]\\label{thm:foo}\n 1 + 1 = 2\n\\end{lemma}\n\n%! child.aux\n\\newlabel{thm:foo}{{1}{1}{Foo}{lemma.1}{}}\"#)" ---- -{ - "kind": "plaintext", - "value": "Lemma 1 (Foo)" -} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__section.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__section.snap deleted file mode 100644 index c8aa265330..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__section.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: tests/lsp/text_document/hover.rs -expression: "find_hover(r#\"\n%! main.tex\n\\section{Foo}\n\\label{sec:foo}\n |\n ^^^^^^^\"#)" ---- -{ - "kind": "plaintext", - "value": "Section (Foo)" -} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__string_inside_reference.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__string_inside_reference.snap deleted file mode 100644 index cfcc196e26..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__hover__string_inside_reference.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: tests/lsp/text_document/hover.rs -expression: "find_hover(r#\"\n%! main.bib\n@string{foo = \"Foo\"}\n@string{bar = \"Bar\"}\n@article{baz, author = bar}\n |\n ^^^\"#)" ---- -{ - "kind": "plaintext", - "value": "Bar" -} diff --git a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__inlay_hint__label_definition.snap b/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__inlay_hint__label_definition.snap deleted file mode 100644 index b8568fd2fd..0000000000 --- a/support/texlab/tests/lsp/text_document/snapshots/lsp__text_document__inlay_hint__label_definition.snap +++ /dev/null @@ -1,38 +0,0 @@ ---- -source: tests/lsp/text_document/inlay_hint.rs -expression: "find_hints(r#\"\n%! main.tex\n\\documentclass{article}\n\\usepackage{caption}\n\\begin{document}\n\\section{Foo}\\label{sec:foo}\n\\section{Bar}\\label{sec:bar}\n\\subsection{Baz}\\label{sec:baz}\n\\begin{figure}\n Test\n \\label{fig:qux}\n \\caption{Qux}\n\\end{figure}\n\\end{document}\n |\n\n%! main.aux\n\\relax \n\\providecommand*\\caption@xref[2]{\\@setref\\relax\\@undefined{#1}}\n\\newlabel{fig:qux}{{\\caption@xref {fig:qux}{ on input line 15}}{1}}\n\\@writefile{lof}{\\contentsline {figure}{\\numberline {1}{\\ignorespaces Qux\\relax }}{1}{}\\protected@file@percent }\n\\@writefile{toc}{\\contentsline {section}{\\numberline {1}Foo}{1}{}\\protected@file@percent }\n\\newlabel{sec:foo}{{1}{1}}\n\\@writefile{toc}{\\contentsline {section}{\\numberline {2}Bar}{1}{}\\protected@file@percent }\n\\newlabel{sec:bar}{{2}{1}}\n\\@writefile{toc}{\\contentsline {subsection}{\\numberline {2.1}Baz}{1}{}\\protected@file@percent }\n\\newlabel{sec:baz}{{2.1}{1}}\n\\gdef \\@abspage@last{1}\"#)" ---- -[ - { - "position": { - "line": 3, - "character": 27 - }, - "label": "Section 1", - "paddingLeft": true - }, - { - "position": { - "line": 4, - "character": 27 - }, - "label": "Section 2", - "paddingLeft": true - }, - { - "position": { - "line": 5, - "character": 30 - }, - "label": "Subsection 2.1", - "paddingLeft": true - }, - { - "position": { - "line": 8, - "character": 18 - }, - "label": "Figure fig:qux", - "paddingLeft": true - } -] diff --git a/support/texlab/tests/lsp/workspace.rs b/support/texlab/tests/lsp/workspace.rs deleted file mode 100644 index 15e0679dea..0000000000 --- a/support/texlab/tests/lsp/workspace.rs +++ /dev/null @@ -1 +0,0 @@ -mod symbol; diff --git a/support/texlab/tests/lsp/workspace/snapshots/lsp__workspace__symbol__filter_bibtex.snap b/support/texlab/tests/lsp/workspace/snapshots/lsp__workspace__symbol__filter_bibtex.snap deleted file mode 100644 index 0c2e328570..0000000000 --- a/support/texlab/tests/lsp/workspace/snapshots/lsp__workspace__symbol__filter_bibtex.snap +++ /dev/null @@ -1,42 +0,0 @@ ---- -source: tests/lsp/workspace/symbol.rs -expression: "find_symbols(FIXTURE, \"bibtex\")" ---- -[ - { - "name": "foo", - "kind": 24, - "deprecated": false, - "location": { - "uri": "file:///main.bib", - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 0, - "character": 14 - } - } - } - }, - { - "name": "bar", - "kind": 15, - "deprecated": false, - "location": { - "uri": "file:///main.bib", - "range": { - "start": { - "line": 2, - "character": 0 - }, - "end": { - "line": 2, - "character": 20 - } - } - } - } -] diff --git a/support/texlab/tests/lsp/workspace/snapshots/lsp__workspace__symbol__filter_type_figure.snap b/support/texlab/tests/lsp/workspace/snapshots/lsp__workspace__symbol__filter_type_figure.snap deleted file mode 100644 index 090fe25045..0000000000 --- a/support/texlab/tests/lsp/workspace/snapshots/lsp__workspace__symbol__filter_type_figure.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: tests/lsp/workspace/symbol.rs -expression: "find_symbols(FIXTURE, \"figure\")" ---- -[ - { - "name": "Figure 1: Bar", - "kind": 6, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 15, - "character": 0 - }, - "end": { - "line": 19, - "character": 12 - } - } - } - } -] diff --git a/support/texlab/tests/lsp/workspace/snapshots/lsp__workspace__symbol__filter_type_item.snap b/support/texlab/tests/lsp/workspace/snapshots/lsp__workspace__symbol__filter_type_item.snap deleted file mode 100644 index 6f739ffb29..0000000000 --- a/support/texlab/tests/lsp/workspace/snapshots/lsp__workspace__symbol__filter_type_item.snap +++ /dev/null @@ -1,60 +0,0 @@ ---- -source: tests/lsp/workspace/symbol.rs -expression: "find_symbols(FIXTURE, \"item\")" ---- -[ - { - "name": "1", - "kind": 22, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 24, - "character": 4 - }, - "end": { - "line": 24, - "character": 28 - } - } - } - }, - { - "name": "2", - "kind": 22, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 25, - "character": 4 - }, - "end": { - "line": 25, - "character": 28 - } - } - } - }, - { - "name": "3", - "kind": 22, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 26, - "character": 4 - }, - "end": { - "line": 26, - "character": 28 - } - } - } - } -] diff --git a/support/texlab/tests/lsp/workspace/snapshots/lsp__workspace__symbol__filter_type_math.snap b/support/texlab/tests/lsp/workspace/snapshots/lsp__workspace__symbol__filter_type_math.snap deleted file mode 100644 index 6e63e65aa4..0000000000 --- a/support/texlab/tests/lsp/workspace/snapshots/lsp__workspace__symbol__filter_type_math.snap +++ /dev/null @@ -1,42 +0,0 @@ ---- -source: tests/lsp/workspace/symbol.rs -expression: "find_symbols(FIXTURE, \"math\")" ---- -[ - { - "name": "Equation (1)", - "kind": 14, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 9, - "character": 0 - }, - "end": { - "line": 11, - "character": 14 - } - } - } - }, - { - "name": "Lemma 1 (Qux)", - "kind": 13, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 33, - "character": 0 - }, - "end": { - "line": 35, - "character": 11 - } - } - } - } -] diff --git a/support/texlab/tests/lsp/workspace/snapshots/lsp__workspace__symbol__filter_type_section.snap b/support/texlab/tests/lsp/workspace/snapshots/lsp__workspace__symbol__filter_type_section.snap deleted file mode 100644 index fef2f41be6..0000000000 --- a/support/texlab/tests/lsp/workspace/snapshots/lsp__workspace__symbol__filter_type_section.snap +++ /dev/null @@ -1,78 +0,0 @@ ---- -source: tests/lsp/workspace/symbol.rs -expression: "find_symbols(FIXTURE, \"section\")" ---- -[ - { - "name": "1 Foo", - "kind": 2, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 7, - "character": 0 - }, - "end": { - "line": 11, - "character": 14 - } - } - } - }, - { - "name": "2 Bar", - "kind": 2, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 13, - "character": 0 - }, - "end": { - "line": 19, - "character": 12 - } - } - } - }, - { - "name": "3 Baz", - "kind": 2, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 21, - "character": 0 - }, - "end": { - "line": 27, - "character": 15 - } - } - } - }, - { - "name": "4 Qux", - "kind": 2, - "deprecated": false, - "location": { - "uri": "file:///main.tex", - "range": { - "start": { - "line": 29, - "character": 0 - }, - "end": { - "line": 35, - "character": 11 - } - } - } - } -] diff --git a/support/texlab/tests/lsp/workspace/symbol.rs b/support/texlab/tests/lsp/workspace/symbol.rs deleted file mode 100644 index e726ed6860..0000000000 --- a/support/texlab/tests/lsp/workspace/symbol.rs +++ /dev/null @@ -1,124 +0,0 @@ -use insta::assert_json_snapshot; -use lsp_types::{ - request::WorkspaceSymbolRequest, ClientCapabilities, SymbolInformation, WorkspaceSymbolParams, - WorkspaceSymbolResponse, -}; - -use crate::fixture::TestBed; - -fn find_symbols(fixture: &str, query: &str) -> Vec<SymbolInformation> { - let test_bed = TestBed::new(fixture).unwrap(); - - test_bed.initialize(ClientCapabilities::default()).unwrap(); - - let mut symbols = match test_bed - .client() - .send_request::<WorkspaceSymbolRequest>(WorkspaceSymbolParams { - query: query.to_string(), - work_done_progress_params: Default::default(), - partial_result_params: Default::default(), - }) - .unwrap() - { - Some(WorkspaceSymbolResponse::Flat(symbols)) => symbols, - Some(WorkspaceSymbolResponse::Nested(_)) => unreachable!(), - None => Vec::new(), - }; - - for symbol in &mut symbols { - symbol.location.uri = test_bed.redact(&symbol.location.uri); - } - - symbols -} - -const FIXTURE: &str = r#" -%! main.tex -\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} -| - -%! main.aux -\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}} - -%! main.bib -@article{foo,} - -@string{bar = "bar"}"#; - -#[test] -fn filter_type_section() { - assert_json_snapshot!(find_symbols(FIXTURE, "section")); -} - -#[test] -fn filter_type_figure() { - assert_json_snapshot!(find_symbols(FIXTURE, "figure")); -} - -#[test] -fn filter_type_item() { - assert_json_snapshot!(find_symbols(FIXTURE, "item")); -} - -#[test] -fn filter_type_math() { - assert_json_snapshot!(find_symbols(FIXTURE, "math")); -} - -#[test] -fn filter_bibtex() { - assert_json_snapshot!(find_symbols(FIXTURE, "bibtex")); -} |