201
return { typeId: this.typeId };
202
}
204
>
/**
205
>
* Returns if this input is dirty or not.
206
>
*/
207
>
isDirty(): boolean {
208
return false;
209
}
211
>
/**
212
>
* Returns if the input has unsaved changes.
213
>
*/
214
>
isModified(): boolean {
215
return this.isDirty();
216
}
218
>
/**
219
>
* Returns if this input is currently being saved or soon to be
220
>
* saved. Based on this assumption the editor may for example
221
>
* decide to not signal the dirty state to the user assuming that
222
>
* the save is scheduled to happen anyway.
223
>
*/
224
>
isSaving(): boolean {
225
return false;
226
}
228
>
/**
229
>
* Returns a type of `IDisposable` that represents the resolved input.
230
>
* Subclasses should override to provide a meaningful model or return
231
>
* `null` if the editor does not require a model.
232
>
*
233
>
* The `options` parameter are passed down from the editor when the
234
>
* input is resolved as part of it.
235
>
*/
236
>
async resolve(): Promise<IDisposable | null> {
237
return null;
238
}
240
>
/**
241
>
* Saves the editor. The provided groupId helps implementors
242
>
* to e.g. preserve view state of the editor and re-open it
243
>
* in the correct group after saving.
244
>
*
245
>
* @returns the resulting editor input (typically the same) of
246
>
* this operation or `undefined` to indicate that the operation
247
>
* failed or was canceled.
248
>
*/
249
>
async save(group: GroupIdentifier, options?: ISaveOptions): Promise<EditorInput | IUntypedEditorInput | undefined> {
250
return this;
251
}
253
>
/**
254
>
* Saves the editor to a different location. The provided `group`
255
>
* helps implementors to e.g. preserve view state of the editor
256
>
* and re-open it in the correct group after saving.
257
>
*
258
>
* @returns the resulting editor input (typically a different one)
259
>
* of this operation or `undefined` to indicate that the operation
260
>
* failed or was canceled.
261
>
*/
262
>
async saveAs(group: GroupIdentifier, options?: ISaveOptions): Promise<EditorInput | IUntypedEditorInput | undefined> {
263
return this;
264
}
266
>
/**
267
>
* Reverts this input from the provided group.
268
>
*/
269
>
async revert(group: GroupIdentifier, options?: IRevertOptions): Promise<void> { }
270
>
271
>
/**
272
>
* Called to determine how to handle a resource that is renamed that matches
273
>
* the editors resource (or is a child of).
274
>
*
275
>
* Implementors are free to not implement this method to signal no intent
276
>
* to participate. If an editor is returned though, it will replace the
277
>
* current one with that editor and optional options.
278
>
*/
279
>
async rename(group: GroupIdentifier, target: URI): Promise<IMoveResult | undefined> {
280
return undefined;
281
}
283
>
/**
284
>
* Returns a copy of the current editor input. Used when we can't just reuse the input
285
>
*/
286
>
copy(): EditorInput {
287
return this;
288
}
290
>
/**
291
>
* Indicates if this editor can be moved to another group. By default
292
>
* editors can freely be moved around groups. If an editor cannot be
293
>
* moved, a message should be returned to show to the user.
294
>
*
295
>
* @returns `true` if the editor can be moved to the target group, or
296
>
* a string with a message to show to the user if the editor cannot be
297
>
* moved.
298
>
*/
299
>
canMove(sourceGroup: GroupIdentifier, targetGroup: GroupIdentifier): true | string {
300
return true;
301
}
303
>
/**
304
>
* Indicates if this editor can be reopened after being closed. By default
305
>
* editors can be reopened. Subclasses can override to prevent this.
306
>
*
307
>
* @returns `true` if the editor can be reopened after being closed.
308
>
*/
309
>
canReopen(): boolean {
310
return true;
311
}
313
>
/**
314
>
* Returns if the other object matches this input.
315
>
*/
316
>
matches(otherInput: EditorInput | IUntypedEditorInput): boolean {
317
318
// Typed inputs: via === check