Skip to content

Commit

Permalink
Move DocumentView to workspace crate
Browse files Browse the repository at this point in the history
  • Loading branch information
pfoerster committed Jul 30, 2019
1 parent e201b39 commit d29b8e8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 22 deletions.
18 changes: 18 additions & 0 deletions crates/texlab_workspace/src/lib.rs
Expand Up @@ -127,6 +127,24 @@ impl Workspace {
}
}

#[derive(Debug, PartialEq, Eq, Clone)]
pub struct DocumentView {
pub workspace: Arc<Workspace>,
pub document: Arc<Document>,
pub related_documents: Vec<Arc<Document>>,
}

impl DocumentView {
pub fn new(workspace: Arc<Workspace>, document: Arc<Document>) -> Self {
let related_documents = workspace.related_documents(&document.uri);
Self {
workspace,
document,
related_documents,
}
}
}

#[derive(Debug, Default)]
pub struct WorkspaceManager {
workspace: Mutex<Arc<Workspace>>,
Expand Down
18 changes: 0 additions & 18 deletions src/feature.rs
Expand Up @@ -5,24 +5,6 @@ use std::path::PathBuf;
use std::sync::Arc;
use texlab_workspace::*;

#[derive(Debug, PartialEq, Eq, Clone)]
pub struct DocumentView {
pub workspace: Arc<Workspace>,
pub document: Arc<Document>,
pub related_documents: Vec<Arc<Document>>,
}

impl DocumentView {
pub fn new(workspace: Arc<Workspace>, document: Arc<Document>) -> Self {
let related_documents = workspace.related_documents(&document.uri);
Self {
workspace,
document,
related_documents,
}
}
}

#[derive(Debug, PartialEq, Clone)]
pub struct FeatureRequest<P> {
pub params: P,
Expand Down
3 changes: 1 addition & 2 deletions src/outline.rs
@@ -1,8 +1,7 @@
use crate::feature::DocumentView;
use lsp_types::{Position, Range, Uri};
use std::collections::HashSet;
use texlab_syntax::*;
use texlab_workspace::Document;
use texlab_workspace::*;

#[derive(Debug, PartialEq, Eq, Clone, Default)]
pub struct Outline<'a> {
Expand Down
4 changes: 2 additions & 2 deletions src/server.rs
Expand Up @@ -5,7 +5,7 @@ use crate::completion::{CompletionItemData, CompletionProvider};
use texlab_completion_data::DATABASE;
use crate::definition::DefinitionProvider;
use crate::diagnostics::{DiagnosticsManager, LatexLintOptions};
use crate::feature::{DocumentView, FeatureProvider, FeatureRequest};
use crate::feature::{FeatureProvider, FeatureRequest};
use crate::folding::FoldingProvider;
use crate::formatting::bibtex::{self, BibtexFormattingOptions, BibtexFormattingParams};
use crate::forward_search::{self, ForwardSearchOptions, ForwardSearchResult};
Expand All @@ -30,7 +30,7 @@ use std::path::PathBuf;
use std::sync::Arc;
use texlab_citeproc::render_citation;
use texlab_syntax::*;
use texlab_workspace::WorkspaceManager;
use texlab_workspace::*;
use walkdir::WalkDir;

pub struct LatexLspServer<C> {
Expand Down

0 comments on commit d29b8e8

Please sign in to comment.