feat: rendered workspace comment (#7918)

* feat: add basic rendered workspace comment

* feat: add updating the view and model

* feat: add support for setting editability

* feat: add moveTo support

* feat: add disposing

* chore: add tsdoc

* fix: disposing of the comment when the delete icon is clicked

* feat: add isDeadOrDying
This commit is contained in:
Beka Westberg
2024-03-19 17:52:27 +00:00
committed by GitHub
parent 250cf90d25
commit 93acb62456
3 changed files with 101 additions and 1 deletions

View File

@@ -35,7 +35,10 @@ export class WorkspaceComment {
private location = new Coordinate(0, 0);
/** Whether this comment has been disposed or not. */
private disposed = false;
protected disposed = false;
/** Whether this comment is being disposed or not. */
protected disposing = false;
/**
* Constructs the comment.
@@ -158,6 +161,7 @@ export class WorkspaceComment {
/** Disposes of this comment. */
dispose() {
this.disposing = true;
this.disposed = true;
}
@@ -165,4 +169,12 @@ export class WorkspaceComment {
isDisposed() {
return this.disposed;
}
/**
* Returns true if this comment view is currently being disposed or has
* already been disposed.
*/
isDeadOrDying(): boolean {
return this.disposing || this.disposed;
}
}