Skip to content

Commit ce58d98

Browse files
committed
chore: update to new proto
1 parent 4ec7b02 commit ce58d98

7 files changed

Lines changed: 26 additions & 27 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ thiserror = "2.0"
3131
# crdt
3232
diamond-types = "1.0"
3333
# proto
34-
codemp-proto = { git = "https://github.com/hexedtech/codemp-proto", rev = "0e3af02296d33563dde6fe4caf7fd8df237c9357", features = ["client"] }
34+
codemp-proto = { git = "https://github.com/hexedtech/codemp-proto", rev = "6b45fd7bd7c03ef60234880c59157481def4ca71", features = ["client"] }
3535
uuid = { version = "1.17", features = ["v4"] }
3636
tonic = { version = "0.14", features = ["tls-native-roots"] }
3737
# api

dist/java/src/mp/code/proto/WorkspaceEventKind.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,27 @@ public final class WorkspaceEventKind {
1717
*/
1818
public static final int USER_LEAVE_WORKSPACE = 2;
1919
/**
20-
* Event that occurs when a file is created in a workspace.
20+
* Event that occurs when a user joins a buffer.
2121
*/
22-
public static final int FILE_CREATE = 3;
22+
public static final int USER_JOIN_BUFFER = 3;
2323
/**
24-
* Event that occurs when a file is renamed in a workspace.
24+
* Event that occurs when a user leaves a buffer.
2525
*/
26-
public static final int FILE_RENAME = 4;
26+
public static final int USER_LEAVE_BUFFER = 4;
2727
/**
28-
* Event that occurs when a file is deleted in a workspace.
28+
* Event that occurs when a buffer is created in a workspace.
2929
*/
30-
public static final int FILE_DELETE = 5;
30+
public static final int BUFFER_CREATE = 5;
3131
/**
32-
* Event that occurs when a user joins a buffer.
32+
* Event that occurs when a buffer is renamed in a workspace.
3333
*/
34-
public static final int USER_JOIN_BUFFER = 6;
34+
public static final int BUFFER_RENAME = 6;
3535
/**
36-
* Event that occurs when a user leaves a buffer.
36+
* Event that occurs when a buffer is deleted in a workspace.
3737
*/
38-
public static final int USER_LEAVE_BUFFER = 7;
39-
38+
public static final int BUFFER_DELETE = 7;
4039
/**
4140
* Event that occurs when a buffer has one of its attributes changed.
4241
*/
43-
public static final int FILE_ATTRS_UPDATED = 8;
42+
public static final int BUFFER_ATTRS_UPDATED = 8;
4443
}

dist/lua/enums.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ local SessionEventKind = {
1111
local WorkspaceEventKind = {
1212
UserJoinWorkspace = 1,
1313
UserLeaveWorkspace = 2,
14-
FileCreate = 3,
15-
FileRename = 4,
16-
FileDelete = 5,
17-
UserJoinBuffer = 6,
18-
UserLeaveBuffer = 7,
19-
FileAttrsUpdated = 8,
14+
UserJoinBuffer = 3,
15+
UserLeaveBuffer = 4,
16+
BufferCreate = 5,
17+
BufferRename = 6,
18+
BufferDelete = 7,
19+
BufferAttrsUpdated = 8,
2020
}
2121

2222
return {

src/ffi/js/workspace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use codemp_proto::{common::UserInfo, files::{BufferAttributes, BufferNode}, session::WorkspaceIdentifier, workspace::WorkspaceEvent};
1+
use codemp_proto::{common::UserInfo, buffer::{BufferAttributes, BufferNode}, session::WorkspaceIdentifier, workspace::WorkspaceEvent};
22
use crate::{api::AsyncReceiver, buffer::controller::BufferController, cursor::controller::CursorController};
33
use napi::threadsafe_function::{ThreadsafeFunction, ThreadsafeFunctionCallMode};
44
use napi_derive::napi;

src/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub use crate::api::{
1010

1111
pub use crate::proto::{
1212
common::UserInfo as CodempUserInfo,
13-
files::BufferNode as CodempBufferNode, files::BufferAttributes as CodempBufferAttributes,
13+
buffer::BufferNode as CodempBufferNode, buffer::BufferAttributes as CodempBufferAttributes,
1414
buffer::BufferEvent as CodempBufferEvent,
1515
cursor::CursorEvent as CodempCursorEvent, cursor::CursorUpdate as CodempCursorUpdate,
1616
cursor::CursorPosition as CodempCursorPosition, cursor::RowCol as CodempRowCol,

src/workspace.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use crate::{
1414
};
1515

1616
use codemp_proto::{
17+
buffer::{BufferAttributes, BufferNode, BufferPath},
1718
common::Empty,
18-
files::{BufferAttributes, BufferNode, BufferPath},
1919
workspace::{WorkspaceEvent, WorkspaceEventKind},
2020
};
2121

@@ -467,7 +467,7 @@ impl WorkspaceWorker {
467467
}
468468
},
469469

470-
WorkspaceEventKind::FileCreate => {
470+
WorkspaceEventKind::BufferCreate => {
471471
if let (Some(path), Some(attributes)) = (event.path, event.attributes) {
472472
inner.buffer_users.insert(path.clone(), Vec::new());
473473
inner.filetree.insert(path.clone(), BufferNode {
@@ -476,7 +476,7 @@ impl WorkspaceWorker {
476476
});
477477
}
478478
}
479-
WorkspaceEventKind::FileRename => {
479+
WorkspaceEventKind::BufferRename => {
480480
if let (Some(before), Some(after)) = (event.path, event.after) {
481481
if let Some((_path, controller)) = inner.buffers.remove(&before) {
482482
inner.buffers.insert(after.clone(), controller);
@@ -489,14 +489,14 @@ impl WorkspaceWorker {
489489
}
490490
}
491491
}
492-
WorkspaceEventKind::FileDelete => {
492+
WorkspaceEventKind::BufferDelete => {
493493
if let Some(path) = event.path {
494494
inner.filetree.remove(&path);
495495
inner.buffer_users.remove(&path);
496496
let _ = inner.buffers.remove(&path);
497497
}
498498
}
499-
WorkspaceEventKind::FileAttrsUpdated => {
499+
WorkspaceEventKind::BufferAttrsUpdated => {
500500
if let (Some(path), Some(attributes)) = (event.path, event.attributes) {
501501
if let Some(mut r) = inner.filetree.get_mut(&path) {
502502
r.attributes = attributes;

0 commit comments

Comments
 (0)