Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't follow package links by default #987

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- Avoid trying to parse most of the TeX distro when building the dependency graph. Add `texlab.experimental.followPackageLinks` setting to allow re-enabling the old behavior
([#986](https://github.com/latex-lsp/texlab/issues/986))

## [5.12.0] - 2023-12-03

### Added
Expand Down
6 changes: 6 additions & 0 deletions crates/base-db/src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ impl<'a> Graph<'a> {
return;
};

let uri = source.uri.as_str();
let is_pkg = uri.ends_with(".sty") || uri.ends_with(".cls");
if is_pkg && !self.workspace.config().syntax.follow_package_links {
return;
}

for link in &data.semantics.links {
self.add_link(source, base_dir, link);
}
Expand Down
2 changes: 2 additions & 0 deletions crates/parser/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use rustc_hash::FxHashSet;

#[derive(Debug)]
pub struct SyntaxConfig {
pub follow_package_links: bool,
pub math_environments: FxHashSet<String>,
pub enum_environments: FxHashSet<String>,
pub verbatim_environments: FxHashSet<String>,
Expand Down Expand Up @@ -31,6 +32,7 @@ impl Default for SyntaxConfig {
.collect();

Self {
follow_package_links: false,
math_environments,
enum_environments,
verbatim_environments,
Expand Down
2 changes: 0 additions & 2 deletions crates/syntax/src/bibtex/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ pub enum SyntaxKind {
ROOT,
}

pub use SyntaxKind::*;

impl From<SyntaxKind> for rowan::SyntaxKind {
fn from(kind: SyntaxKind) -> Self {
Self(kind as u16)
Expand Down
1 change: 1 addition & 0 deletions crates/texlab/src/server/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ pub struct RegexPattern(#[serde(with = "serde_regex")] pub Regex);
#[serde(rename_all = "camelCase")]
#[serde(default)]
pub struct ExperimentalOptions {
pub follow_package_links: bool,
pub math_environments: Vec<String>,
pub enum_environments: Vec<String>,
pub verbatim_environments: Vec<String>,
Expand Down