diff options
Diffstat (limited to 'support/texlab/src/tests')
98 files changed, 0 insertions, 6438 deletions
diff --git a/support/texlab/src/tests/client.rs b/support/texlab/src/tests/client.rs deleted file mode 100644 index ff6b23469b..0000000000 --- a/support/texlab/src/tests/client.rs +++ /dev/null @@ -1,159 +0,0 @@ -use std::sync::Once; - -use anyhow::{bail, Result}; -use crossbeam_channel::{Receiver, Sender}; -use lsp_server::{Connection, Message, Notification, Request, Response}; -use lsp_types::{ - notification::{Exit, Initialized}, - request::{Initialize, Shutdown}, - ClientCapabilities, ClientInfo, DidOpenTextDocumentParams, InitializeParams, InitializeResult, - InitializedParams, Url, WorkspaceFolder, -}; -use tempfile::{tempdir, TempDir}; - -use crate::Server; - -static INIT_LOGGER: Once = Once::new(); - -pub struct IncomingHandler { - _handle: jod_thread::JoinHandle<Result<()>>, - pub requests: Receiver<Request>, - pub notifications: Receiver<Notification>, - pub responses: Receiver<Response>, -} - -impl IncomingHandler { - pub fn spawn(receiver: Receiver<Message>) -> Self { - let (req_sender, req_receiver) = crossbeam_channel::unbounded(); - let (not_sender, not_receiver) = crossbeam_channel::unbounded(); - let (res_sender, res_receiver) = crossbeam_channel::unbounded(); - - let _handle = jod_thread::spawn(move || { - for message in &receiver { - match message { - Message::Request(req) => req_sender.send(req)?, - Message::Response(res) => res_sender.send(res)?, - Message::Notification(not) => not_sender.send(not)?, - }; - } - - Ok(()) - }); - - Self { - _handle, - requests: req_receiver, - notifications: not_receiver, - responses: res_receiver, - } - } -} - -pub struct ClientResult { - pub directory: TempDir, - pub incoming: IncomingHandler, -} - -pub struct Client { - outgoing: Sender<Message>, - incoming: IncomingHandler, - directory: TempDir, - request_id: i32, - _handle: jod_thread::JoinHandle, -} - -impl Client { - pub fn spawn() -> Self { - INIT_LOGGER.call_once(|| env_logger::init()); - - let directory = tempdir().unwrap(); - let (client, server) = Connection::memory(); - let incoming = IncomingHandler::spawn(client.receiver); - let outgoing = client.sender; - let server = Server::new(server); - let _handle = jod_thread::spawn(move || { - server.run().expect("server failed to run"); - }); - - Self { - outgoing, - incoming, - directory, - request_id: 0, - _handle, - } - } - - pub fn initialize( - &mut self, - client_capabilities: ClientCapabilities, - client_info: Option<ClientInfo>, - ) -> InitializeResult { - let result = self - .request::<Initialize>(InitializeParams { - initialization_options: Some(serde_json::json!({ "skipDistro": true })), - capabilities: client_capabilities, - workspace_folders: Some(vec![WorkspaceFolder { - name: "Test".into(), - uri: Url::from_directory_path(self.directory.path()).unwrap(), - }]), - client_info, - ..InitializeParams::default() - }) - .unwrap(); - - self.notify::<Initialized>(InitializedParams {}); - result - } - - pub fn request<R: lsp_types::request::Request>( - &mut self, - params: R::Params, - ) -> Result<R::Result> { - self.request_id += 1; - - self.outgoing - .send(Request::new(self.request_id.into(), R::METHOD.into(), params).into()) - .unwrap(); - - let response = self.incoming.responses.recv().unwrap(); - assert_eq!(response.id, self.request_id.into()); - - let result = match response.result { - Some(result) => result, - None => bail!("request failed: {:?}", response.error), - }; - - Ok(serde_json::from_value(result)?) - } - - pub fn notify<N: lsp_types::notification::Notification>(&mut self, params: N::Params) { - self.outgoing - .send(Notification::new(N::METHOD.into(), serde_json::to_value(params).unwrap()).into()) - .unwrap(); - } - - pub fn open(&mut self, name: &str, language_id: &str, text: String) { - self.notify::<lsp_types::notification::DidOpenTextDocument>(DidOpenTextDocumentParams { - text_document: lsp_types::TextDocumentItem { - uri: self.uri(name), - language_id: language_id.to_string(), - version: 0, - text, - }, - }); - } - - pub fn shutdown(mut self) -> ClientResult { - self.request::<Shutdown>(()).unwrap(); - self.notify::<Exit>(()); - ClientResult { - directory: self.directory, - incoming: self.incoming, - } - } - - pub fn uri(&self, name: &str) -> Url { - Url::from_file_path(self.directory.path().join(name)).unwrap() - } -} diff --git a/support/texlab/src/tests/fixture.rs b/support/texlab/src/tests/fixture.rs deleted file mode 100644 index fb2a6e6d69..0000000000 --- a/support/texlab/src/tests/fixture.rs +++ /dev/null @@ -1,126 +0,0 @@ -use std::collections::BTreeMap; - -use lsp_types::{Position, Range, TextDocumentIdentifier, TextDocumentPositionParams}; -use rustc_hash::FxHashMap; - -use super::client::Client; - -#[derive(Debug, PartialEq, Eq, Clone, Hash)] -enum Line<'a> { - File(&'a str, &'a str), - Plain(&'a str), - Range(u32, u32, std::ops::Range<usize>), - Cursor(usize), - Empty, -} - -fn parse_line(line: &str) -> Line { - if let Some(name) = line.strip_prefix("%ROOT ") { - Line::File(name, "texlabroot") - } else if let Some(name) = line.strip_prefix("%TEX ") { - Line::File(name, "latex") - } else if let Some(name) = line.strip_prefix("%BIB ") { - Line::File(name, "bibtex") - } else if let Some(name) = line.strip_prefix("%LOG ") { - Line::File(name, "log") - } else if let Some(text) = line.strip_prefix("%SRC ") { - Line::Plain(text) - } else if let Some(text) = line.strip_prefix("%CUR ") { - let position = text.find('^').unwrap(); - Line::Cursor(position) - } else if line.is_empty() { - Line::Empty - } else { - let key1 = line[1..2].parse().unwrap(); - let key2 = line[3..4].parse().unwrap(); - let line = &line[5..]; - let range = line - .find('^') - .map_or(0..0, |start| start..(line.rfind('^').unwrap() + 1)); - Line::Range(key1, key2, range) - } -} - -#[derive(Debug, Default)] -pub struct FileRange<'a> { - pub name: &'a str, - pub range: Range, -} - -#[derive(Debug, Default)] -pub struct File<'a> { - pub name: &'a str, - pub lang: &'a str, - pub text: String, -} - -#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] -pub struct FileCursor<'a> { - pub name: &'a str, - pub position: Position, -} - -impl<'a> FileCursor<'a> { - pub fn into_params(self, server: &Client) -> TextDocumentPositionParams { - let text_document = TextDocumentIdentifier::new(server.uri(self.name)); - TextDocumentPositionParams { - text_document, - position: self.position, - } - } -} - -#[derive(Debug, Default)] -pub struct Fixture<'a> { - pub files: Vec<File<'a>>, - pub cursor: Option<FileCursor<'a>>, - pub ranges: BTreeMap<u32, FxHashMap<u32, FileRange<'a>>>, -} - -pub fn parse(input: &str) -> Fixture { - let mut fixture = Fixture::default(); - let mut file = File::default(); - let mut file_line_index = 0; - for line in input.lines().map(parse_line) { - match line { - Line::File(name, lang) => { - if !file.name.is_empty() { - fixture.files.push(file); - file = File::default(); - } - - file.name = name; - file.lang = lang; - file_line_index = 0; - } - Line::Plain(line) => { - file.text.push_str(line); - file.text.push('\n'); - file_line_index += 1; - } - Line::Range(key1, key2, range) => { - let line = file_line_index - 1; - let start = Position::new(line, range.start.try_into().unwrap()); - let end = Position::new(line, range.end.try_into().unwrap()); - let range = Range::new(start, end); - fixture.ranges.entry(key1).or_default().insert( - key2, - FileRange { - name: file.name, - range, - }, - ); - } - Line::Cursor(position) => { - fixture.cursor = Some(FileCursor { - name: file.name, - position: Position::new(file_line_index - 1, position.try_into().unwrap()), - }); - } - Line::Empty => {} - }; - } - - fixture.files.push(file); - fixture -} diff --git a/support/texlab/src/tests/issues.rs b/support/texlab/src/tests/issues.rs deleted file mode 100644 index 8f578f5ada..0000000000 --- a/support/texlab/src/tests/issues.rs +++ /dev/null @@ -1,12 +0,0 @@ -use insta::assert_debug_snapshot; - -use crate::Options; - -#[test] -fn issue_707() { - assert_debug_snapshot!( - serde_json::from_value::<Option<Options>>(serde_json::json!({})) - .unwrap() - .unwrap_or_default() - ); -} diff --git a/support/texlab/src/tests/snapshots/texlab__tests__issues__issue_707.snap b/support/texlab/src/tests/snapshots/texlab__tests__issues__issue_707.snap deleted file mode 100644 index 38e15f8103..0000000000 --- a/support/texlab/src/tests/snapshots/texlab__tests__issues__issue_707.snap +++ /dev/null @@ -1,45 +0,0 @@ ---- -source: src/tests/issues.rs -expression: "serde_json::from_value::<Option<Options>>(serde_json::json!({})).unwrap().unwrap_or_default()" ---- -Options { - root_directory: None, - aux_directory: None, - bibtex_formatter: Texlab, - latex_formatter: Latexindent, - formatter_line_length: None, - diagnostics: DiagnosticsOptions { - allowed_patterns: [], - ignored_patterns: [], - }, - diagnostics_delay: DiagnosticsDelay( - 300ms, - ), - build: BuildOptions { - executable: BuildExecutable( - "latexmk", - ), - args: BuildArgs( - [ - "-pdf", - "-interaction=nonstopmode", - "-synctex=1", - "%f", - ], - ), - on_save: false, - forward_search_after: false, - }, - chktex: ChktexOptions { - on_open_and_save: false, - on_edit: false, - }, - latexindent: LatexindentOptions { - local: None, - modify_line_breaks: false, - }, - forward_search: ForwardSearchOptions { - executable: None, - args: None, - }, -} diff --git a/support/texlab/src/tests/text_document.rs b/support/texlab/src/tests/text_document.rs deleted file mode 100644 index aac0553ec4..0000000000 --- a/support/texlab/src/tests/text_document.rs +++ /dev/null @@ -1,12 +0,0 @@ -mod completion; -mod definition; -mod did_change_configuration; -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/src/tests/text_document/completion.rs b/support/texlab/src/tests/text_document/completion.rs deleted file mode 100644 index 7524eb2017..0000000000 --- a/support/texlab/src/tests/text_document/completion.rs +++ /dev/null @@ -1,834 +0,0 @@ -use insta::assert_json_snapshot; -use lsp_types::{ - request::{Completion, ResolveCompletionItem}, - CompletionItem, CompletionList, CompletionParams, CompletionResponse, CompletionTextEdit, - Range, -}; - -use crate::tests::{client::Client, fixture}; - -fn complete(fixture: &str) -> Vec<CompletionItem> { - let mut client = Client::spawn(); - client.initialize( - serde_json::from_value(serde_json::json!({ - "textDocument": { - "completion": { - "completionItem": { - "documentationFormat": ["plaintext", "markdown"] - } - } - } - })) - .unwrap(), - None, - ); - - let fixture = fixture::parse(fixture); - for file in fixture.files { - client.open(file.name, file.lang, file.text); - } - - let range = fixture - .ranges - .values() - .next() - .and_then(|map| map.values().next()) - .map_or_else( - || { - let position = fixture.cursor.unwrap().position; - Range::new(position, position) - }, - |file_range| file_range.range, - ); - - let actual_list = client - .request::<Completion>(CompletionParams { - text_document_position: fixture.cursor.unwrap().into_params(&client), - partial_result_params: Default::default(), - work_done_progress_params: Default::default(), - context: None, - }) - .unwrap() - .map_or(CompletionList::default(), |actual| match actual { - CompletionResponse::List(list) => list, - CompletionResponse::Array(_) => unreachable!(), - }); - - for item in &actual_list.items { - if let Some(CompletionTextEdit::Edit(edit)) = item.text_edit.as_ref() { - assert_eq!(edit.range, range); - } - } - - let actual_items = actual_list - .items - .into_iter() - .take(5) - .map(|item| client.request::<ResolveCompletionItem>(item).unwrap()) - .collect(); - - client.shutdown(); - actual_items -} - -macro_rules! assert_items { - ($items:expr) => { - assert_json_snapshot!($items, { - "[].data" => "[data]", - "[].sortText" => "[sortText]", - "[].documentation" => "[documentation]", - "[].textEdit.range" => "[range]", - "[]" => insta::sorted_redaction() - }); - }; -} - -#[test] -fn acronym_ref_simple() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second} -%SRC \acrshort{f} -%CUR ^ -%1.1 ^"# - )); -} - -#[test] -fn acronym_ref_empty() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second} -%SRC \acrshort{} -%CUR ^"# - )); -} - -#[test] -fn acronym_ref_after_group() { - let actual_items = complete( - r#" -%TEX main.tex -%SRC \newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second} -%SRC \acrshort{} -%CUR ^ -%1.1 ^"#, - ); - - assert_eq!(actual_items, Vec::new()); -} - -#[test] -fn acronym_ref_open_brace() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second} -%SRC \acrshort{f -%CUR ^ -%1.1 ^"# - )); -} - -#[test] -fn acronym_package_ref() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \acrodef{fpsLabel}[FPS]{Frames per Second} -%SRC \ac{f -%CUR ^ -%1.1 ^"# - )); -} - -#[test] -fn glossary_ref_simple() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second} -%SRC \gls{f} -%CUR ^ -%1.1 ^"# - )); -} - -#[test] -fn glossary_ref_open_brace() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second} -%SRC \gls{f -%CUR ^ -%1.1 ^"# - )); -} - -#[test] -fn argument_empty() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \usepackage{amsfonts} -%SRC \mathbb{} -%CUR ^"# - )); -} - -#[test] -fn argument_word() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \usepackage{amsfonts} -%SRC \mathbb{A} -%CUR ^ -%1.1 ^"# - )); -} - -#[test] -fn argument_open_brace() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \usepackage{amsfonts} -%SRC \mathbb{ -%CUR ^ -%SRC Test"# - )); -} - -#[test] -fn argument_open_brace_unrelated() { - let actual_items = complete( - r#" -%TEX main.tex -%SRC \usepackage{amsfonts} -%SRC \mathbb{}{ -%CUR ^ -%SRC Test"#, - ); - - assert_eq!(actual_items, Vec::new()); -} - -#[test] -fn begin_environment_without_snippet_support() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \beg -%CUR ^ -%1.1 ^^^"# - )); -} - -#[test] -fn citation() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC \bibliography{main} -%SRC \begin{document} -%SRC \cite{ -%CUR ^ -%SRC \end{document} - -%BIB main.bib -%SRC @article{foo:2019, -%SRC author = {Foo Bar}, -%SRC title = {Baz Qux}, -%SRC year = {2019}, -%SRC } -%SRC -%SRC @article{bar:2005,}"# - )); -} - -#[test] -fn citation_open_brace() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \addbibresource{main.bib} -%SRC \cite{ -%CUR ^ - -%BIB main.bib -%SRC @article{foo,}"# - )); -} - -#[test] -fn citation_open_brace_multiple() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \addbibresource{main.bib} -%SRC \cite{foo,a -%CUR ^ -%1.1 ^ - -%BIB main.bib -%SRC @article{foo,}"# - )); -} - -#[test] -fn citation_acronym() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \addbibresource{main.bib} -%SRC \DeclareAcronym{foo}{cite={}} -%CUR ^ - -%BIB main.bib -%SRC @article{foo,}"# - )); -} - -#[test] -fn citation_after_brace() { - let actual_items = complete( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC \bibliography{main} -%SRC \begin{document} -%SRC \cite{} -%CUR ^ -%SRC \end{document} - -%BIB main.bib -%SRC @article{foo,}"#, - ); - - assert_eq!(actual_items, Vec::new()); -} - -#[test] -fn color_model_definition_simple() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \definecolor{foo}{} -%CUR ^"# - )); -} - -#[test] -fn color_model_definition_open_brace() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \definecolor{foo}{ -%CUR ^"# - )); -} - -#[test] -fn color_model_definition_set_simple() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \definecolorset{} -%CUR ^"# - )); -} - -#[test] -fn color_model_definition_set_open_brace() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \definecolorset{ -%CUR ^"# - )); -} - -#[test] -fn color_simple() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \color{} -%CUR ^"# - )); -} - -#[test] -fn color_word() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \color{re} -%CUR ^ -%1.1 ^^"# - )); -} - -#[test] -fn color_open_brace() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \color{ -%CUR ^"# - )); -} - -#[test] -fn component_command_simple() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \ -%CUR ^"# - )); -} - -#[test] -fn component_command_simple_before() { - let actual_items = complete( - r#" -%TEX main.tex -%SRC \ -%CUR ^"#, - ); - - assert_eq!(actual_items, Vec::new()); -} - -#[test] -fn component_command_simple_package() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \usepackage{lipsum} -%SRC \lips -%CUR ^ -%1.1 ^^^^"# - )); -} - -#[test] -fn component_command_bibtex() { - assert_items!(complete( - r#" -%BIB main.bib -%SRC @article{b, -%SRC c = {\LaT } -%CUR ^ -%1.1 ^^^ -%SRC }"# - )); -} - -#[test] -fn component_environment_simple() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \begin{doc -%CUR ^ -%1.1 ^^^"# - )); -} - -#[test] -fn component_environment_simple_end() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \begin{document} -%SRC \end{ -%CUR ^"# - )); -} - -#[test] -fn component_environment_class() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC \begin{thein} -%CUR ^ -%1.1 ^^^^^"# - )); -} - -#[test] -fn component_environment_command_definition() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \newcommand{\foo}{\begin{doc} -%CUR ^ -%1.1 ^^^"# - )); -} - -#[test] -fn entry_type_at_empty() { - assert_items!(complete( - r#" -%BIB main.bib -%SRC @ -%CUR ^"# - )); -} - -#[test] -fn entry_type_before_preamble() { - assert_items!(complete( - r#" -%BIB main.bib -%SRC @preamble -%CUR ^ -%1.1 ^^^^^^^^"# - )); -} - -#[test] -fn entry_type_before_string() { - assert_items!(complete( - r#" -%BIB main.bib -%SRC @string -%CUR ^ -%1.1 ^^^^^^"# - )); -} - -#[test] -fn entry_type_before_article() { - assert_items!(complete( - r#" -%BIB main.bib -%SRC @article -%CUR ^ -%1.1 ^^^^^^^"# - )); -} - -#[test] -fn entry_type_after_preamble() { - assert_items!(complete( - r#" -%BIB main.bib -%SRC @preamble{ -%CUR ^ -%1.1 ^^^^^^^^"# - )); -} - -#[test] -fn entry_type_after_string() { - assert_items!(complete( - r#" -%BIB main.bib -%SRC @string{ -%CUR ^ -%1.1 ^^^^^^"# - )); -} - -#[test] -fn entry_type_complete_entry() { - assert_items!(complete( - r#" -%BIB main.bib -%SRC @article{foo, author = {foo}} -%CUR ^ -%1.1 ^^^^^^^"# - )); -} - -#[test] -fn field_empty_entry_open() { - assert_items!(complete( - r#" -%BIB main.bib -%SRC @article{foo, -%CUR ^"# - )); -} - -#[test] -fn field_empty_entry_closed() { - assert_items!(complete( - r#" -%BIB main.bib -%SRC @article{foo,} -%CUR ^"# - )); -} - -#[test] -fn field_entry_field_name() { - assert_items!(complete( - r#" -%BIB main.bib -%SRC @article{foo, a -%CUR ^ -%1.1 ^"# - )); -} - -#[test] -fn field_entry_two_fields_name_open() { - assert_items!(complete( - r#" -%BIB main.bib -%SRC @article{foo, author = bar, edit -%CUR ^ -%1.1 ^^^^"# - )); -} - -#[test] -fn field_entry_two_fields_name_closed() { - assert_items!(complete( - r#" -%BIB main.bib -%SRC @article{foo, author = bar, edit} -%CUR ^ -%1.1 ^^^^"# - )); -} - -#[test] -fn import_package_open_brace() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \usepackage{lips -%CUR ^ -%1.1 ^^^^"# - )); -} - -#[test] -fn import_package_closed_brace() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \usepackage{lips} -%CUR ^ -%1.1 ^^^^"# - )); -} - -#[test] -fn import_class_open_brace() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \documentclass{art \foo -%CUR ^ -%1.1 ^^^"# - )); -} - -#[test] -fn import_class_closed_brace() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \documentclass{art} -%CUR ^ -%1.1 ^^^"# - )); -} - -#[test] -fn label() { - assert_items!(complete( - r#" -%TEX foo.tex -%SRC \documentclass{article} -%SRC -%SRC \usepackage{amsmath} -%SRC \usepackage{caption} -%SRC \usepackage{amsthm} -%SRC \newtheorem{lemma}{Lemma} -%SRC -%SRC \begin{document} -%SRC -%SRC \section{Foo}% -%SRC \label{sec:foo} -%SRC -%SRC \begin{equation}% -%SRC \label{eq:foo} -%SRC 1 + 1 = 2 -%SRC \end{equation} -%SRC -%SRC \begin{equation}% -%SRC \label{eq:bar} -%SRC 1 + 1 = 2 -%SRC \end{equation} -%SRC -%SRC \begin{figure}% -%SRC \LaTeX{} -%SRC \caption{Baz}% -%SRC \label{fig:baz} -%SRC \end{figure} -%SRC -%SRC \begin{lemma}% -%SRC \label{thm:foo} -%SRC 1 + 1 = 2 -%SRC \end{lemma} -%SRC -%SRC \include{bar} -%SRC -%SRC \end{document} - -%TEX bar.tex -%SRC \section{Bar}% -%SRC \label{sec:bar} -%SRC -%SRC Lorem ipsum dolor sit amet. -%SRC \ref{} -%CUR ^ - -%TEX foo.aux -%SRC \relax -%SRC \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Baz\relax }}{1}\protected@file@percent } -%SRC \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} -%SRC \newlabel{fig:baz}{{1}{1}} -%SRC \@writefile{toc}{\contentsline {section}{\numberline {1}Foo}{1}\protected@file@percent } -%SRC \newlabel{sec:foo}{{1}{1}} -%SRC \newlabel{eq:foo}{{1}{1}} -%SRC \newlabel{eq:bar}{{2}{1}} -%SRC \newlabel{thm:foo}{{1}{1}} -%SRC \@input{bar.aux}"# - )); -} - -#[test] -fn theorem_begin() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \newtheorem{lemma}{Lemma} -%SRC \begin{lem -%CUR ^ -%1.1 ^^^"# - )); -} - -#[test] -fn theorem_end() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \newtheorem{lemma}{Lemma} -%SRC \begin{} -%SRC \end{lem -%CUR ^ -%1.1 ^^^"# - )); -} - -#[test] -fn tikz_library_open_brace() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \usepgflibrary{ -%CUR ^"# - )); -} - -#[test] -fn tikz_library_closed_brace() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \usepgflibrary{} -%CUR ^"# - )); -} - -#[test] -fn test_user_command() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \foobar -%SRC \fooba -%CUR ^ -%1.1 ^^^^^ -%SRC \begin{foo} -%SRC \end{foo} -%SRC \begin{fo} -"# - )); -} - -#[test] -fn test_user_environment() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \foobar -%SRC \fooba -%SRC \begin{foo} -%SRC \end{foo} -%SRC \begin{fo} -%CUR ^ -%1.1 ^^ -"# - )); -} - -#[test] -fn test_project_resolution_import() { - assert_items!(complete( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC \import{sub}{sub/sub.tex} -%SRC \lipsu -%CUR ^ -%1.1 ^^^^^ - -%TEX sub/sub.tex -%SRC \input{child.tex} - -%TEX sub/child.tex -%SRC \usepackage{lipsum} - -"# - )); -} - -#[test] -fn test_project_resolution_texlabroot() { - assert_items!(complete( - r#" -%TEX src/main.tex -%SRC \documentclass{article} -%SRC \include{src/foo} -%SRC \lipsu -%CUR ^ -%1.1 ^^^^^ - -%TEX src/foo.tex -%SRC \include{src/bar} - -%TEX src/bar.tex -%SRC \usepackage{lipsum} - -%ROOT .texlabroot -"# - )); -} diff --git a/support/texlab/src/tests/text_document/definition.rs b/support/texlab/src/tests/text_document/definition.rs deleted file mode 100644 index b1b915c6c9..0000000000 --- a/support/texlab/src/tests/text_document/definition.rs +++ /dev/null @@ -1,140 +0,0 @@ -use assert_unordered::assert_eq_unordered; -use lsp_types::{ - request::GotoDefinition, ClientCapabilities, GotoDefinitionParams, GotoDefinitionResponse, - LocationLink, -}; - -use crate::tests::{client::Client, fixture}; - -fn check(fixture: &str) { - let mut client = Client::spawn(); - client.initialize(ClientCapabilities::default(), None); - - let fixture = fixture::parse(fixture); - for file in fixture.files { - client.open(file.name, file.lang, file.text); - } - - let mut expected_links = Vec::new(); - for ranges in fixture.ranges.values() { - expected_links.push(LocationLink { - origin_selection_range: Some(ranges[&1].range), - target_uri: client.uri(ranges[&2].name), - target_range: ranges[&2].range, - target_selection_range: ranges[&3].range, - }); - } - - let actual_links = client - .request::<GotoDefinition>(GotoDefinitionParams { - text_document_position_params: fixture.cursor.unwrap().into_params(&client), - partial_result_params: Default::default(), - work_done_progress_params: Default::default(), - }) - .unwrap() - .map_or(Vec::new(), |actual| match actual { - GotoDefinitionResponse::Link(links) => links, - GotoDefinitionResponse::Array(_) | GotoDefinitionResponse::Scalar(_) => unreachable!(), - }); - - client.shutdown(); - assert_eq_unordered!(actual_links, expected_links); -} - -#[test] -fn command_definition() { - check( - r#" -%TEX main.tex -%SRC \DeclareMathOperator{\foo}{foo} -%1.3 ^^^^ -%1.2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -%SRC \foo -%CUR ^ -%1.1 ^^^^ -"#, - ) -} - -#[test] -fn document() { - check( - r#" -%TEX foo.tex -%SRC \addbibresource{baz.bib} -%CUR ^ -%1.1 ^^^^^^^ - -%TEX bar.bib -%SRC @article{foo, bar = {baz}} - -%TEX baz.bib -%SRC @article{foo, bar = {baz}} -%1.3 -%1.2 -"#, - ) -} - -#[test] -fn entry() { - check( - r#" -%TEX foo.tex -%SRC \addbibresource{baz.bib} -%SRC \cite{foo} -%CUR ^ -%1.1 ^^^ - -%BIB bar.bib -%SRC @article{foo, bar = {baz}} - -%BIB baz.bib -%SRC @article{foo, bar = {baz}} -%1.3 ^^^ -%1.2 ^^^^^^^^^^^^^^^^^^^^^^^^^^ -"#, - ) -} - -#[test] -fn string_simple() { - check( - r#" -%BIB main.bib -%SRC @string{foo = {bar}} -%1.3 ^^^ -%1.2 ^^^^^^^^^^^^^^^^^^^^ -%SRC @article{bar, author = foo} -%CUR ^ -%1.1 ^^^ -"#, - ) -} - -#[test] -fn string_join() { - check( - r#" -%BIB main.bib -%SRC @string{foo = {bar}} -%1.3 ^^^ -%1.2 ^^^^^^^^^^^^^^^^^^^^ -%SRC @article{bar, author = foo # "bar"} -%CUR ^ -%1.1 ^^^ -"#, - ) -} - -#[test] -fn string_field() { - check( - r#" -%BIB main.bib -%SRC @string{foo = {bar}} -%SRC @article{bar, author = foo # "bar"} -%CUR ^ -"#, - ) -} diff --git a/support/texlab/src/tests/text_document/did_change_configuration.rs b/support/texlab/src/tests/text_document/did_change_configuration.rs deleted file mode 100644 index 15aae0ee4b..0000000000 --- a/support/texlab/src/tests/text_document/did_change_configuration.rs +++ /dev/null @@ -1,37 +0,0 @@ -use insta::assert_snapshot; -use lsp_types::{ - notification::{DidChangeConfiguration, Notification, ShowMessage}, - ClientCapabilities, DidChangeConfigurationParams, ShowMessageParams, -}; - -use crate::tests::client::Client; - -#[test] -fn invalid_configuration() { - let mut client = Client::spawn(); - client.initialize(ClientCapabilities::default(), None); - - client.notify::<DidChangeConfiguration>(DidChangeConfigurationParams { - settings: serde_json::json!({ - "diagnostics": { - "allowedPatterns": ["\\"] - } - }), - }); - - let result = client.shutdown(); - let message = result - .incoming - .notifications - .into_iter() - .filter_map(|notification| { - notification - .extract::<ShowMessageParams>(ShowMessage::METHOD) - .ok() - }) - .find(|params| params.message.contains("configuration")) - .unwrap() - .message; - - assert_snapshot!(message); -} diff --git a/support/texlab/src/tests/text_document/document_highlight.rs b/support/texlab/src/tests/text_document/document_highlight.rs deleted file mode 100644 index 01945ce342..0000000000 --- a/support/texlab/src/tests/text_document/document_highlight.rs +++ /dev/null @@ -1,60 +0,0 @@ -use assert_unordered::assert_eq_unordered; -use lsp_types::{ - request::DocumentHighlightRequest, ClientCapabilities, DocumentHighlight, - DocumentHighlightKind, DocumentHighlightParams, -}; - -use crate::tests::{client::Client, fixture}; - -fn check(fixture: &str) { - let mut client = Client::spawn(); - client.initialize(ClientCapabilities::default(), None); - - let fixture = fixture::parse(fixture); - for file in fixture.files { - client.open(file.name, file.lang, file.text); - } - - let mut expected_highlights = Vec::new(); - for ranges in fixture.ranges.values() { - let (i, file_range) = ranges.iter().next().unwrap(); - let kind = match i { - 1 => DocumentHighlightKind::TEXT, - 2 => DocumentHighlightKind::READ, - 3 => DocumentHighlightKind::WRITE, - _ => unreachable!(), - }; - - expected_highlights.push(DocumentHighlight { - range: file_range.range, - kind: Some(kind), - }); - } - - let actual_highlights = client - .request::<DocumentHighlightRequest>(DocumentHighlightParams { - text_document_position_params: fixture.cursor.unwrap().into_params(&client), - partial_result_params: Default::default(), - work_done_progress_params: Default::default(), - }) - .unwrap() - .unwrap_or_default(); - - client.shutdown(); - assert_eq_unordered!(actual_highlights, expected_highlights); -} - -#[test] -fn test_label() { - check( - r#" -%TEX main.tex -%SRC \label{foo} -%CUR ^ -%1.3 ^^^ -%SRC \ref{foo} -%2.2 ^^^ -%SRC \label{bar} -"#, - ) -} diff --git a/support/texlab/src/tests/text_document/document_link.rs b/support/texlab/src/tests/text_document/document_link.rs deleted file mode 100644 index 8b4a30ceeb..0000000000 --- a/support/texlab/src/tests/text_document/document_link.rs +++ /dev/null @@ -1,71 +0,0 @@ -use assert_unordered::assert_eq_unordered; -use lsp_types::{ - request::DocumentLinkRequest, ClientCapabilities, DocumentLink, DocumentLinkParams, - TextDocumentIdentifier, -}; - -use crate::tests::{client::Client, fixture}; - -fn check(fixture: &str) { - let mut client = Client::spawn(); - client.initialize(ClientCapabilities::default(), None); - - let fixture = fixture::parse(fixture); - for file in fixture.files { - client.open(file.name, file.lang, file.text); - } - - let mut expected_links = Vec::new(); - for ranges in fixture.ranges.values() { - expected_links.push(DocumentLink { - range: ranges[&1].range, - target: Some(client.uri(ranges[&2].name)), - tooltip: None, - data: None, - }); - } - - let actual_links = client - .request::<DocumentLinkRequest>(DocumentLinkParams { - text_document: TextDocumentIdentifier::new(client.uri(fixture.cursor.unwrap().name)), - work_done_progress_params: Default::default(), - partial_result_params: Default::default(), - }) - .unwrap() - .unwrap_or_default(); - - client.shutdown(); - assert_eq_unordered!(actual_links, expected_links); -} - -#[test] -fn document_include() { - check( - r#" -%TEX foo.tex -%SRC \input{bar.tex} -%1.1 ^^^^^^^ -%CUR ^ - -%TEX bar.tex -%SRC -%1.2 -"#, - ) -} - -#[test] -fn document_import() { - check( - r#" -%TEX foo.tex -%SRC \import{.}{bar/baz} -%1.1 ^^^^^^^ -%CUR ^ - -%TEX bar/baz.tex -%SRC -%1.2 -"#, - ) -} diff --git a/support/texlab/src/tests/text_document/document_symbol.rs b/support/texlab/src/tests/text_document/document_symbol.rs deleted file mode 100644 index 2eab81631e..0000000000 --- a/support/texlab/src/tests/text_document/document_symbol.rs +++ /dev/null @@ -1,408 +0,0 @@ -use insta::{assert_json_snapshot, internals::Redaction}; -use lsp_types::{ - request::DocumentSymbolRequest, DocumentSymbolParams, DocumentSymbolResponse, - TextDocumentIdentifier, Url, -}; - -use crate::tests::{client::Client, fixture}; - -struct SymbolResult { - response: Option<DocumentSymbolResponse>, - uri_redaction: Redaction, -} - -fn find_symbols(fixture: &str, client_capabilities: serde_json::Value) -> SymbolResult { - let mut client = Client::spawn(); - client.initialize(serde_json::from_value(client_capabilities).unwrap(), None); - - let fixture = fixture::parse(fixture); - let file = fixture.files.into_iter().next().unwrap(); - client.open(file.name, file.lang, file.text); - - let response = client - .request::<DocumentSymbolRequest>(DocumentSymbolParams { - text_document: TextDocumentIdentifier::new(client.uri(file.name)), - work_done_progress_params: Default::default(), - partial_result_params: Default::default(), - }) - .unwrap(); - - let result = client.shutdown(); - - let uri = Url::from_directory_path(result.directory.path()).unwrap(); - let uri_redaction = insta::dynamic_redaction(move |content, _path| { - content.as_str().unwrap().replace(uri.as_str(), "[tmp]/") - }); - - SymbolResult { - response, - uri_redaction, - } -} - -macro_rules! assert_symbols { - ($result:expr) => { - let result = $result; - assert_json_snapshot!(result.response, { - "[].location.uri" => result.uri_redaction - }); - }; -} - -#[test] -fn enumerate_nested() { - assert_symbols!(find_symbols( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC -%SRC \begin{document} -%SRC -%SRC \begin{enumerate} -%SRC \item\label{it:foo} Foo -%SRC \item\label{it:bar} Bar -%SRC \item[Baz] Baz -%SRC \item[Qux]\label{it:qux} Qux -%SRC \end{enumerate} -%SRC -%SRC \end{document} - -%TEX main.aux -%SRC \relax -%SRC \newlabel{it:foo}{{1}{1}} -%SRC \newlabel{it:qux}{{2}{1}} -"#, - serde_json::json!({ - "textDocument": { - "documentSymbol": { - "hierarchicalDocumentSymbolSupport": true, - }, - }, - }), - )); -} - -#[test] -fn enumerate_flat() { - assert_symbols!(find_symbols( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC -%SRC \begin{document} -%SRC -%SRC \begin{enumerate} -%SRC \item\label{it:foo} Foo -%SRC \item\label{it:bar} Bar -%SRC \item[Baz] Baz -%SRC \item[Qux]\label{it:qux} Qux -%SRC \end{enumerate} -%SRC -%SRC \end{document} - -%TEX main.aux -%SRC \relax -%SRC \newlabel{it:foo}{{1}{1}} -%SRC \newlabel{it:qux}{{2}{1}} -"#, - serde_json::json!({}), - )); -} - -#[test] -fn equation_nested() { - assert_symbols!(find_symbols( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC -%SRC \begin{document} -%SRC -%SRC \begin{equation}\label{eq:foo} -%SRC Foo -%SRC \end{equation} -%SRC -%SRC \begin{equation}\label{eq:bar} -%SRC Bar -%SRC \end{equation} -%SRC -%SRC \begin{equation} -%SRC Baz -%SRC \end{equation} -%SRC -%SRC \end{document} - -%TEX main.aux -%SRC \relax -%SRC \newlabel{eq:foo}{{1}{1}} -"#, - serde_json::json!({ - "textDocument": { - "documentSymbol": { - "hierarchicalDocumentSymbolSupport": true, - }, - }, - }), - )); -} - -#[test] -fn equation_flat() { - assert_symbols!(find_symbols( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC -%SRC \begin{document} -%SRC -%SRC \begin{equation}\label{eq:foo} -%SRC Foo -%SRC \end{equation} -%SRC -%SRC \begin{equation}\label{eq:bar} -%SRC Bar -%SRC \end{equation} -%SRC -%SRC \begin{equation} -%SRC Baz -%SRC \end{equation} -%SRC -%SRC \end{document} - -%TEX main.aux -%SRC \relax -%SRC \newlabel{eq:foo}{{1}{1}} -"#, - serde_json::json!({}), - )); -} - -#[test] -fn float_nested() { - assert_symbols!(find_symbols( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC -%SRC \begin{document} -%SRC -%SRC \begin{figure} -%SRC Foo -%SRC \caption{Foo}\label{fig:foo} -%SRC \end{figure} -%SRC -%SRC \begin{figure} -%SRC Bar -%SRC \caption{Bar}\label{fig:bar} -%SRC \end{figure} -%SRC -%SRC \begin{figure} -%SRC Baz -%SRC \caption{Baz} -%SRC \end{figure} -%SRC -%SRC \begin{figure} -%SRC Qux -%SRC \end{figure} -%SRC -%SRC \end{document} - -%TEX main.aux -%SRC \relax -%SRC \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Foo}}{1}\protected@file@percent } -%SRC \newlabel{fig:foo}{{1}{1}} -%SRC \@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces Bar}}{1}\protected@file@percent } -%SRC \@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces Baz}}{1}\protected@file@percent } -"#, - serde_json::json!({ - "textDocument": { - "documentSymbol": { - "hierarchicalDocumentSymbolSupport": true, - }, - }, - }), - )); -} - -#[test] -fn float_flat() { - assert_symbols!(find_symbols( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC -%SRC \begin{document} -%SRC -%SRC \begin{figure} -%SRC Foo -%SRC \caption{Foo}\label{fig:foo} -%SRC \end{figure} -%SRC -%SRC \begin{figure} -%SRC Bar -%SRC \caption{Bar}\label{fig:bar} -%SRC \end{figure} -%SRC -%SRC \begin{figure} -%SRC Baz -%SRC \caption{Baz} -%SRC \end{figure} -%SRC -%SRC \begin{figure} -%SRC Qux -%SRC \end{figure} -%SRC -%SRC \end{document} - -%TEX main.aux -%SRC \relax -%SRC \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Foo}}{1}\protected@file@percent } -%SRC \newlabel{fig:foo}{{1}{1}} -%SRC \@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces Bar}}{1}\protected@file@percent } -%SRC \@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces Baz}}{1}\protected@file@percent } -"#, - serde_json::json!({}), - )); -} - -#[test] -fn section_nested() { - assert_symbols!(find_symbols( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC -%SRC \begin{document} -%SRC -%SRC \section{Foo} -%SRC -%SRC \section{Bar}\label{sec:bar} -%SRC -%SRC \subsection{Baz}\label{sec:baz} -%SRC -%SRC \end{document} - -%TEX main.aux -%SRC \relax -%SRC \@writefile{toc}{\contentsline {section}{\numberline {1}Foo}{1}\protected@file@percent } -%SRC \@writefile{toc}{\contentsline {section}{\numberline {2}Bar}{1}\protected@file@percent } -%SRC \newlabel{sec:bar}{{2}{1}} -"#, - serde_json::json!({ - "textDocument": { - "documentSymbol": { - "hierarchicalDocumentSymbolSupport": true, - }, - }, - }), - )); -} - -#[test] -fn section_flat() { - assert_symbols!(find_symbols( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC -%SRC \begin{document} -%SRC -%SRC \section{Foo} -%SRC -%SRC \section{Bar}\label{sec:bar} -%SRC -%SRC \subsection{Baz}\label{sec:baz} -%SRC -%SRC \end{document} - -%TEX main.aux -%SRC \relax -%SRC \@writefile{toc}{\contentsline {section}{\numberline {1}Foo}{1}\protected@file@percent } -%SRC \@writefile{toc}{\contentsline {section}{\numberline {2}Bar}{1}\protected@file@percent } -%SRC \newlabel{sec:bar}{{2}{1}} -"#, - serde_json::json!({}), - )); -} - -#[test] -fn theorem_nested() { - assert_symbols!(find_symbols( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC \usepackage{amsthm} -%SRC \newtheorem{lemma}{Lemma} -%SRC -%SRC \begin{document} -%SRC -%SRC \begin{lemma}[Foo]\label{thm:foo} -%SRC Foo -%SRC \end{lemma} -%SRC -%SRC \begin{lemma}\label{thm:bar} -%SRC Bar -%SRC \end{lemma} -%SRC -%SRC \begin{lemma}\label{thm:baz} -%SRC Baz -%SRC \end{lemma} -%SRC -%SRC \begin{lemma}[Qux] -%SRC Qux -%SRC \end{lemma} -%SRC -%SRC \end{document} - -%TEX main.aux -%SRC \relax -%SRC \newlabel{thm:foo}{{1}{1}} -%SRC \newlabel{thm:bar}{{2}{1}} -"#, - serde_json::json!({ - "textDocument": { - "documentSymbol": { - "hierarchicalDocumentSymbolSupport": true, - }, - }, - }), - )); -} - -#[test] -fn theorem_flat() { - assert_symbols!(find_symbols( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC \usepackage{amsthm} -%SRC \newtheorem{lemma}{Lemma} -%SRC -%SRC \begin{document} -%SRC -%SRC \begin{lemma}[Foo]\label{thm:foo} -%SRC Foo -%SRC \end{lemma} -%SRC -%SRC \begin{lemma}\label{thm:bar} -%SRC Bar -%SRC \end{lemma} -%SRC -%SRC \begin{lemma}\label{thm:baz} -%SRC Baz -%SRC \end{lemma} -%SRC -%SRC \begin{lemma}[Qux] -%SRC Qux -%SRC \end{lemma} -%SRC -%SRC \end{document} - -%TEX main.aux -%SRC \relax -%SRC \newlabel{thm:foo}{{1}{1}} -%SRC \newlabel{thm:bar}{{2}{1}} -"#, - serde_json::json!({}), - )); -} diff --git a/support/texlab/src/tests/text_document/folding_range.rs b/support/texlab/src/tests/text_document/folding_range.rs deleted file mode 100644 index 4b589222b1..0000000000 --- a/support/texlab/src/tests/text_document/folding_range.rs +++ /dev/null @@ -1,96 +0,0 @@ -use assert_unordered::assert_eq_unordered; -use lsp_types::{ - request::FoldingRangeRequest, ClientCapabilities, FoldingRange, FoldingRangeKind, - FoldingRangeParams, TextDocumentIdentifier, -}; - -use crate::tests::{client::Client, fixture}; - -fn check(fixture: &str, expected_ranges: Vec<(u32, u32, u32, u32)>) { - let mut client = Client::spawn(); - client.initialize(ClientCapabilities::default(), None); - - let fixture = fixture::parse(fixture); - for file in fixture.files { - client.open(file.name, file.lang, file.text); - } - - let actual_foldings = client - .request::<FoldingRangeRequest>(FoldingRangeParams { - text_document: TextDocumentIdentifier::new(client.uri(fixture.cursor.unwrap().name)), - work_done_progress_params: Default::default(), - partial_result_params: Default::default(), - }) - .unwrap() - .unwrap_or_default(); - - client.shutdown(); - - let expected_foldings = expected_ranges - .into_iter() - .map( - |(start_line, start_character, end_line, end_character)| FoldingRange { - start_line, - start_character: Some(start_character), - end_line, - end_character: Some(end_character), - kind: Some(FoldingRangeKind::Region), - }, - ) - .collect(); - - assert_eq_unordered!(actual_foldings, expected_foldings); -} - -#[test] -fn latex() { - check( - r#" -%TEX main.tex -%SRC \begin{document} -%SRC \section{Foo} -%SRC foo -%SRC \subsection{Bar} -%SRC bar -%SRC \section{Baz} -%SRC baz -%SRC \section{Qux} -%SRC \end{document} -%CUR ^ -"#, - vec![ - (0, 0, 8, 14), - (1, 4, 4, 7), - (3, 4, 4, 7), - (5, 4, 6, 7), - (7, 4, 7, 17), - ], - ) -} - -#[test] -fn bibtex() { - check( - r#" -%BIB main.bib -%SRC some junk -%SRC here -%SRC -%SRC @article{foo, -%SRC author = {bar}, -%SRC title = {baz} -%SRC } -%SRC -%SRC @string{foo = "bar"} -%SRC -%SRC @comment{foo, -%SRC author = {bar}, -%SRC title = {baz} -%SRC } -%SRC -%SRC @preamble{"foo"} -%CUR ^ -"#, - vec![(3, 0, 6, 1), (8, 0, 8, 20), (15, 0, 15, 16)], - ) -} diff --git a/support/texlab/src/tests/text_document/formatting.rs b/support/texlab/src/tests/text_document/formatting.rs deleted file mode 100644 index eb6804ca66..0000000000 --- a/support/texlab/src/tests/text_document/formatting.rs +++ /dev/null @@ -1,132 +0,0 @@ -use insta::assert_snapshot; -use lsp_types::{ - request::Formatting, ClientCapabilities, DocumentFormattingParams, FormattingOptions, - TextDocumentIdentifier, -}; - -use crate::{ - tests::{client::Client, fixture}, - util::{line_index::LineIndex, line_index_ext::LineIndexExt}, -}; - -fn format(fixture: &str) -> String { - let mut client = Client::spawn(); - client.initialize(ClientCapabilities::default(), None); - - let fixture = fixture::parse(fixture); - let file = fixture.files.into_iter().next().unwrap(); - let old_text = file.text.clone(); - client.open(file.name, file.lang, file.text); - - let actual_edits = client - .request::<Formatting>(DocumentFormattingParams { - text_document: TextDocumentIdentifier::new(client.uri(file.name)), - work_done_progress_params: Default::default(), - options: FormattingOptions { - insert_spaces: true, - tab_size: 4, - ..Default::default() - }, - }) - .unwrap() - .unwrap_or_default(); - - client.shutdown(); - - let line_index = LineIndex::new(&old_text); - let mut actual_text = old_text; - for edit in actual_edits.into_iter().rev() { - let range = line_index.offset_lsp_range(edit.range); - actual_text.replace_range::<std::ops::Range<usize>>(range.into(), &edit.new_text); - } - - actual_text -} - -#[test] -fn bibtex_internal_wrap_long_lines() { - assert_snapshot!(format( - r#" -%BIB main.bib -%SRC @article{foo, bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. -%SRC Lorem ipsum dolor sit amet, -%SRC consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.},}"#, - )); -} - -#[test] -fn bibtex_internal_multiple_entries() { - assert_snapshot!(format( - r#" -%BIB main.bib -%SRC @article{foo, bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, -%SRC consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.},} -%SRC -%SRC @article{foo, bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, -%SRC consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.},}""#, - )); -} - -#[test] -fn bibtex_internal_trailing_comma() { - assert_snapshot!(format( - r#" -%BIB main.bib -%SRC @article{foo, bar = baz}"#, - )); -} - -#[test] -fn bibtex_internal_insert_braces() { - assert_snapshot!(format( - r#" -%BIB main.bib -%SRC @article{foo, bar = baz,"#, - )); -} - -#[test] -fn bibtex_internal_command() { - assert_snapshot!(format( - r#" -%BIB main.bib -%SRC @article{foo, bar = "\baz",}"#, - )); -} - -#[test] -fn bibtex_internal_join_strings() { - assert_snapshot!(format( - r#" -%BIB main.bib -%SRC @article{foo, bar = "baz" # "qux"}"#, - )); -} - -#[test] -fn bibtex_internal_parens() { - assert_snapshot!(format( - r#" -%BIB main.bib -%SRC @article(foo,)"#, - )); -} - -#[test] -fn bibtex_internal_string() { - assert_snapshot!(format( - r#" -%BIB main.bib -%SRC @string{foo="bar"}"#, - )); -} - -#[test] -fn bibtex_internal_preamble() { - assert_snapshot!(format( - r#" -%BIB main.bib -%SRC @preamble{ -%SRC "foo bar baz" }"#, - )); -} diff --git a/support/texlab/src/tests/text_document/hover.rs b/support/texlab/src/tests/text_document/hover.rs deleted file mode 100644 index 302be82ca3..0000000000 --- a/support/texlab/src/tests/text_document/hover.rs +++ /dev/null @@ -1,303 +0,0 @@ -use lsp_types::{ - request::HoverRequest, ClientCapabilities, Hover, HoverContents, HoverParams, MarkupContent, - MarkupKind, -}; - -use crate::{ - tests::{client::Client, fixture}, - util::{components::COMPONENT_DATABASE, lang_data::LANGUAGE_DATA}, -}; - -fn check(fixture: &str, contents: Option<HoverContents>) { - let mut client = Client::spawn(); - client.initialize(ClientCapabilities::default(), None); - - let fixture = fixture::parse(fixture); - for file in fixture.files { - client.open(file.name, file.lang, file.text); - } - - let range = fixture - .ranges - .values() - .next() - .and_then(|map| map.values().next()) - .map(|file_range| file_range.range); - - let actual_hover = client - .request::<HoverRequest>(HoverParams { - text_document_position_params: fixture.cursor.unwrap().into_params(&client), - work_done_progress_params: Default::default(), - }) - .unwrap(); - - client.shutdown(); - - let expected_hover = contents.map(|contents| Hover { range, contents }); - assert_eq!(actual_hover, expected_hover); -} - -#[test] -fn empty_latex_document() { - check( - r#" -%TEX main.tex -%SRC -%CUR ^ -"#, - None, - ) -} - -#[test] -fn empty_bibtex_document() { - check( - r#" -%BIB main.bib -%SRC -%CUR ^ -"#, - None, - ) -} - -#[test] -fn citation_inside_cite() { - check( - r#" -%BIB main.bib -%SRC @article{foo, author = {Foo Bar}, title = {Baz Qux}, year = 1337} - -%TEX main.tex -%SRC \addbibresource{main.bib} -%SRC \cite{foo} -%CUR ^ -%1.1 ^^^ -"#, - Some(HoverContents::Markup(MarkupContent { - kind: MarkupKind::Markdown, - value: "F. Bar: \"Baz Qux\". (1337).".to_string(), - })), - ) -} - -#[test] -fn citation_inside_entry() { - check( - r#" -%BIB main.bib -%SRC @article{foo, author = {Foo Bar}, title = {Baz Qux}, year = 1337} -%CUR ^ -%1.1 ^^^ - -%TEX main.tex -%SRC \addbibresource{main.bib} -%SRC \cite{foo} -"#, - Some(HoverContents::Markup(MarkupContent { - kind: MarkupKind::Markdown, - value: "F. Bar: \"Baz Qux\". (1337).".to_string(), - })), - ) -} - -#[test] -fn component_known_package() { - check( - r#" -%TEX main.tex -%SRC \usepackage{amsmath} -%CUR ^ -%1.1 ^^^^^^^ -"#, - COMPONENT_DATABASE - .documentation("amsmath") - .map(HoverContents::Markup), - ) -} - -#[test] -fn component_unknown_class() { - check( - r#" -%TEX main.tex -%SRC \documentclass{abcdefghijklmnop} -%CUR ^ -"#, - None, - ) -} - -#[test] -fn entry_type_known_type() { - check( - r#" -%BIB main.bib -%SRC @article{foo,} -%CUR ^ -%1.1 ^^^^^^^^ -"#, - Some(HoverContents::Markup(MarkupContent { - kind: MarkupKind::Markdown, - value: LANGUAGE_DATA - .entry_type_documentation("article") - .unwrap() - .to_string(), - })), - ) -} - -#[test] -fn entry_type_unknown_field() { - check( - r#" -%BIB main.bib -%SRC @foo{bar,} -%CUR ^ -"#, - None, - ) -} - -#[test] -fn entry_type_key() { - check( - r#" -%BIB main.bib -%SRC @foo{bar,} -%CUR ^ -"#, - None, - ) -} - -#[test] -fn field_known() { - check( - r#" -%BIB main.bib -%SRC @article{foo, author = bar} -%CUR ^ -%1.1 ^^^^^^ -"#, - Some(HoverContents::Markup(MarkupContent { - kind: MarkupKind::Markdown, - value: LANGUAGE_DATA - .field_documentation("author") - .unwrap() - .to_string(), - })), - ) -} - -#[test] -fn field_unknown() { - check( - r#" -%BIB main.bib -%SRC @article{foo, bar = baz} -%CUR ^ -"#, - None, - ) -} - -#[test] -fn section() { - check( - r#" -%TEX main.tex -%SRC \section{Foo} -%SRC \label{sec:foo} -%CUR ^ -%1.1 ^^^^^^^ -"#, - Some(HoverContents::Markup(MarkupContent { - kind: MarkupKind::PlainText, - value: "Section (Foo)".to_string(), - })), - ) -} - -#[test] -fn string_inside_reference() { - check( - r#" -%BIB main.bib -%SRC @string{foo = "Foo"} -%SRC @string{bar = "Bar"} -%SRC @article{baz, author = bar} -%CUR ^ -%1.1 ^^^ -"#, - Some(HoverContents::Markup(MarkupContent { - kind: MarkupKind::PlainText, - value: "Bar".to_string(), - })), - ) -} - -#[test] -fn string_inside_field() { - check( - r#" -%BIB main.bib -%SRC @string{foo = "Foo"} -%SRC @string{bar = "Bar"} -%SRC @article{baz, author = bar} -%CUR ^ -"#, - None, - ) -} - -#[test] -fn label_theorem_child_file() { - check( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC \newtheorem{lemma}{Lemma} -%SRC \include{child} -%SRC \ref{thm:foo} -%CUR ^ -%1.1 ^^^^^^^ - -%TEX child.tex -%SRC \begin{lemma}\label{thm:foo} -%SRC 1 + 1 = 2 -%SRC \end{lemma} -"#, - Some(HoverContents::Markup(MarkupContent { - kind: MarkupKind::PlainText, - value: "Lemma".to_string(), - })), - ) -} - -#[test] -fn label_theorem_child_file_mumber() { - check( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC \newtheorem{lemma}{Lemma} -%SRC \include{child} -%SRC \ref{thm:foo} -%CUR ^ -%1.1 ^^^^^^^ - -%TEX child.tex -%SRC \begin{lemma}[Foo]\label{thm:foo} -%SRC 1 + 1 = 2 -%SRC \end{lemma} - -%TEX child.aux -%SRC \newlabel{thm:foo}{{1}{1}{Foo}{lemma.1}{}} -"#, - Some(HoverContents::Markup(MarkupContent { - kind: MarkupKind::PlainText, - value: "Lemma 1 (Foo)".to_string(), - })), - ) -} diff --git a/support/texlab/src/tests/text_document/inlay_hint.rs b/support/texlab/src/tests/text_document/inlay_hint.rs deleted file mode 100644 index acf5c3e132..0000000000 --- a/support/texlab/src/tests/text_document/inlay_hint.rs +++ /dev/null @@ -1,65 +0,0 @@ -use insta::assert_json_snapshot; -use lsp_types::{ - request::InlayHintRequest, ClientCapabilities, InlayHint, InlayHintParams, Position, Range, - TextDocumentIdentifier, -}; - -use crate::tests::{client::Client, fixture}; - -fn check(fixture: &str) -> Vec<InlayHint> { - let mut client = Client::spawn(); - client.initialize(ClientCapabilities::default(), None); - - let fixture = fixture::parse(fixture); - let uri = client.uri(fixture.files[0].name); - - for file in fixture.files { - client.open(file.name, file.lang, file.text); - } - - let actual_hints = client - .request::<InlayHintRequest>(InlayHintParams { - text_document: TextDocumentIdentifier::new(uri), - range: Range::new(Position::new(0, 0), Position::new(12, 0)), - work_done_progress_params: Default::default(), - }) - .unwrap() - .unwrap_or_default(); - - client.shutdown(); - actual_hints -} - -#[test] -fn label_definition() { - assert_json_snapshot!(check( - r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC \usepackage{caption} -%SRC \begin{document} -%SRC \section{Foo}\label{sec:foo} -%SRC \section{Bar}\label{sec:bar} -%SRC \subsection{Baz}\label{sec:baz} -%SRC \begin{figure} -%SRC Test -%SRC \label{fig:qux} -%SRC \caption{Qux} -%SRC \end{figure} -%SRC \end{document} - -%TEX main.aux -%SRC \relax -%SRC \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} -%SRC \newlabel{fig:qux}{{\caption@xref {fig:qux}{ on input line 15}}{1}} -%SRC \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Qux\relax }}{1}{}\protected@file@percent } -%SRC \@writefile{toc}{\contentsline {section}{\numberline {1}Foo}{1}{}\protected@file@percent } -%SRC \newlabel{sec:foo}{{1}{1}} -%SRC \@writefile{toc}{\contentsline {section}{\numberline {2}Bar}{1}{}\protected@file@percent } -%SRC \newlabel{sec:bar}{{2}{1}} -%SRC \@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Baz}{1}{}\protected@file@percent } -%SRC \newlabel{sec:baz}{{2.1}{1}} -%SRC \gdef \@abspage@last{1} -"#, - )); -} diff --git a/support/texlab/src/tests/text_document/references.rs b/support/texlab/src/tests/text_document/references.rs deleted file mode 100644 index a0ebed1fb4..0000000000 --- a/support/texlab/src/tests/text_document/references.rs +++ /dev/null @@ -1,271 +0,0 @@ -use assert_unordered::assert_eq_unordered; -use lsp_types::{ - request::References, ClientCapabilities, Location, ReferenceContext, ReferenceParams, -}; - -use crate::tests::{client::Client, fixture}; - -fn check(fixture: &str, context: ReferenceContext) { - let mut client = Client::spawn(); - client.initialize(ClientCapabilities::default(), None); - - let fixture = fixture::parse(fixture); - for file in fixture.files { - client.open(file.name, file.lang, file.text); - } - - let mut expected_locations = Vec::new(); - for ranges in fixture.ranges.values() { - expected_locations.push(Location::new(client.uri(ranges[&1].name), ranges[&1].range)); - } - - let actual_locations = client - .request::<References>(ReferenceParams { - text_document_position: fixture.cursor.unwrap().into_params(&client), - context, - partial_result_params: Default::default(), - work_done_progress_params: Default::default(), - }) - .unwrap() - .unwrap_or_default(); - - client.shutdown(); - - assert_eq_unordered!(actual_locations, expected_locations); -} - -#[test] -fn entry_definition() { - check( - r#" -%BIB foo.bib -%SRC @article{foo,} -%CUR ^ - -%TEX bar.tex -%SRC \cite{foo} -%1.1 ^^^ -%SRC \addbibresource{foo.bib} -"#, - ReferenceContext { - include_declaration: false, - }, - ) -} - -#[test] -fn entry_definition_include_decl() { - check( - r#" -%BIB foo.bib -%SRC @article{foo,} -%CUR ^ -%2.1 ^^^ - -%TEX bar.tex -%SRC \cite{foo} -%1.1 ^^^ -%SRC \addbibresource{foo.bib} -"#, - ReferenceContext { - include_declaration: true, - }, - ) -} - -#[test] -fn entry_reference() { - check( - r#" -%BIB foo.bib -%SRC @article{foo,} - -%TEX bar.tex -%SRC \cite{foo} -%CUR ^ -%1.1 ^^^ -%SRC \addbibresource{foo.bib} -"#, - ReferenceContext { - include_declaration: false, - }, - ) -} - -#[test] -fn entry_reference_include_decl() { - check( - r#" -%BIB foo.bib -%SRC @article{foo,} -%2.1 ^^^ - -%TEX bar.tex -%SRC \cite{foo} -%CUR ^ -%1.1 ^^^ -%SRC \addbibresource{foo.bib} -"#, - ReferenceContext { - include_declaration: true, - }, - ) -} - -#[test] -fn label_definition() { - check( - r#" -%TEX foo.tex -%SRC \label{foo} -%CUR ^ - -%TEX bar.tex -%SRC \ref{foo} -%1.1 ^^^ -%SRC \input{foo.tex} -"#, - ReferenceContext { - include_declaration: false, - }, - ) -} - -#[test] -fn label_definition_include_decl() { - check( - r#" -%TEX foo.tex -%SRC \label{foo} -%CUR ^ -%2.1 ^^^ - -%TEX bar.tex -%SRC \ref{foo} -%1.1 ^^^ -%SRC \input{foo.tex} -"#, - ReferenceContext { - include_declaration: true, - }, - ) -} - -#[test] -fn label_reference() { - check( - r#" -%TEX foo.tex -%SRC \label{foo} -%SRC \input{bar.tex} - -%TEX bar.tex -%SRC \ref{foo} -%CUR ^ -%1.1 ^^^ - -%TEX baz.tex -%SRC \ref{foo} -%2.1 ^^^ -%SRC \input{bar.tex} -"#, - ReferenceContext { - include_declaration: false, - }, - ) -} - -#[test] -fn label_reference_include_decl() { - check( - r#" -%TEX foo.tex -%SRC \label{foo} -%3.1 ^^^ -%SRC \input{bar.tex} - -%TEX bar.tex -%SRC \ref{foo} -%CUR ^ -%1.1 ^^^ - -%TEX baz.tex -%SRC \ref{foo} -%2.1 ^^^ -%SRC \input{bar.tex} -"#, - ReferenceContext { - include_declaration: true, - }, - ) -} - -#[test] -fn string_reference() { - check( - r#" -%BIB main.bib -%SRC @string{foo = {Foo}} -%SRC @string{bar = {Bar}} -%SRC @article{baz, author = foo} -%CUR ^ -%1.1 ^^^ -"#, - ReferenceContext { - include_declaration: false, - }, - ) -} - -#[test] -fn string_reference_include_decl() { - check( - r#" -%BIB main.bib -%SRC @string{foo = {Foo}} -%2.1 ^^^ -%SRC @string{bar = {Bar}} -%SRC @article{baz, author = foo} -%CUR ^ -%1.1 ^^^ -"#, - ReferenceContext { - include_declaration: true, - }, - ) -} - -#[test] -fn string_definition() { - check( - r#" -%BIB main.bib -%SRC @string{foo = {Foo}} -%CUR ^ -%SRC @string{bar = {Bar}} -%SRC @article{baz, author = foo} -%1.1 ^^^ -"#, - ReferenceContext { - include_declaration: false, - }, - ) -} - -#[test] -fn string_definition_include_decl() { - check( - r#" -%BIB main.bib -%SRC @string{foo = {Foo}} -%CUR ^ -%2.1 ^^^ -%SRC @string{bar = {Bar}} -%SRC @article{baz, author = foo} -%1.1 ^^^ -"#, - ReferenceContext { - include_declaration: true, - }, - ) -} diff --git a/support/texlab/src/tests/text_document/rename.rs b/support/texlab/src/tests/text_document/rename.rs deleted file mode 100644 index 2bbdfb1513..0000000000 --- a/support/texlab/src/tests/text_document/rename.rs +++ /dev/null @@ -1,110 +0,0 @@ -use std::collections::HashMap; - -use lsp_types::{request::Rename, ClientCapabilities, RenameParams, TextEdit, Url, WorkspaceEdit}; - -use crate::tests::{client::Client, fixture}; - -fn check(fixture: &str, new_name: &str) { - let mut client = Client::spawn(); - client.initialize(ClientCapabilities::default(), None); - - let fixture = fixture::parse(fixture); - for file in fixture.files { - client.open(file.name, file.lang, file.text); - } - - let mut expected_changes: HashMap<Url, Vec<TextEdit>> = HashMap::new(); - for ranges in fixture.ranges.values() { - expected_changes - .entry(client.uri(ranges[&1].name)) - .or_default() - .push(TextEdit::new(ranges[&1].range, new_name.to_string())); - } - - let actual_edit = client - .request::<Rename>(RenameParams { - text_document_position: fixture.cursor.unwrap().into_params(&client), - new_name: new_name.to_string(), - work_done_progress_params: Default::default(), - }) - .unwrap() - .unwrap_or_default(); - - client.shutdown(); - - assert_eq!(actual_edit, WorkspaceEdit::new(expected_changes)); -} - -#[test] -fn command() { - check( - r#" -%TEX foo.tex -%SRC \baz -%CUR ^ -%1.1 ^^^ -%SRC \include{bar.tex} - -%TEX bar.tex -%SRC \baz -%2.1 ^^^ -"#, - "qux", - ) -} - -#[test] -fn entry() { - check( - r#" -%BIB main.bib -%SRC @article{foo, bar = baz} -%CUR ^ -%1.1 ^^^ - -%TEX main.tex -%SRC \addbibresource{main.bib} -%SRC \cite{foo} -%2.1 ^^^ -"#, - "qux", - ) -} - -#[test] -fn citation() { - check( - r#" -%BIB main.bib -%SRC @article{foo, bar = baz} -%1.1 ^^^ - -%TEX main.tex -%SRC \addbibresource{main.bib} -%SRC \cite{foo} -%CUR ^ -%2.1 ^^^ -"#, - "qux", - ) -} - -#[test] -fn label() { - check( - r#" -%TEX foo.tex -%SRC \label{foo}\include{bar} -%CUR ^ -%1.1 ^^^ - -%TEX bar.tex -%SRC \ref{foo} -%2.1 ^^^ - -%TEX baz.tex -%SRC \ref{foo} -"#, - "bar", - ) -} diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__acronym_package_ref.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__acronym_package_ref.snap deleted file mode 100644 index 88ba06e91c..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__acronym_package_ref.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\acrodef{fpsLabel}[FPS]{Frames per Second}\n%SRC \\ac{f\n%CUR ^\n%1.1 ^\"#)?" ---- -[ - { - "kind": 1, - "label": "fpsLabel", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "fpsLabel" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__acronym_ref_empty.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__acronym_ref_empty.snap deleted file mode 100644 index 65259d44a7..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__acronym_ref_empty.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second}\n%SRC \\acrshort{}\n%CUR ^\"#)?" ---- -[ - { - "kind": 1, - "label": "fpsLabel", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "fpsLabel" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__acronym_ref_open_brace.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__acronym_ref_open_brace.snap deleted file mode 100644 index f326640993..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__acronym_ref_open_brace.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second}\n%SRC \\acrshort{f\n%CUR ^\n%1.1 ^\"#)?" ---- -[ - { - "kind": 1, - "label": "fpsLabel", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "fpsLabel" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__acronym_ref_simple.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__acronym_ref_simple.snap deleted file mode 100644 index db7adf0259..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__acronym_ref_simple.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second}\n%SRC \\acrshort{f}\n%CUR ^\n%1.1 ^\"#)?" ---- -[ - { - "kind": 1, - "label": "fpsLabel", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "fpsLabel" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__argument_empty.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__argument_empty.snap deleted file mode 100644 index 75a73c5e32..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__argument_empty.snap +++ /dev/null @@ -1,61 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\usepackage{amsfonts}\n%SRC \\mathbb{}\n%CUR ^\"#)?" ---- -[ - { - "documentation": "[documentation]", - "kind": 1, - "label": "A", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "A" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "B", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "B" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "C", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "C" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "D", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "D" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "E", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "E" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__argument_open_brace.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__argument_open_brace.snap deleted file mode 100644 index dd33c0eac3..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__argument_open_brace.snap +++ /dev/null @@ -1,61 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\usepackage{amsfonts}\n%SRC \\mathbb{\n%CUR ^\n%SRC Test\"#)?" ---- -[ - { - "documentation": "[documentation]", - "kind": 1, - "label": "A", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "A" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "B", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "B" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "C", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "C" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "D", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "D" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "E", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "E" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__argument_word.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__argument_word.snap deleted file mode 100644 index cf88ba4b2b..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__argument_word.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\usepackage{amsfonts}\n%SRC \\mathbb{A}\n%CUR ^\n%1.1 ^\"#)?" ---- -[ - { - "documentation": "[documentation]", - "kind": 1, - "label": "A", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "A" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__begin_environment_without_snippet_support.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__begin_environment_without_snippet_support.snap deleted file mode 100644 index 167e764aef..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__begin_environment_without_snippet_support.snap +++ /dev/null @@ -1,62 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\beg\n%CUR ^\n%1.1 ^^^\"#)?" ---- -[ - { - "detail": "built-in", - "kind": 1, - "label": "begin", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "begin" - } - }, - { - "detail": "built-in", - "kind": 1, - "label": "begingroup", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "begingroup" - } - }, - { - "detail": "built-in", - "kind": 1, - "label": "AtBeginDocument", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "AtBeginDocument" - } - }, - { - "detail": "built-in", - "kind": 1, - "label": "AtBeginDvi", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "AtBeginDvi" - } - }, - { - "detail": "â‹€, built-in", - "documentation": "[documentation]", - "kind": 1, - "label": "bigwedge", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "bigwedge" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__citation.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__citation.snap deleted file mode 100644 index 70453476d5..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__citation.snap +++ /dev/null @@ -1,31 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\documentclass{article}\n%SRC \\bibliography{main}\n%SRC \\begin{document}\n%SRC \\cite{\n%CUR ^\n%SRC \\end{document}\n\n%BIB main.bib\n%SRC @article{foo:2019,\n%SRC author = {Foo Bar},\n%SRC title = {Baz Qux},\n%SRC year = {2019},\n%SRC }\n%SRC \n%SRC @article{bar:2005,}\"#)?" ---- -[ - { - "data": "[data]", - "filterText": "bar:2005 @article bar:2005", - "kind": 1, - "label": "bar:2005", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "bar:2005" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "filterText": "foo:2019 @article foo:2019 author Foo Bar title Baz Qux year 2019", - "kind": 1, - "label": "foo:2019", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "foo:2019" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__citation_acronym.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__citation_acronym.snap deleted file mode 100644 index 5cf8260317..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__citation_acronym.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\addbibresource{main.bib}\n%SRC \\DeclareAcronym{foo}{cite={}}\n%CUR ^\n\n%BIB main.bib\n%SRC @article{foo,}\"#)?" ---- -[ - { - "data": "[data]", - "filterText": "foo @article foo", - "kind": 1, - "label": "foo", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "foo" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__citation_open_brace.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__citation_open_brace.snap deleted file mode 100644 index 3143481442..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__citation_open_brace.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\addbibresource{main.bib}\n%SRC \\cite{\n%CUR ^\n\n%BIB main.bib\n%SRC @article{foo,}\"#)?" ---- -[ - { - "data": "[data]", - "filterText": "foo @article foo", - "kind": 1, - "label": "foo", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "foo" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__citation_open_brace_multiple.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__citation_open_brace_multiple.snap deleted file mode 100644 index 21faa28ecc..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__citation_open_brace_multiple.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\addbibresource{main.bib}\n%SRC \\cite{foo,a\n%CUR ^\n%1.1 ^\n\n%BIB main.bib\n%SRC @article{foo,}\"#)?" ---- -[ - { - "data": "[data]", - "filterText": "foo @article foo", - "kind": 1, - "label": "foo", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "foo" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_model_definition_open_brace.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_model_definition_open_brace.snap deleted file mode 100644 index 825d607885..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_model_definition_open_brace.snap +++ /dev/null @@ -1,56 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\definecolor{foo}{\n%CUR ^\"#)?" ---- -[ - { - "kind": 1, - "label": "HTML", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "HTML" - } - }, - { - "kind": 1, - "label": "RGB", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "RGB" - } - }, - { - "kind": 1, - "label": "cmyk", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "cmyk" - } - }, - { - "kind": 1, - "label": "gray", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "gray" - } - }, - { - "kind": 1, - "label": "rgb", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "rgb" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_model_definition_set_open_brace.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_model_definition_set_open_brace.snap deleted file mode 100644 index 27dac7d130..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_model_definition_set_open_brace.snap +++ /dev/null @@ -1,56 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\definecolorset{\n%CUR ^\"#)?" ---- -[ - { - "kind": 1, - "label": "HTML", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "HTML" - } - }, - { - "kind": 1, - "label": "RGB", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "RGB" - } - }, - { - "kind": 1, - "label": "cmyk", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "cmyk" - } - }, - { - "kind": 1, - "label": "gray", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "gray" - } - }, - { - "kind": 1, - "label": "rgb", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "rgb" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_model_definition_set_simple.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_model_definition_set_simple.snap deleted file mode 100644 index c2a2640786..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_model_definition_set_simple.snap +++ /dev/null @@ -1,56 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\definecolorset{}\n%CUR ^\"#)?" ---- -[ - { - "kind": 1, - "label": "HTML", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "HTML" - } - }, - { - "kind": 1, - "label": "RGB", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "RGB" - } - }, - { - "kind": 1, - "label": "cmyk", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "cmyk" - } - }, - { - "kind": 1, - "label": "gray", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "gray" - } - }, - { - "kind": 1, - "label": "rgb", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "rgb" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_model_definition_simple.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_model_definition_simple.snap deleted file mode 100644 index da3431986d..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_model_definition_simple.snap +++ /dev/null @@ -1,56 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\definecolor{foo}{}\n%CUR ^\"#)?" ---- -[ - { - "kind": 1, - "label": "HTML", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "HTML" - } - }, - { - "kind": 1, - "label": "RGB", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "RGB" - } - }, - { - "kind": 1, - "label": "cmyk", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "cmyk" - } - }, - { - "kind": 1, - "label": "gray", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "gray" - } - }, - { - "kind": 1, - "label": "rgb", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "rgb" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_open_brace.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_open_brace.snap deleted file mode 100644 index f2ae7d8db0..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_open_brace.snap +++ /dev/null @@ -1,56 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\color{\n%CUR ^\"#)?" ---- -[ - { - "kind": 1, - "label": "Apricot", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "Apricot" - } - }, - { - "kind": 1, - "label": "Aquamarine", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "Aquamarine" - } - }, - { - "kind": 1, - "label": "Bittersweet", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "Bittersweet" - } - }, - { - "kind": 1, - "label": "Black", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "Black" - } - }, - { - "kind": 1, - "label": "Blue", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "Blue" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_simple.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_simple.snap deleted file mode 100644 index fc3db2911b..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_simple.snap +++ /dev/null @@ -1,56 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\color{}\n%CUR ^\"#)?" ---- -[ - { - "kind": 1, - "label": "Apricot", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "Apricot" - } - }, - { - "kind": 1, - "label": "Aquamarine", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "Aquamarine" - } - }, - { - "kind": 1, - "label": "Bittersweet", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "Bittersweet" - } - }, - { - "kind": 1, - "label": "Black", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "Black" - } - }, - { - "kind": 1, - "label": "Blue", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "Blue" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_word.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_word.snap deleted file mode 100644 index cd671de9b9..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__color_word.snap +++ /dev/null @@ -1,56 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\color{re}\n%CUR ^\n%1.1 ^^\"#)?" ---- -[ - { - "kind": 1, - "label": "red", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "red" - } - }, - { - "kind": 1, - "label": "Red", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "Red" - } - }, - { - "kind": 1, - "label": "RedOrange", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "RedOrange" - } - }, - { - "kind": 1, - "label": "RedViolet", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "RedViolet" - } - }, - { - "kind": 1, - "label": "BrickRed", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "BrickRed" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_command_bibtex.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_command_bibtex.snap deleted file mode 100644 index 76dd1d07f8..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_command_bibtex.snap +++ /dev/null @@ -1,61 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%BIB main.bib\n%SRC @article{b, \n%SRC c = {\\LaT }\n%CUR ^\n%1.1 ^^^\n%SRC }\"#)?" ---- -[ - { - "detail": "built-in", - "kind": 1, - "label": "LaTeX", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "LaTeX" - } - }, - { - "detail": "built-in", - "kind": 1, - "label": "LaTeXe", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "LaTeXe" - } - }, - { - "detail": "built-in", - "kind": 1, - "label": "latexreleaseversion", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "latexreleaseversion" - } - }, - { - "detail": "built-in", - "kind": 1, - "label": "LastDeclaredEncoding", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "LastDeclaredEncoding" - } - }, - { - "detail": "built-in", - "kind": 1, - "label": "last", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "last" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_command_simple.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_command_simple.snap deleted file mode 100644 index c974de42b7..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_command_simple.snap +++ /dev/null @@ -1,63 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\\n%CUR ^\"#)?" ---- -[ - { - "detail": "built-in", - "kind": 1, - "label": "!", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "!" - } - }, - { - "detail": "built-in", - "documentation": "[documentation]", - "kind": 1, - "label": "\"", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "\"" - } - }, - { - "detail": "built-in", - "kind": 1, - "label": "#", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "#" - } - }, - { - "detail": "$, built-in", - "documentation": "[documentation]", - "kind": 1, - "label": "$", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "$" - } - }, - { - "detail": "built-in", - "kind": 1, - "label": "%", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "%" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_command_simple_package.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_command_simple_package.snap deleted file mode 100644 index ada70e293a..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_command_simple_package.snap +++ /dev/null @@ -1,61 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\usepackage{lipsum}\n%SRC \\lips\n%CUR ^\n%1.1 ^^^^\"#)?" ---- -[ - { - "detail": "lipsum.sty", - "kind": 1, - "label": "lipsum", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lipsum" - } - }, - { - "detail": "lipsum.sty", - "kind": 1, - "label": "lipsumexp", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lipsumexp" - } - }, - { - "detail": "lipsum.sty", - "kind": 1, - "label": "LipsumPar", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "LipsumPar" - } - }, - { - "detail": "lipsum.sty", - "kind": 1, - "label": "LipsumProtect", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "LipsumProtect" - } - }, - { - "detail": "lipsum.sty", - "kind": 1, - "label": "LipsumRestoreAll", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "LipsumRestoreAll" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_environment_class.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_environment_class.snap deleted file mode 100644 index bb409a442b..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_environment_class.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\documentclass{article}\n%SRC \\begin{thein}\n%CUR ^\n%1.1 ^^^^^\"#)?" ---- -[ - { - "detail": "article.cls", - "kind": 1, - "label": "theindex", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "theindex" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_environment_command_definition.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_environment_command_definition.snap deleted file mode 100644 index d319eeb734..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_environment_command_definition.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\newcommand{\\foo}{\\begin{doc}\n%CUR ^\n%1.1 ^^^\"#)?" ---- -[ - { - "detail": "built-in", - "kind": 1, - "label": "document", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "document" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_environment_simple.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_environment_simple.snap deleted file mode 100644 index f6b8710db3..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_environment_simple.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\begin{doc\n%CUR ^\n%1.1 ^^^\"#)?" ---- -[ - { - "detail": "built-in", - "kind": 1, - "label": "document", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "document" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_environment_simple_end.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_environment_simple_end.snap deleted file mode 100644 index e3ffa551d3..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__component_environment_simple_end.snap +++ /dev/null @@ -1,61 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\begin{document}\n%SRC \\end{\n%CUR ^\"#)?" ---- -[ - { - "detail": "built-in", - "kind": 1, - "label": "document", - "preselect": true, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "document" - } - }, - { - "detail": "built-in", - "kind": 1, - "label": "abstract", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "abstract" - } - }, - { - "detail": "built-in", - "kind": 1, - "label": "array", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "array" - } - }, - { - "detail": "built-in", - "kind": 1, - "label": "center", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "center" - } - }, - { - "detail": "built-in", - "kind": 1, - "label": "csname", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "csname" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_after_preamble.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_after_preamble.snap deleted file mode 100644 index 5f29c307a7..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_after_preamble.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%BIB main.bib\n%SRC @preamble{\n%CUR ^\n%1.1 ^^^^^^^^\"#)?" ---- -[ - { - "kind": 1, - "label": "preamble", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "preamble" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_after_string.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_after_string.snap deleted file mode 100644 index 5b18f17cfe..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_after_string.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%BIB main.bib\n%SRC @string{\n%CUR ^\n%1.1 ^^^^^^\"#)?" ---- -[ - { - "kind": 1, - "label": "string", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "string" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_at_empty.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_at_empty.snap deleted file mode 100644 index 7928676b92..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_at_empty.snap +++ /dev/null @@ -1,61 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%BIB main.bib\n%SRC @\n%CUR ^\"#)?" ---- -[ - { - "documentation": "[documentation]", - "kind": 1, - "label": "article", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "article" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "artwork", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "artwork" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "audio", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "audio" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "bibnote", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "bibnote" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "book", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "book" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_before_article.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_before_article.snap deleted file mode 100644 index 1522a7594a..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_before_article.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%BIB main.bib\n%SRC @article\n%CUR ^\n%1.1 ^^^^^^^\"#)?" ---- -[ - { - "documentation": "[documentation]", - "kind": 1, - "label": "article", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "article" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_before_preamble.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_before_preamble.snap deleted file mode 100644 index 50e7a2162d..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_before_preamble.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%BIB main.bib\n%SRC @preamble\n%CUR ^\n%1.1 ^^^^^^^^\"#)?" ---- -[ - { - "kind": 1, - "label": "preamble", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "preamble" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_before_string.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_before_string.snap deleted file mode 100644 index 0c00ddd5fc..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_before_string.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%BIB main.bib\n%SRC @string\n%CUR ^\n%1.1 ^^^^^^\"#)?" ---- -[ - { - "kind": 1, - "label": "string", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "string" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_complete_entry.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_complete_entry.snap deleted file mode 100644 index 6afb028f95..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__entry_type_complete_entry.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%BIB main.bib\n%SRC @article{foo, author = {foo}}\n%CUR ^\n%1.1 ^^^^^^^\"#)?" ---- -[ - { - "documentation": "[documentation]", - "kind": 1, - "label": "article", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "article" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__field_empty_entry_closed.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__field_empty_entry_closed.snap deleted file mode 100644 index 86a6e06c89..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__field_empty_entry_closed.snap +++ /dev/null @@ -1,61 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%BIB main.bib\n%SRC @article{foo,}\n%CUR ^\"#)?" ---- -[ - { - "documentation": "[documentation]", - "kind": 1, - "label": "abstract", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "abstract" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "addendum", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "addendum" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "address", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "address" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "afterword", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "afterword" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "annotation", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "annotation" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__field_empty_entry_open.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__field_empty_entry_open.snap deleted file mode 100644 index 75a242d25d..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__field_empty_entry_open.snap +++ /dev/null @@ -1,61 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%BIB main.bib\n%SRC @article{foo,\n%CUR ^\"#)?" ---- -[ - { - "documentation": "[documentation]", - "kind": 1, - "label": "abstract", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "abstract" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "addendum", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "addendum" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "address", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "address" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "afterword", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "afterword" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "annotation", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "annotation" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__field_entry_field_name.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__field_entry_field_name.snap deleted file mode 100644 index 3178da8d07..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__field_entry_field_name.snap +++ /dev/null @@ -1,61 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%BIB main.bib\n%SRC @article{foo, a\n%CUR ^\n%1.1 ^\"#)?" ---- -[ - { - "documentation": "[documentation]", - "kind": 1, - "label": "abstract", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "abstract" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "addendum", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "addendum" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "address", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "address" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "afterword", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "afterword" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "annotation", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "annotation" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__field_entry_two_fields_name_closed.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__field_entry_two_fields_name_closed.snap deleted file mode 100644 index 80595edf98..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__field_entry_two_fields_name_closed.snap +++ /dev/null @@ -1,61 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%BIB main.bib\n%SRC @article{foo, author = bar, edit}\n%CUR ^\n%1.1 ^^^^\"#)?" ---- -[ - { - "documentation": "[documentation]", - "kind": 1, - "label": "edition", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "edition" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "editor", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "editor" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "editora", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "editora" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "editoratype", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "editoratype" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "editorb", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "editorb" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__field_entry_two_fields_name_open.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__field_entry_two_fields_name_open.snap deleted file mode 100644 index 8de75313e8..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__field_entry_two_fields_name_open.snap +++ /dev/null @@ -1,61 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%BIB main.bib\n%SRC @article{foo, author = bar, edit\n%CUR ^\n%1.1 ^^^^\"#)?" ---- -[ - { - "documentation": "[documentation]", - "kind": 1, - "label": "edition", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "edition" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "editor", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "editor" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "editora", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "editora" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "editoratype", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "editoratype" - } - }, - { - "documentation": "[documentation]", - "kind": 1, - "label": "editorb", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "editorb" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__glossary_ref_open_brace.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__glossary_ref_open_brace.snap deleted file mode 100644 index 36a77e92e5..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__glossary_ref_open_brace.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second}\n%SRC \\gls{f\n%CUR ^\n%1.1 ^\"#)?" ---- -[ - { - "kind": 1, - "label": "fpsLabel", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "fpsLabel" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__glossary_ref_simple.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__glossary_ref_simple.snap deleted file mode 100644 index 7a4d9a584b..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__glossary_ref_simple.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\newacronym[longplural={Frames per Second}]{fpsLabel}{FPS}{Frame per Second}\n%SRC \\gls{f}\n%CUR ^\n%1.1 ^\"#)?" ---- -[ - { - "kind": 1, - "label": "fpsLabel", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "fpsLabel" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__import_class_closed_brace.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__import_class_closed_brace.snap deleted file mode 100644 index f346f67f41..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__import_class_closed_brace.snap +++ /dev/null @@ -1,66 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\documentclass{art}\n%CUR ^\n%1.1 ^^^\"#)?" ---- -[ - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "article", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "article" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "articleingud", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "articleingud" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "articoletteracdp", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "articoletteracdp" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "artikel1", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "artikel1" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "artikel2", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "artikel2" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__import_class_open_brace.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__import_class_open_brace.snap deleted file mode 100644 index 0d236ae496..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__import_class_open_brace.snap +++ /dev/null @@ -1,66 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\documentclass{art \\foo\n%CUR ^\n%1.1 ^^^\"#)?" ---- -[ - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "article", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "article" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "articleingud", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "articleingud" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "articoletteracdp", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "articoletteracdp" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "artikel1", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "artikel1" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "artikel2", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "artikel2" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__import_package_closed_brace.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__import_package_closed_brace.snap deleted file mode 100644 index 2952c5d401..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__import_package_closed_brace.snap +++ /dev/null @@ -1,66 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\usepackage{lips}\n%CUR ^\n%1.1 ^^^^\"#)?" ---- -[ - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "lips", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lips" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "lipsum", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lipsum" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "lisp-simple-alloc", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lisp-simple-alloc" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "lisp-string", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lisp-string" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "lwarp-lips", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lwarp-lips" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__import_package_open_brace.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__import_package_open_brace.snap deleted file mode 100644 index 349830d5f2..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__import_package_open_brace.snap +++ /dev/null @@ -1,66 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\usepackage{lips\n%CUR ^\n%1.1 ^^^^\"#)?" ---- -[ - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "lips", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lips" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "lipsum", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lipsum" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "lisp-simple-alloc", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lisp-simple-alloc" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "lisp-string", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lisp-string" - } - }, - { - "data": "[data]", - "documentation": "[documentation]", - "kind": 1, - "label": "lwarp-lips", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lwarp-lips" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__label.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__label.snap deleted file mode 100644 index a4b26aa41d..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__label.snap +++ /dev/null @@ -1,67 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX foo.tex\n%SRC \\documentclass{article}\n%SRC \n%SRC \\usepackage{amsmath}\n%SRC \\usepackage{caption}\n%SRC \\usepackage{amsthm}\n%SRC \\newtheorem{lemma}{Lemma}\n%SRC \n%SRC \\begin{document}\n%SRC \n%SRC \\section{Foo}%\n%SRC \\label{sec:foo}\n%SRC \n%SRC \\begin{equation}%\n%SRC \\label{eq:foo}\n%SRC 1 + 1 = 2\n%SRC \\end{equation}\n%SRC \n%SRC \\begin{equation}%\n%SRC \\label{eq:bar}\n%SRC 1 + 1 = 2\n%SRC \\end{equation}\n%SRC \n%SRC \\begin{figure}%\n%SRC \\LaTeX{}\n%SRC \\caption{Baz}%\n%SRC \\label{fig:baz}\n%SRC \\end{figure}\n%SRC \n%SRC \\begin{lemma}%\n%SRC \\label{thm:foo}\n%SRC 1 + 1 = 2\n%SRC \\end{lemma}\n%SRC \n%SRC \\include{bar}\n%SRC \n%SRC \\end{document}\n\n%TEX bar.tex\n%SRC \\section{Bar}%\n%SRC \\label{sec:bar}\n%SRC \n%SRC Lorem ipsum dolor sit amet.\n%SRC \\ref{}\n%CUR ^\n\n%TEX foo.aux\n%SRC \\relax\n%SRC \\@writefile{lof}{\\contentsline {figure}{\\numberline {1}{\\ignorespaces Baz\\relax }}{1}\\protected@file@percent }\n%SRC \\providecommand*\\caption@xref[2]{\\@setref\\relax\\@undefined{#1}}\n%SRC \\newlabel{fig:baz}{{1}{1}}\n%SRC \\@writefile{toc}{\\contentsline {section}{\\numberline {1}Foo}{1}\\protected@file@percent }\n%SRC \\newlabel{sec:foo}{{1}{1}}\n%SRC \\newlabel{eq:foo}{{1}{1}}\n%SRC \\newlabel{eq:bar}{{2}{1}}\n%SRC \\newlabel{thm:foo}{{1}{1}}\n%SRC \\@input{bar.aux}\"#)?" ---- -[ - { - "detail": "Equation (2)", - "filterText": "eq:bar Equation (2)", - "kind": 1, - "label": "eq:bar", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "eq:bar" - } - }, - { - "detail": "Equation (1)", - "filterText": "eq:foo Equation (1)", - "kind": 1, - "label": "eq:foo", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "eq:foo" - } - }, - { - "detail": "Figure 1", - "documentation": "[documentation]", - "filterText": "fig:baz Figure 1: Baz", - "kind": 1, - "label": "fig:baz", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "fig:baz" - } - }, - { - "detail": "Section (Bar)", - "filterText": "sec:bar Section (Bar)", - "kind": 1, - "label": "sec:bar", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "sec:bar" - } - }, - { - "detail": "Section 1 (Foo)", - "filterText": "sec:foo Section 1 (Foo)", - "kind": 1, - "label": "sec:foo", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "sec:foo" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__project_resolution_import.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__project_resolution_import.snap deleted file mode 100644 index 5ee9c3c207..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__project_resolution_import.snap +++ /dev/null @@ -1,61 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\documentclass{article}\n%SRC \\import{sub}{sub/sub.tex}\n%SRC \\lipsu\n%CUR ^\n%1.1 ^^^^^\n\n%TEX sub/sub.tex\n%SRC \\input{child.tex}\n\n%TEX sub/child.tex\n%SRC \\usepackage{lipsum}\n\n\"#)" ---- -[ - { - "detail": "lipsum.sty", - "kind": 1, - "label": "lipsum", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lipsum" - } - }, - { - "detail": "lipsum.sty", - "kind": 1, - "label": "lipsumexp", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lipsumexp" - } - }, - { - "detail": "lipsum.sty", - "kind": 1, - "label": "LipsumPar", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "LipsumPar" - } - }, - { - "detail": "lipsum.sty", - "kind": 1, - "label": "LipsumProtect", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "LipsumProtect" - } - }, - { - "detail": "lipsum.sty", - "kind": 1, - "label": "LipsumRestoreAll", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "LipsumRestoreAll" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__project_resolution_texlabroot.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__project_resolution_texlabroot.snap deleted file mode 100644 index ecf093e33c..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__project_resolution_texlabroot.snap +++ /dev/null @@ -1,61 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX src/main.tex\n%SRC \\documentclass{article}\n%SRC \\include{src/foo}\n%SRC \\lipsu\n%CUR ^\n%1.1 ^^^^^\n\n%TEX src/foo.tex\n%SRC \\include{src/bar}\n\n%TEX src/bar.tex\n%SRC \\usepackage{lipsum}\n\n%ROOT .texlabroot\n\"#)" ---- -[ - { - "detail": "lipsum.sty", - "kind": 1, - "label": "lipsum", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lipsum" - } - }, - { - "detail": "lipsum.sty", - "kind": 1, - "label": "lipsumexp", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lipsumexp" - } - }, - { - "detail": "lipsum.sty", - "kind": 1, - "label": "LipsumPar", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "LipsumPar" - } - }, - { - "detail": "lipsum.sty", - "kind": 1, - "label": "LipsumProtect", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "LipsumProtect" - } - }, - { - "detail": "lipsum.sty", - "kind": 1, - "label": "LipsumRestoreAll", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "LipsumRestoreAll" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__theorem_begin.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__theorem_begin.snap deleted file mode 100644 index a4de708b1b..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__theorem_begin.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\newtheorem{lemma}{Lemma}\n%SRC \\begin{lem \n%CUR ^\n%1.1 ^^^\"#)?" ---- -[ - { - "detail": "user-defined", - "kind": 1, - "label": "lemma", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lemma" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__theorem_end.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__theorem_end.snap deleted file mode 100644 index 0c2c20083e..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__theorem_end.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\newtheorem{lemma}{Lemma}\n%SRC \\begin{}\n%SRC \\end{lem\n%CUR ^\n%1.1 ^^^\"#)?" ---- -[ - { - "detail": "user-defined", - "kind": 1, - "label": "lemma", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "lemma" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__tikz_library_closed_brace.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__tikz_library_closed_brace.snap deleted file mode 100644 index f2a00d22bb..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__tikz_library_closed_brace.snap +++ /dev/null @@ -1,56 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\usepgflibrary{}\n%CUR ^\"#)?" ---- -[ - { - "kind": 1, - "label": "arrows", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "arrows" - } - }, - { - "kind": 1, - "label": "arrows.meta", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "arrows.meta" - } - }, - { - "kind": 1, - "label": "arrows.spaced", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "arrows.spaced" - } - }, - { - "kind": 1, - "label": "curvilinear", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "curvilinear" - } - }, - { - "kind": 1, - "label": "datavisualization.barcharts", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "datavisualization.barcharts" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__tikz_library_open_brace.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__tikz_library_open_brace.snap deleted file mode 100644 index 62bb3729b7..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__tikz_library_open_brace.snap +++ /dev/null @@ -1,56 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\usepgflibrary{\n%CUR ^\"#)?" ---- -[ - { - "kind": 1, - "label": "arrows", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "arrows" - } - }, - { - "kind": 1, - "label": "arrows.meta", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "arrows.meta" - } - }, - { - "kind": 1, - "label": "arrows.spaced", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "arrows.spaced" - } - }, - { - "kind": 1, - "label": "curvilinear", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "curvilinear" - } - }, - { - "kind": 1, - "label": "datavisualization.barcharts", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "datavisualization.barcharts" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__user_command.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__user_command.snap deleted file mode 100644 index fe0a397706..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__user_command.snap +++ /dev/null @@ -1,17 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\foobar\n%SRC \\fooba\n%CUR ^\n%1.1 ^^^^^\n%SRC \\begin{foo}\n%SRC \\end{foo}\n%SRC \\begin{fo}\n\"#)?" ---- -[ - { - "detail": "user-defined", - "kind": 1, - "label": "foobar", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "foobar" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__user_environment.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__user_environment.snap deleted file mode 100644 index 7230e9a951..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__completion__user_environment.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/tests/text_document/completion.rs -expression: "complete(r#\"\n%TEX main.tex\n%SRC \\foobar\n%SRC \\fooba\n%SRC \\begin{foo}\n%SRC \\end{foo}\n%SRC \\begin{fo}\n%CUR ^\n%1.1 ^^\n\"#)?" ---- -[ - { - "detail": "user-defined", - "kind": 1, - "label": "foo", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "foo" - } - }, - { - "detail": "built-in", - "kind": 1, - "label": "filecontents", - "preselect": false, - "sortText": "[sortText]", - "textEdit": { - "range": "[range]", - "newText": "filecontents" - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__did_change_configuration__invalid_configuration.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__did_change_configuration__invalid_configuration.snap deleted file mode 100644 index 1400d80167..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__did_change_configuration__invalid_configuration.snap +++ /dev/null @@ -1,9 +0,0 @@ ---- -source: src/tests/text_document/did_change_configuration.rs -expression: message ---- -The texlab configuration is invalid; using the default settings instead. -Details: regex parse error: - \ - ^ -error: incomplete escape sequence, reached end of pattern prematurely diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__enumerate_flat.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__enumerate_flat.snap deleted file mode 100644 index 4c5a17fb98..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__enumerate_flat.snap +++ /dev/null @@ -1,96 +0,0 @@ ---- -source: src/tests/text_document/document_symbol.rs -expression: result.response ---- -[ - { - "name": "Enumerate", - "kind": 10, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 4, - "character": 0 - }, - "end": { - "line": 9, - "character": 15 - } - } - } - }, - { - "name": "Item", - "kind": 22, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 5, - "character": 4 - }, - "end": { - "line": 5, - "character": 27 - } - } - } - }, - { - "name": "Item", - "kind": 22, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 6, - "character": 4 - }, - "end": { - "line": 6, - "character": 27 - } - } - } - }, - { - "name": "Baz", - "kind": 22, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 7, - "character": 4 - }, - "end": { - "line": 7, - "character": 18 - } - } - } - }, - { - "name": "Qux", - "kind": 22, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 8, - "character": 4 - }, - "end": { - "line": 8, - "character": 32 - } - } - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__enumerate_nested.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__enumerate_nested.snap deleted file mode 100644 index 630311f32e..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__enumerate_nested.snap +++ /dev/null @@ -1,140 +0,0 @@ ---- -source: src/tests/text_document/document_symbol.rs -expression: result.response ---- -[ - { - "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": "Item", - "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": "Qux", - "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/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__equation_flat.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__equation_flat.snap deleted file mode 100644 index 24ab44c772..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__equation_flat.snap +++ /dev/null @@ -1,60 +0,0 @@ ---- -source: src/tests/text_document/document_symbol.rs -expression: result.response ---- -[ - { - "name": "Equation", - "kind": 14, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 4, - "character": 0 - }, - "end": { - "line": 6, - "character": 14 - } - } - } - }, - { - "name": "Equation", - "kind": 14, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 8, - "character": 0 - }, - "end": { - "line": 10, - "character": 14 - } - } - } - }, - { - "name": "Equation", - "kind": 14, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 12, - "character": 0 - }, - "end": { - "line": 14, - "character": 14 - } - } - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__equation_nested.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__equation_nested.snap deleted file mode 100644 index 2efe7a4796..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__equation_nested.snap +++ /dev/null @@ -1,86 +0,0 @@ ---- -source: src/tests/text_document/document_symbol.rs -expression: result.response ---- -[ - { - "name": "Equation", - "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/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__float_flat.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__float_flat.snap deleted file mode 100644 index 3d2537d85b..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__float_flat.snap +++ /dev/null @@ -1,60 +0,0 @@ ---- -source: src/tests/text_document/document_symbol.rs -expression: result.response ---- -[ - { - "name": "Figure: Foo", - "kind": 6, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 4, - "character": 0 - }, - "end": { - "line": 7, - "character": 12 - } - } - } - }, - { - "name": "Figure: Bar", - "kind": 6, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 9, - "character": 0 - }, - "end": { - "line": 12, - "character": 12 - } - } - } - }, - { - "name": "Figure: Baz", - "kind": 6, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 14, - "character": 0 - }, - "end": { - "line": 17, - "character": 12 - } - } - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__float_nested.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__float_nested.snap deleted file mode 100644 index 18c5f3ca93..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__float_nested.snap +++ /dev/null @@ -1,86 +0,0 @@ ---- -source: src/tests/text_document/document_symbol.rs -expression: result.response ---- -[ - { - "name": "Figure: 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/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__section_flat.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__section_flat.snap deleted file mode 100644 index 87ff442db1..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__section_flat.snap +++ /dev/null @@ -1,60 +0,0 @@ ---- -source: src/tests/text_document/document_symbol.rs -expression: result.response ---- -[ - { - "name": "Foo", - "kind": 2, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 4, - "character": 0 - }, - "end": { - "line": 4, - "character": 13 - } - } - } - }, - { - "name": "Bar", - "kind": 2, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 6, - "character": 0 - }, - "end": { - "line": 8, - "character": 31 - } - } - } - }, - { - "name": "Baz", - "kind": 2, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 8, - "character": 0 - }, - "end": { - "line": 8, - "character": 31 - } - } - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__section_nested.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__section_nested.snap deleted file mode 100644 index bf4fea547e..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__section_nested.snap +++ /dev/null @@ -1,87 +0,0 @@ ---- -source: src/tests/text_document/document_symbol.rs -expression: result.response ---- -[ - { - "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": "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/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__theorem_flat.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__theorem_flat.snap deleted file mode 100644 index d033c3ca62..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__theorem_flat.snap +++ /dev/null @@ -1,78 +0,0 @@ ---- -source: src/tests/text_document/document_symbol.rs -expression: result.response ---- -[ - { - "name": "Lemma (Foo)", - "kind": 13, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 6, - "character": 0 - }, - "end": { - "line": 8, - "character": 11 - } - } - } - }, - { - "name": "Lemma", - "kind": 13, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 10, - "character": 0 - }, - "end": { - "line": 12, - "character": 11 - } - } - } - }, - { - "name": "Lemma", - "kind": 13, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 14, - "character": 0 - }, - "end": { - "line": 16, - "character": 11 - } - } - } - }, - { - "name": "Lemma (Qux)", - "kind": 13, - "deprecated": false, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 18, - "character": 0 - }, - "end": { - "line": 20, - "character": 11 - } - } - } - } -] diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__theorem_nested.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__theorem_nested.snap deleted file mode 100644 index 22844dd700..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__document_symbol__theorem_nested.snap +++ /dev/null @@ -1,113 +0,0 @@ ---- -source: src/tests/text_document/document_symbol.rs -expression: result.response ---- -[ - { - "name": "Lemma (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", - "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/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_command.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_command.snap deleted file mode 100644 index c7d1491245..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_command.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: src/tests/text_document/formatting.rs -expression: "format(r#\"\n%BIB main.bib\n%SRC @article{foo, bar = \"\\baz\",}\"#)?" ---- -@article{foo, - bar = "\baz", -} - diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_insert_braces.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_insert_braces.snap deleted file mode 100644 index d05b077188..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_insert_braces.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: src/tests/text_document/formatting.rs -expression: "format(r#\"\n%BIB main.bib\n%SRC @article{foo, bar = baz,\"#)?" ---- -@article{foo, - bar = baz, -} diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_join_strings.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_join_strings.snap deleted file mode 100644 index 8fb3765129..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_join_strings.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: src/tests/text_document/formatting.rs -expression: "format(r#\"\n%BIB main.bib\n%SRC @article{foo, bar = \"baz\" # \"qux\"}\"#)?" ---- -@article{foo, - bar = "baz" # "qux", -} - diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_multiple_entries.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_multiple_entries.snap deleted file mode 100644 index 2496f9b5e5..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_multiple_entries.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: src/tests/text_document/formatting.rs -expression: "format(r#\"\n%BIB main.bib\n%SRC @article{foo, bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, \n%SRC consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.},}\n%SRC \n%SRC @article{foo, bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, \n%SRC 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.}, -} - -@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/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_parens.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_parens.snap deleted file mode 100644 index 883b97b375..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_parens.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: src/tests/text_document/formatting.rs -expression: "format(r#\"\n%BIB main.bib\n%SRC @article(foo,)\"#)?" ---- -@article{foo, -} - diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_preamble.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_preamble.snap deleted file mode 100644 index fdac219c35..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_preamble.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/tests/text_document/formatting.rs -expression: "format(r#\"\n%BIB main.bib\n%SRC @preamble{\n%SRC \"foo bar baz\" }\"#)?" ---- -@preamble{"foo bar baz"} - diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_string.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_string.snap deleted file mode 100644 index 8f9589773e..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_string.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/tests/text_document/formatting.rs -expression: "format(r#\"\n%BIB main.bib\n%SRC @string{foo=\"bar\"}\"#)?" ---- -@string{foo = "bar"} - diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_trailing_comma.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_trailing_comma.snap deleted file mode 100644 index 1051e00cf3..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_trailing_comma.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: src/tests/text_document/formatting.rs -expression: "format(r#\"\n%BIB main.bib\n%SRC @article{foo, bar = baz}\"#)?" ---- -@article{foo, - bar = baz, -} - diff --git a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_wrap_long_lines.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_wrap_long_lines.snap deleted file mode 100644 index e7e1f39386..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__formatting__bibtex_internal_wrap_long_lines.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: src/tests/text_document/formatting.rs -expression: "format(r#\"\n%BIB main.bib\n%SRC @article{foo, bar = {Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n%SRC Lorem ipsum dolor sit amet,\n%SRC 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/src/tests/text_document/snapshots/texlab__tests__text_document__inlay_hint__label_definition.snap b/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__inlay_hint__label_definition.snap deleted file mode 100644 index ff04d65efb..0000000000 --- a/support/texlab/src/tests/text_document/snapshots/texlab__tests__text_document__inlay_hint__label_definition.snap +++ /dev/null @@ -1,38 +0,0 @@ ---- -source: src/tests/text_document/inlay_hint.rs -expression: "check(r#\"\n%TEX main.tex\n%SRC \\documentclass{article}\n%SRC \\usepackage{caption}\n%SRC \\begin{document}\n%SRC \\section{Foo}\\label{sec:foo}\n%SRC \\section{Bar}\\label{sec:bar}\n%SRC \\subsection{Baz}\\label{sec:baz}\n%SRC \\begin{figure}\n%SRC Test\n%SRC \\label{fig:qux}\n%SRC \\caption{Qux}\n%SRC \\end{figure}\n%SRC \\end{document}\n\n%TEX main.aux\n%SRC \\relax \n%SRC \\providecommand*\\caption@xref[2]{\\@setref\\relax\\@undefined{#1}}\n%SRC \\newlabel{fig:qux}{{\\caption@xref {fig:qux}{ on input line 15}}{1}}\n%SRC \\@writefile{lof}{\\contentsline {figure}{\\numberline {1}{\\ignorespaces Qux\\relax }}{1}{}\\protected@file@percent }\n%SRC \\@writefile{toc}{\\contentsline {section}{\\numberline {1}Foo}{1}{}\\protected@file@percent }\n%SRC \\newlabel{sec:foo}{{1}{1}}\n%SRC \\@writefile{toc}{\\contentsline {section}{\\numberline {2}Bar}{1}{}\\protected@file@percent }\n%SRC \\newlabel{sec:bar}{{2}{1}}\n%SRC \\@writefile{toc}{\\contentsline {subsection}{\\numberline {2.1}Baz}{1}{}\\protected@file@percent }\n%SRC \\newlabel{sec:baz}{{2.1}{1}}\n%SRC \\gdef \\@abspage@last{1}\n\"#)?" ---- -[ - { - "position": { - "line": 3, - "character": 27 - }, - "label": "Section 1 (Foo)", - "paddingLeft": true - }, - { - "position": { - "line": 4, - "character": 27 - }, - "label": "Section 2 (Bar)", - "paddingLeft": true - }, - { - "position": { - "line": 5, - "character": 30 - }, - "label": "Subsection 2.1 (Baz)", - "paddingLeft": true - }, - { - "position": { - "line": 8, - "character": 18 - }, - "label": "Figure fig:qux: Qux", - "paddingLeft": true - } -] diff --git a/support/texlab/src/tests/workspace.rs b/support/texlab/src/tests/workspace.rs deleted file mode 100644 index 15e0679dea..0000000000 --- a/support/texlab/src/tests/workspace.rs +++ /dev/null @@ -1 +0,0 @@ -mod symbol; diff --git a/support/texlab/src/tests/workspace/snapshots/texlab__tests__workspace__symbol__filter_bibtex.snap b/support/texlab/src/tests/workspace/snapshots/texlab__tests__workspace__symbol__filter_bibtex.snap deleted file mode 100644 index 16963641bf..0000000000 --- a/support/texlab/src/tests/workspace/snapshots/texlab__tests__workspace__symbol__filter_bibtex.snap +++ /dev/null @@ -1,42 +0,0 @@ ---- -source: src/tests/workspace/symbol.rs -expression: result.actual_symbols ---- -[ - { - "deprecated": false, - "kind": 24, - "location": { - "uri": "[tmp]/main.bib", - "range": { - "start": { - "line": 0, - "character": 0 - }, - "end": { - "line": 0, - "character": 14 - } - } - }, - "name": "foo" - }, - { - "deprecated": false, - "kind": 15, - "location": { - "uri": "[tmp]/main.bib", - "range": { - "start": { - "line": 2, - "character": 0 - }, - "end": { - "line": 2, - "character": 20 - } - } - }, - "name": "bar" - } -] diff --git a/support/texlab/src/tests/workspace/snapshots/texlab__tests__workspace__symbol__filter_type_figure.snap b/support/texlab/src/tests/workspace/snapshots/texlab__tests__workspace__symbol__filter_type_figure.snap deleted file mode 100644 index 1b1d2371a4..0000000000 --- a/support/texlab/src/tests/workspace/snapshots/texlab__tests__workspace__symbol__filter_type_figure.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: src/tests/workspace/symbol.rs -expression: result.actual_symbols ---- -[ - { - "deprecated": false, - "kind": 6, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 15, - "character": 0 - }, - "end": { - "line": 19, - "character": 12 - } - } - }, - "name": "Figure 1: Bar" - } -] diff --git a/support/texlab/src/tests/workspace/snapshots/texlab__tests__workspace__symbol__filter_type_item.snap b/support/texlab/src/tests/workspace/snapshots/texlab__tests__workspace__symbol__filter_type_item.snap deleted file mode 100644 index ed45c13cf1..0000000000 --- a/support/texlab/src/tests/workspace/snapshots/texlab__tests__workspace__symbol__filter_type_item.snap +++ /dev/null @@ -1,60 +0,0 @@ ---- -source: src/tests/workspace/symbol.rs -expression: result.actual_symbols ---- -[ - { - "deprecated": false, - "kind": 22, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 24, - "character": 4 - }, - "end": { - "line": 24, - "character": 28 - } - } - }, - "name": "1" - }, - { - "deprecated": false, - "kind": 22, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 25, - "character": 4 - }, - "end": { - "line": 25, - "character": 28 - } - } - }, - "name": "2" - }, - { - "deprecated": false, - "kind": 22, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 26, - "character": 4 - }, - "end": { - "line": 26, - "character": 28 - } - } - }, - "name": "3" - } -] diff --git a/support/texlab/src/tests/workspace/snapshots/texlab__tests__workspace__symbol__filter_type_math.snap b/support/texlab/src/tests/workspace/snapshots/texlab__tests__workspace__symbol__filter_type_math.snap deleted file mode 100644 index d4cea99cc5..0000000000 --- a/support/texlab/src/tests/workspace/snapshots/texlab__tests__workspace__symbol__filter_type_math.snap +++ /dev/null @@ -1,42 +0,0 @@ ---- -source: src/tests/workspace/symbol.rs -expression: result.actual_symbols ---- -[ - { - "deprecated": false, - "kind": 14, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 9, - "character": 0 - }, - "end": { - "line": 11, - "character": 14 - } - } - }, - "name": "Equation (1)" - }, - { - "deprecated": false, - "kind": 13, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 33, - "character": 0 - }, - "end": { - "line": 35, - "character": 11 - } - } - }, - "name": "Lemma 1 (Qux)" - } -] diff --git a/support/texlab/src/tests/workspace/snapshots/texlab__tests__workspace__symbol__filter_type_section.snap b/support/texlab/src/tests/workspace/snapshots/texlab__tests__workspace__symbol__filter_type_section.snap deleted file mode 100644 index 3a3ef78ab2..0000000000 --- a/support/texlab/src/tests/workspace/snapshots/texlab__tests__workspace__symbol__filter_type_section.snap +++ /dev/null @@ -1,78 +0,0 @@ ---- -source: src/tests/workspace/symbol.rs -expression: result.actual_symbols ---- -[ - { - "deprecated": false, - "kind": 2, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 7, - "character": 0 - }, - "end": { - "line": 11, - "character": 14 - } - } - }, - "name": "1 Foo" - }, - { - "deprecated": false, - "kind": 2, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 13, - "character": 0 - }, - "end": { - "line": 19, - "character": 12 - } - } - }, - "name": "2 Bar" - }, - { - "deprecated": false, - "kind": 2, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 21, - "character": 0 - }, - "end": { - "line": 27, - "character": 15 - } - } - }, - "name": "3 Baz" - }, - { - "deprecated": false, - "kind": 2, - "location": { - "uri": "[tmp]/main.tex", - "range": { - "start": { - "line": 29, - "character": 0 - }, - "end": { - "line": 35, - "character": 11 - } - } - }, - "name": "4 Qux" - } -] diff --git a/support/texlab/src/tests/workspace/symbol.rs b/support/texlab/src/tests/workspace/symbol.rs deleted file mode 100644 index 626cce3c0b..0000000000 --- a/support/texlab/src/tests/workspace/symbol.rs +++ /dev/null @@ -1,142 +0,0 @@ -use insta::{assert_json_snapshot, internals::Redaction}; -use lsp_types::{ - request::WorkspaceSymbol, ClientCapabilities, SymbolInformation, Url, WorkspaceSymbolParams, -}; - -use crate::tests::{client::Client, fixture}; - -struct SymbolResult { - actual_symbols: Vec<SymbolInformation>, - uri_redaction: Redaction, -} - -fn find_symbols(fixture: &str, query: &str) -> SymbolResult { - let mut client = Client::spawn(); - client.initialize(ClientCapabilities::default(), None); - - let fixture = fixture::parse(fixture); - for file in fixture.files { - client.open(file.name, file.lang, file.text); - } - - let actual_symbols = client - .request::<WorkspaceSymbol>(WorkspaceSymbolParams { - query: query.to_string(), - work_done_progress_params: Default::default(), - partial_result_params: Default::default(), - }) - .unwrap() - .unwrap_or_default(); - - let result = client.shutdown(); - - let uri = Url::from_directory_path(result.directory.path()).unwrap(); - let uri_redaction = insta::dynamic_redaction(move |content, _path| { - content.as_str().unwrap().replace(uri.as_str(), "[tmp]/") - }); - - SymbolResult { - actual_symbols, - uri_redaction, - } -} - -macro_rules! assert_symbols { - ($result:expr) => { - let result = $result; - assert_json_snapshot!(result.actual_symbols, { - "[].location.uri" => result.uri_redaction, - "[]" => insta::sorted_redaction() - }); - }; -} - -const FIXTURE: &str = r#" -%TEX main.tex -%SRC \documentclass{article} -%SRC \usepackage{caption} -%SRC \usepackage{amsmath} -%SRC \usepackage{amsthm} -%SRC -%SRC \begin{document} -%SRC -%SRC \section{Foo}\label{sec:foo} -%SRC -%SRC \begin{equation}\label{eq:foo} -%SRC Foo -%SRC \end{equation} -%SRC -%SRC \section{Bar}\label{sec:bar} -%SRC -%SRC \begin{figure} -%SRC Bar -%SRC \caption{Bar} -%SRC \label{fig:bar} -%SRC \end{figure} -%SRC -%SRC \section{Baz}\label{sec:baz} -%SRC -%SRC \begin{enumerate} -%SRC \item\label{itm:foo} Foo -%SRC \item\label{itm:bar} Bar -%SRC \item\label{itm:baz} Baz -%SRC \end{enumerate} -%SRC -%SRC \section{Qux}\label{sec:qux} -%SRC -%SRC \newtheorem{lemma}{Lemma} -%SRC -%SRC \begin{lemma}[Qux]\label{thm:qux} -%SRC Qux -%SRC \end{lemma} -%SRC -%SRC \end{document} - -%TEX main.aux -%SRC \relax -%SRC \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Bar\relax }}{1}\protected@file@percent } -%SRC \providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}} -%SRC \newlabel{fig:bar}{{1}{1}} -%SRC \@writefile{toc}{\contentsline {section}{\numberline {1}Foo}{1}\protected@file@percent } -%SRC \newlabel{sec:foo}{{1}{1}} -%SRC \newlabel{eq:foo}{{1}{1}} -%SRC \@writefile{toc}{\contentsline {section}{\numberline {2}Bar}{1}\protected@file@percent } -%SRC \newlabel{sec:bar}{{2}{1}} -%SRC \@writefile{toc}{\contentsline {section}{\numberline {3}Baz}{1}\protected@file@percent } -%SRC \newlabel{sec:baz}{{3}{1}} -%SRC \newlabel{itm:foo}{{1}{1}} -%SRC \newlabel{itm:bar}{{2}{1}} -%SRC \newlabel{itm:baz}{{3}{1}} -%SRC \@writefile{toc}{\contentsline {section}{\numberline {4}Qux}{1}\protected@file@percent } -%SRC \newlabel{sec:qux}{{4}{1}} -%SRC \newlabel{thm:qux}{{1}{1}} - -%BIB main.bib -%SRC @article{foo,} -%SRC -%SRC @string{bar = "bar"}"#; - -#[test] -fn filter_type_section() { - assert_symbols!(find_symbols(FIXTURE, "section")); -} - -#[test] -fn filter_type_figure() { - assert_symbols!(find_symbols(FIXTURE, "figure")); -} - -#[test] -fn filter_type_item() { - assert_symbols!(find_symbols(FIXTURE, "item")); -} - -#[test] -fn filter_type_math() { - assert_symbols!(find_symbols(FIXTURE, "math")); -} - -#[test] -fn filter_bibtex() { - assert_symbols!(find_symbols(FIXTURE, "bibtex")); -} |