ResourceLockComponent.lockForPath method
ResourceLockComponent › lockForPath
Locks the note at the given path on behalf of this plugin, making it read-only in every current and future MarkdownView until the lock is released. Reference-counted: balance each call with a dispose of the returnedDisposable (ideally via using) or unlockForPath.Signature:
lockForPath(params: ResourceLockComponentLockForPathParams): DisposableExParameters:
| Parameter | Type | Description |
|---|---|---|
| params | ResourceLockComponentLockForPathParams | Locking parameters. Its {@link ResourceLockComponentLockForPathParams.pathOrFile} and {@link ResourceLockComponentLockForPathParams.operationName} are required (the latter is shown in the unlock confirmation). Pass an {@link ResourceLockComponentLockForPathParams.abortController} to make the lock cancelable via a lock indicator's "unlock" menu, the "Unlock active note" command, or {@link requestResourceUnlockForPath}. |
Returns: DisposableEx — A DisposableEx that releases this lock when disposed. Disposing more than once is a no-op.