diff options
author | Norbert Preining <norbert@preining.info> | 2024-03-25 03:03:04 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-03-25 03:03:04 +0000 |
commit | 05f8146ef2eea2cd71b9c96583c6d893e6c76af5 (patch) | |
tree | 615019c00dc1d5e6ec2636bbbb30852f241c04ee /support/texlab/crates/symbols | |
parent | 1feacf4295bab2d8f05aa0f5fbd1d902559bef36 (diff) |
CTAN sync 202403250302
Diffstat (limited to 'support/texlab/crates/symbols')
-rw-r--r-- | support/texlab/crates/symbols/src/document.rs | 4 | ||||
-rw-r--r-- | support/texlab/crates/symbols/src/document/tex.rs | 3 | ||||
-rw-r--r-- | support/texlab/crates/symbols/src/workspace/sort.rs | 6 |
3 files changed, 7 insertions, 6 deletions
diff --git a/support/texlab/crates/symbols/src/document.rs b/support/texlab/crates/symbols/src/document.rs index e8f1087051..791f119919 100644 --- a/support/texlab/crates/symbols/src/document.rs +++ b/support/texlab/crates/symbols/src/document.rs @@ -1,12 +1,12 @@ mod bib; mod tex; -use base_db::{util, Document, DocumentData, SymbolConfig, Workspace}; +use base_db::{deps::Project, util, Document, DocumentData, SymbolConfig, Workspace}; use crate::Symbol; pub fn document_symbols(workspace: &Workspace, document: &Document) -> Vec<Symbol> { - let project = workspace.project(document); + let project = Project::from_child(workspace, document); let mut symbols = match &document.data { DocumentData::Tex(data) => { let builder = tex::SymbolBuilder::new(&project, workspace.config()); diff --git a/support/texlab/crates/symbols/src/document/tex.rs b/support/texlab/crates/symbols/src/document/tex.rs index 55612ee11d..e0df9c85c1 100644 --- a/support/texlab/crates/symbols/src/document/tex.rs +++ b/support/texlab/crates/symbols/src/document/tex.rs @@ -1,6 +1,6 @@ use std::str::FromStr; -use base_db::{semantics::Span, util::FloatKind, Config, Project}; +use base_db::{deps::Project, semantics::Span, util::FloatKind, Config}; use rowan::ast::AstNode; use syntax::latex::{self, HasBrack, HasCurly, LatexLanguage}; use titlecase::titlecase; @@ -101,6 +101,7 @@ impl<'a> SymbolBuilder<'a> { let name = enum_item .label() .and_then(|label| label.content_text()) + .filter(|text| !text.is_empty()) .unwrap_or_else(|| "Item".into()); let symbol = match self.find_label(enum_item.syntax()) { diff --git a/support/texlab/crates/symbols/src/workspace/sort.rs b/support/texlab/crates/symbols/src/workspace/sort.rs index 75d80a02eb..adf455aa81 100644 --- a/support/texlab/crates/symbols/src/workspace/sort.rs +++ b/support/texlab/crates/symbols/src/workspace/sort.rs @@ -1,4 +1,4 @@ -use base_db::{graph, Document, Workspace}; +use base_db::{Document, Workspace}; use itertools::Itertools; use url::Url; @@ -26,8 +26,8 @@ impl<'a> From<&'a Workspace> for ProjectOrdering<'a> { }) .chain(workspace.iter()) .flat_map(|document| { - let graph = graph::Graph::new(workspace, document); - graph.preorder().rev().collect_vec() + let graph = &workspace.graphs()[&document.uri]; + graph.preorder(workspace).rev().collect_vec() }) .unique() .collect_vec(); |