mirror of
https://github.com/latex-lsp/texlab.git
synced 2025-08-04 10:49:55 +00:00
Don't follow package links by default (#987)
This commit is contained in:
parent
b4c5d2784f
commit
1a2ad9e7ba
5 changed files with 16 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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>,
|
||||
|
@ -31,6 +32,7 @@ impl Default for SyntaxConfig {
|
|||
.collect();
|
||||
|
||||
Self {
|
||||
follow_package_links: false,
|
||||
math_environments,
|
||||
enum_environments,
|
||||
verbatim_environments,
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue