applyEdit method

Future applyEdit(
  1. WorkspaceEdit edit, [
  2. WorkspaceEditMetadata? metadata
])

Make changes to one or many resources or create, delete, and rename resources as defined by the given {@link WorkspaceEditworkspace edit}.

All changes of a workspace edit are applied in the same order in which they have been added. If multiple textual inserts are made at the same position, these strings appear in the resulting text in the order the 'inserts' were made, unless that are interleaved with resource edits. Invalid sequences like 'delete file a' -> 'insert text in file a' cause failure of the operation.

When applying a workspace edit that consists only of text edits an 'all-or-nothing'-strategy is used. A workspace edit with resource creations or deletions aborts the operation, e.g. consecutive edits will not be attempted, when a single edit fails.

Implementation

_i2.Future<_i2.dynamic> applyEdit(
  _i3.WorkspaceEdit edit, [
  _i3.WorkspaceEditMetadata? metadata,
]) =>
    _i4.promiseToFuture(_i4.callMethod(
      this,
      'applyEdit',
      [
        edit,
        metadata ?? _i5.undefined,
      ],
    ));