mirror of
https://github.com/hexedtech/codemp-proto.git
synced 2024-11-23 07:54:49 +01:00
chore: rustfmt & editorconfig
This commit is contained in:
parent
5ecd52d237
commit
4347dfa9d7
9 changed files with 60 additions and 34 deletions
20
.editorconfig
Normal file
20
.editorconfig
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Default to Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
charset = utf-8
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
[*.rs]
|
||||
indent_size = 2
|
||||
|
||||
[*.proto]
|
||||
indent_size = 2
|
||||
|
||||
[*.js]
|
||||
indent_size = 2
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
1
.rustfmt.toml
Normal file
1
.rustfmt.toml
Normal file
|
@ -0,0 +1 @@
|
|||
hard_tabs = true
|
8
build.rs
8
build.rs
|
@ -1,6 +1,5 @@
|
|||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
tonic_build::configure()
|
||||
.compile(
|
||||
Ok(tonic_build::configure().compile(
|
||||
&[
|
||||
"proto/common.proto",
|
||||
"proto/cursor.proto",
|
||||
|
@ -10,6 +9,5 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
"proto/buffer.proto",
|
||||
],
|
||||
&["proto"],
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
)?)
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ syntax = "proto2";
|
|||
|
||||
package common;
|
||||
|
||||
|
||||
// a wrapper payload representing an uuid
|
||||
message Identity {
|
||||
// uuid bytes, as string
|
||||
|
|
|
@ -10,7 +10,6 @@ service Cursor {
|
|||
rpc Attach (stream cursor.CursorPosition) returns (stream cursor.CursorEvent);
|
||||
}
|
||||
|
||||
|
||||
// a tuple indicating row and column
|
||||
message RowCol {
|
||||
required int32 row = 1;
|
||||
|
|
21
src/lib.rs
21
src/lib.rs
|
@ -28,7 +28,6 @@ pub mod proto {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
pub mod files {
|
||||
tonic::include_proto!("files");
|
||||
|
||||
|
@ -40,7 +39,9 @@ pub mod proto {
|
|||
|
||||
impl From<&str> for BufferNode {
|
||||
fn from(value: &str) -> Self {
|
||||
BufferNode { path: value.to_string() }
|
||||
BufferNode {
|
||||
path: value.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,8 +52,16 @@ pub mod proto {
|
|||
}
|
||||
}
|
||||
|
||||
pub mod buffer { tonic::include_proto!("buffer"); }
|
||||
pub mod cursor { tonic::include_proto!("cursor"); }
|
||||
pub mod workspace { tonic::include_proto!("workspace"); }
|
||||
pub mod auth { tonic::include_proto!("auth"); }
|
||||
pub mod buffer {
|
||||
tonic::include_proto!("buffer");
|
||||
}
|
||||
pub mod cursor {
|
||||
tonic::include_proto!("cursor");
|
||||
}
|
||||
pub mod workspace {
|
||||
tonic::include_proto!("workspace");
|
||||
}
|
||||
pub mod auth {
|
||||
tonic::include_proto!("auth");
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue