summaryrefslogtreecommitdiff
path: root/support/texlab/src/db/workspace.rs
diff options
context:
space:
mode:
Diffstat (limited to 'support/texlab/src/db/workspace.rs')
-rw-r--r--support/texlab/src/db/workspace.rs35
1 files changed, 10 insertions, 25 deletions
diff --git a/support/texlab/src/db/workspace.rs b/support/texlab/src/db/workspace.rs
index 123d415fd9..67c99792a2 100644
--- a/support/texlab/src/db/workspace.rs
+++ b/support/texlab/src/db/workspace.rs
@@ -4,19 +4,19 @@ use std::{
};
use itertools::Itertools;
-use lsp_types::{ClientCapabilities, ClientInfo, Url};
+use lsp_types::{ClientCapabilities, Url};
use rowan::TextSize;
use rustc_hash::FxHashSet;
use crate::{
db::document::{Document, Location},
distro::FileNameDB,
- Db, Options,
+ Db,
};
use super::{
dependency_graph,
- document::{Contents, Language, LinterData, Owner},
+ document::{Language, LinterData, Owner},
Word,
};
@@ -26,15 +26,9 @@ pub struct Workspace {
pub documents: FxHashSet<Document>,
#[return_ref]
- pub options: Options,
-
- #[return_ref]
pub client_capabilities: ClientCapabilities,
#[return_ref]
- pub client_info: Option<ClientInfo>,
-
- #[return_ref]
pub root_dirs: Vec<Location>,
#[return_ref]
@@ -79,11 +73,10 @@ impl Workspace {
owner: Owner,
) -> Document {
let location = Location::new(db, uri);
- let contents = Contents::new(db, text);
let cursor = TextSize::from(0);
match self.lookup(db, location) {
Some(document) => {
- document.set_contents(db).to(contents);
+ document.set_text(db).to(text);
document.set_language(db).to(language);
document.set_owner(db).to(owner);
document.set_cursor(db).to(cursor);
@@ -93,7 +86,7 @@ impl Workspace {
let document = Document::new(
db,
location,
- contents,
+ text,
language,
owner,
cursor,
@@ -157,11 +150,10 @@ impl Workspace {
impl Workspace {
#[salsa::tracked]
pub fn working_dir(self, db: &dyn Db, base_dir: Location) -> Location {
- if let Some(dir) = self
- .options(db)
- .root_directory
- .as_deref()
- .and_then(|path| path.to_str())
+ if let Some(dir) = db
+ .config()
+ .root_dir
+ .as_ref()
.and_then(|path| base_dir.join(db, path))
{
return dir;
@@ -182,14 +174,7 @@ impl Workspace {
#[salsa::tracked]
pub fn output_dir(self, db: &dyn Db, base_dir: Location) -> Location {
- let mut path = self
- .options(db)
- .aux_directory
- .as_deref()
- .and_then(|path| path.to_str())
- .unwrap_or(".")
- .to_string();
-
+ let mut path = db.config().build.output_dir.clone();
if !path.ends_with('/') {
path.push('/');
}