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

feat: add wip workspace crate and other minor stuff #123

Closed
wants to merge 3 commits into from
Closed
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
164 changes: 155 additions & 9 deletions Cargo.lock

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

13 changes: 13 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ resolver = "2"
rust-version = "1.71"

[workspace.dependencies]
stdx = { path = "./crates/stdx", version = "0.0.0" }
lsp = { path = "./crates/lsp", version = "0.0.0" }
cli = { path = "./crates/cli", version = "0.0.0" }
playground = { path = "./crates/playground", version = "0.0.0" }
fs = { path = "./crates/fs", version = "0.0.0" }
text_size = { path = "./crates/text_size", version = "0.0.0" }
service = { path = "./crates/service", version = "0.0.0" }
tree_sitter_sql = { path = "./crates/tree_sitter_sql", version = "0.0.0" }
schema_cache = { path = "./crates/schema_cache", version = "0.0.0" }
parser = { path = "./crates/parser", version = "0.0.0" }
Expand All @@ -17,6 +24,12 @@ sourcegen = { path = "./crates/sourcegen", version = "0.0.0" }
pg_query_proto_parser = { path = "./crates/pg_query_proto_parser", version = "0.0.0" }
triomphe = { version = "0.1.8", default-features = false, features = ["std"] }

serde = "1.0.197"
dashmap = "5.5.3"
tree-sitter = "0.20.10"
libc = "0.2.150"
crossbeam-channel = "0.5.12"

[profile.dev.package]
insta.opt-level = 3
similar.opt-level = 3
9 changes: 9 additions & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "cli"
version = "0.0.0"
edition = "2021"

[dependencies]

[lib]
doctest = false
3 changes: 3 additions & 0 deletions crates/cli/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}
10 changes: 10 additions & 0 deletions crates/fs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "fs"
version = "0.0.0"
edition = "2021"

[dependencies]
serde = { workspace = true }

[lib]
doctest = false
3 changes: 3 additions & 0 deletions crates/fs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mod path;

pub use path::FilePath;
29 changes: 29 additions & 0 deletions crates/fs/src/path.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//! This module is responsible to manage paths inside Biome.
//! It is a small wrapper around [path::PathBuf] but it is also able to
//! give additional information around the file that holds:
//! - the [FileHandlers] for the specific file
//! - shortcuts to open/write to the file
use std::fs::read_to_string;
use std::io::Read;
use std::{fs::File, io, io::Write, ops::Deref, path::PathBuf};

#[derive(Debug, Clone, Eq, Hash, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct FilePath {
path: PathBuf,
}

impl Deref for FilePath {
type Target = PathBuf;

fn deref(&self) -> &Self::Target {
&self.path
}
}

impl FilePath {
pub fn new(path_to_file: impl Into<PathBuf>) -> Self {
Self {
path: path_to_file.into(),
}
}
}
23 changes: 23 additions & 0 deletions crates/lsp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "lsp"
version = "0.0.0"
edition = "2021"

[dependencies]
lsp-server = "0.7.6"
anyhow = "1.0.80"
lsp-types = "0.95.0"
serde = "1.0.197"
serde_json = "1.0.114"
crossbeam-channel.workspace = true
num_cpus = "1.15.0"

schema_cache.workspace = true
stdx.workspace = true

[lib]
doctest = false

[[bin]]
name = "postgres_lsp"
path = "src/bin/main.rs"
Loading
Loading