Skip to content

Commit

Permalink
Split features into crates
Browse files Browse the repository at this point in the history
  • Loading branch information
pfoerster committed Apr 13, 2020
1 parent 0fba51b commit f1766a1
Show file tree
Hide file tree
Showing 89 changed files with 546 additions and 313 deletions.
162 changes: 156 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ doctest = false

[dependencies]
aovec = "1.1"
base64 = "0.12"
chashmap = "2.2"
clap = "2.33"
futures = "0.3"
futures-boxed = { path = "crates/futures_boxed" }
html2md = "0.2"
image = "0.23"
itertools = "0.8"
jsonrpc = { path = "crates/jsonrpc" }
jsonrpc-derive = { path = "crates/jsonrpc_derive" }
Expand All @@ -33,16 +30,21 @@ petgraph = { version = "0.5", features = ["serde-1"] }
regex = "1.3"
serde = { version = "1.0", features = ["derive", "rc"] }
serde_json = "1.0"
serde_repr = "0.1"
stderrlog = "0.4"
tempfile = "3.1"
texlab-citeproc = { path = "crates/texlab_citeproc" }
texlab-completion = { path = "crates/texlab_completion" }
texlab-components = { path = "crates/texlab_components" }
texlab-definition = { path = "crates/texlab_definition" }
texlab-feature = { path = "crates/texlab_feature" }
texlab-folding = { path = "crates/texlab_folding" }
texlab-hover = { path = "crates/texlab_hover" }
texlab-protocol = { path = "crates/texlab_protocol" }
texlab-reference = { path = "crates/texlab_reference" }
texlab-rename = { path = "crates/texlab_rename" }
texlab-symbol = { path = "crates/texlab_symbol" }
texlab-syntax = { path = "crates/texlab_syntax" }
texlab-tex = { path = "crates/texlab_tex" }
thiserror = "1.0"
titlecase = "1.1"
tokio = { version = "0.2", features = ["full"] }
tokio-util = { version = "0.2", features = ["codec"] }
uuid = { version = "0.8", features = ["v4"] }
Expand Down
3 changes: 2 additions & 1 deletion benches/benchmarks/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ use super::test_data::TEST_LATEX;
use criterion::{BenchmarkId, Criterion};
use futures::executor::block_on;
use std::time::Duration;
use texlab::{completion::CompletionProvider, feature::FeatureTester};
use texlab_completion::CompletionProvider;
use texlab_feature::FeatureTester;

fn criterion_benchmark(criterion: &mut Criterion) {
criterion.bench_with_input(
Expand Down
29 changes: 29 additions & 0 deletions crates/texlab_completion/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[package]
name = "texlab-completion"
version = "0.1.0"
authors = [
"Eric Förster <efoerster@users.noreply.github.com>",
"Patrick Förster <pfoerster@users.noreply.github.com>"]
edition = "2018"

[lib]
doctest = false

[dependencies]
futures = "0.3"
futures-boxed = { path = "../futures_boxed" }
itertools = "0.8"
log = "0.4"
once_cell = "1.3"
petgraph = { version = "0.5", features = ["serde-1"] }
regex = "1.3"
serde = { version = "1.0", features = ["derive", "rc"] }
serde_json = "1.0"
texlab-components = { path = "../texlab_components" }
texlab-feature = { path = "../texlab_feature" }
texlab-protocol = { path = "../texlab_protocol" }
texlab-syntax = { path = "../texlab_syntax" }
tokio = { version = "0.2", features = ["full"] }

[dev-dependencies]
indoc = "0.3"
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use crate::{
completion::factory::{self, LatexComponentId},
feature::{FeatureProvider, FeatureRequest},
workspace::DocumentContent,
};
use crate::factory::{self, LatexComponentId};
use futures_boxed::boxed;
use texlab_components::COMPONENT_DATABASE;
use texlab_feature::{DocumentContent, FeatureProvider, FeatureRequest};
use texlab_protocol::{CompletionItem, CompletionParams, RangeExt, TextEdit};
use texlab_syntax::SyntaxNode;

Expand Down Expand Up @@ -53,8 +50,8 @@ impl FeatureProvider for BibtexCommandCompletionProvider {
#[cfg(test)]
mod tests {
use super::*;
use crate::feature::FeatureTester;
use indoc::indoc;
use texlab_feature::FeatureTester;
use texlab_protocol::Range;

#[tokio::test]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use crate::{
completion::factory,
feature::{FeatureProvider, FeatureRequest},
workspace::DocumentContent,
};
use crate::factory;
use futures_boxed::boxed;
use texlab_feature::{DocumentContent, FeatureProvider, FeatureRequest};
use texlab_protocol::{CompletionItem, CompletionParams, Position, Range, RangeExt, TextEdit};
use texlab_syntax::{bibtex, SyntaxNode, LANGUAGE_DATA};

Expand Down Expand Up @@ -63,7 +60,7 @@ impl BibtexEntryTypeCompletionProvider {
#[cfg(test)]
mod tests {
use super::*;
use crate::feature::FeatureTester;
use texlab_feature::FeatureTester;

#[tokio::test]
async fn empty_latex_document() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use crate::{
completion::factory,
feature::{FeatureProvider, FeatureRequest},
workspace::DocumentContent,
};
use crate::factory;
use futures_boxed::boxed;
use texlab_feature::{DocumentContent, FeatureProvider, FeatureRequest};
use texlab_protocol::{CompletionItem, CompletionParams, Range, RangeExt, TextEdit};
use texlab_syntax::{bibtex, SyntaxNode, LANGUAGE_DATA};

Expand Down Expand Up @@ -66,8 +63,8 @@ impl BibtexFieldNameCompletionProvider {
#[cfg(test)]
mod tests {
use super::*;
use crate::feature::FeatureTester;
use indoc::indoc;
use texlab_feature::FeatureTester;
use texlab_protocol::Range;

#[tokio::test]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
use crate::{
feature::FeatureRequest,
outline::{OutlineContext, OutlineContextItem},
};
use once_cell::sync::Lazy;
use petgraph::graph::NodeIndex;
use regex::Regex;
use serde::{Deserialize, Serialize};
use std::path::Path;
use texlab_feature::{FeatureRequest, OutlineContext, OutlineContextItem};
use texlab_protocol::*;
use texlab_syntax::{
bibtex, BibtexEntryTypeCategory, BibtexEntryTypeDoc, BibtexFieldDoc, Structure, LANGUAGE_DATA,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use super::combinators::{self, Parameter};
use crate::{
completion::factory,
feature::{FeatureProvider, FeatureRequest},
};
use crate::factory;
use futures_boxed::boxed;
use std::iter;
use texlab_feature::{FeatureProvider, FeatureRequest};
use texlab_protocol::{CompletionItem, CompletionParams, TextEdit};

#[derive(Debug, PartialEq, Eq, Clone, Copy, Default)]
Expand Down Expand Up @@ -54,8 +52,8 @@ impl FeatureProvider for LatexArgumentCompletionProvider {
#[cfg(test)]
mod tests {
use super::*;
use crate::feature::FeatureTester;
use indoc::indoc;
use texlab_feature::FeatureTester;
use texlab_protocol::{Range, RangeExt};

#[tokio::test]
Expand Down
Loading

0 comments on commit f1766a1

Please sign in to comment.