From 745892fbddea56040139108277e728b53fd8fc11 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 28 May 2020 03:03:21 +0000 Subject: CTAN sync 202005280303 --- support/texlab/src/syntax/latex/glossary.rs | 58 ----------------------------- 1 file changed, 58 deletions(-) delete mode 100644 support/texlab/src/syntax/latex/glossary.rs (limited to 'support/texlab/src/syntax/latex/glossary.rs') diff --git a/support/texlab/src/syntax/latex/glossary.rs b/support/texlab/src/syntax/latex/glossary.rs deleted file mode 100644 index 14f87ef130..0000000000 --- a/support/texlab/src/syntax/latex/glossary.rs +++ /dev/null @@ -1,58 +0,0 @@ -use super::ast::*; -use crate::syntax::language::*; -use crate::syntax::text::SyntaxNode; -use lsp_types::Range; -use std::sync::Arc; - -#[derive(Debug, PartialEq, Eq, Clone)] -pub struct LatexGlossaryEntry { - pub command: Arc, - pub label_index: usize, - pub kind: LatexGlossaryEntryKind, -} - -impl SyntaxNode for LatexGlossaryEntry { - fn range(&self) -> Range { - self.command.range() - } -} - -impl LatexGlossaryEntry { - pub fn label(&self) -> &LatexToken { - self.command.extract_word(self.label_index).unwrap() - } - - fn parse(commands: &[Arc]) -> Vec { - let mut entries = Vec::new(); - for command in commands { - for LatexGlossaryEntryDefinitionCommand { - name, - label_index, - kind, - } in &LANGUAGE_DATA.glossary_entry_definition_commands - { - if command.name.text() == name && command.has_word(*label_index) { - entries.push(Self { - command: Arc::clone(&command), - label_index: *label_index, - kind: *kind, - }); - } - } - } - entries - } -} - -#[derive(Debug, PartialEq, Eq, Clone)] -pub struct LatexGlossaryInfo { - pub entries: Vec, -} - -impl LatexGlossaryInfo { - pub fn parse(commands: &[Arc]) -> Self { - Self { - entries: LatexGlossaryEntry::parse(commands), - } - } -} -- cgit v1.2.3