Improve comments
This commit is contained in:
parent
02ec098283
commit
c462994af9
3 changed files with 9 additions and 5 deletions
|
|
@ -149,7 +149,7 @@ export class CursorTracker {
|
||||||
public addRemoteCursorsUpdateListener(
|
public addRemoteCursorsUpdateListener(
|
||||||
listener: (cursors: MaybeOutdatedClientCursors[]) => unknown
|
listener: (cursors: MaybeOutdatedClientCursors[]) => unknown
|
||||||
): void {
|
): void {
|
||||||
// CursorTracker registers its own event listener in the constructor so it must get called first
|
// CursorTracker registers its own event listener in the constructor so it must have been called before this
|
||||||
this.webSocketManager.addRemoteCursorsUpdateListener(async () => {
|
this.webSocketManager.addRemoteCursorsUpdateListener(async () => {
|
||||||
await this.updateLock.withLock(() =>
|
await this.updateLock.withLock(() =>
|
||||||
listener(this.getRelevantAndPruneKnownClientCursors())
|
listener(this.getRelevantAndPruneKnownClientCursors())
|
||||||
|
|
|
||||||
|
|
@ -9,19 +9,19 @@ cargo fmt --all -- --check
|
||||||
cargo machete
|
cargo machete
|
||||||
cargo test --verbose
|
cargo test --verbose
|
||||||
|
|
||||||
|
|
||||||
echo "Running checks in frontend"
|
echo "Running checks in frontend"
|
||||||
cd ../frontend
|
cd ../frontend
|
||||||
npm ci
|
npm ci
|
||||||
npm run build
|
npm run build
|
||||||
npm run lint
|
npm run lint
|
||||||
|
npm run test
|
||||||
|
|
||||||
if [[ $(git status --porcelain) ]]; then
|
if [[ $(git status --porcelain) ]]; then
|
||||||
git status --porcelain
|
git status --porcelain
|
||||||
echo "Failing CI because the working directory is not clean after linting"
|
echo "Failing CI because the working directory is not clean after linting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
npm run test
|
|
||||||
|
|
||||||
echo "Finished"
|
echo "Success"
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,11 @@ pub struct CursorPositionFromClient {
|
||||||
|
|
||||||
#[derive(TS, Serialize, Deserialize, Clone, Debug)]
|
#[derive(TS, Serialize, Deserialize, Clone, Debug)]
|
||||||
pub struct DocumentWithCursors {
|
pub struct DocumentWithCursors {
|
||||||
// It's None in case the document is dirty
|
// It's None in case the document is dirty.
|
||||||
|
// We still want to sync the cursor to mark
|
||||||
|
// that it exists and can be client-side
|
||||||
|
// interpolated. However, the actual
|
||||||
|
// position is meaningless.
|
||||||
#[ts(as = "Option<u32>")]
|
#[ts(as = "Option<u32>")]
|
||||||
pub vault_update_id: Option<VaultUpdateId>,
|
pub vault_update_id: Option<VaultUpdateId>,
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue