@theia/editor 1.13.0-next.fd91f213 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/editor-command.d.ts +19 -0
- package/lib/browser/editor-command.d.ts.map +1 -1
- package/lib/browser/editor-command.js +53 -4
- package/lib/browser/editor-command.js.map +1 -1
- package/lib/browser/editor-contribution.d.ts.map +1 -1
- package/lib/browser/editor-contribution.js +72 -0
- package/lib/browser/editor-contribution.js.map +1 -1
- package/lib/browser/editor-keybinding.d.ts +1 -0
- package/lib/browser/editor-keybinding.d.ts.map +1 -1
- package/lib/browser/editor-keybinding.js +7 -0
- package/lib/browser/editor-keybinding.js.map +1 -1
- package/lib/browser/editor-manager.d.ts +21 -1
- package/lib/browser/editor-manager.d.ts.map +1 -1
- package/lib/browser/editor-manager.js +111 -32
- package/lib/browser/editor-manager.js.map +1 -1
- package/lib/browser/editor-navigation-contribution.d.ts +9 -0
- package/lib/browser/editor-navigation-contribution.d.ts.map +1 -1
- package/lib/browser/editor-navigation-contribution.js +89 -1
- package/lib/browser/editor-navigation-contribution.js.map +1 -1
- package/lib/browser/editor-preferences.d.ts +1 -0
- package/lib/browser/editor-preferences.d.ts.map +1 -1
- package/lib/browser/editor-preferences.js +4 -0
- package/lib/browser/editor-preferences.js.map +1 -1
- package/lib/browser/editor-widget-factory.d.ts +1 -1
- package/lib/browser/editor-widget-factory.d.ts.map +1 -1
- package/lib/browser/editor-widget-factory.js +5 -2
- package/lib/browser/editor-widget-factory.js.map +1 -1
- package/lib/browser/navigation/navigation-location-service.d.ts +31 -3
- package/lib/browser/navigation/navigation-location-service.d.ts.map +1 -1
- package/lib/browser/navigation/navigation-location-service.js +47 -2
- package/lib/browser/navigation/navigation-location-service.js.map +1 -1
- package/lib/browser/navigation/navigation-location-service.spec.js +74 -2
- package/lib/browser/navigation/navigation-location-service.spec.js.map +1 -1
- package/lib/browser/navigation/navigation-location.d.ts +25 -0
- package/lib/browser/navigation/navigation-location.d.ts.map +1 -1
- package/lib/browser/navigation/navigation-location.js +39 -9
- package/lib/browser/navigation/navigation-location.js.map +1 -1
- package/package.json +4 -4
- package/src/browser/editor-command.ts +53 -4
- package/src/browser/editor-contribution.ts +29 -2
- package/src/browser/editor-keybinding.ts +9 -0
- package/src/browser/editor-manager.ts +104 -19
- package/src/browser/editor-navigation-contribution.ts +58 -2
- package/src/browser/editor-preferences.ts +6 -0
- package/src/browser/editor-widget-factory.ts +5 -2
- package/src/browser/navigation/navigation-location-service.spec.ts +98 -3
- package/src/browser/navigation/navigation-location-service.ts +51 -3
- package/src/browser/navigation/navigation-location.ts +55 -7
|
@@ -190,14 +190,62 @@ export namespace NavigationLocation {
|
|
|
190
190
|
return JSON.stringify(toObject(location));
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function toUri(arg: URI | { uri: URI } | string): URI {
|
|
196
|
+
if (arg instanceof URI) {
|
|
197
|
+
return arg;
|
|
198
|
+
}
|
|
199
|
+
if (typeof arg === 'string') {
|
|
200
|
+
return new URI(arg);
|
|
201
|
+
}
|
|
202
|
+
return arg.uri;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Representation of a closed editor.
|
|
207
|
+
*/
|
|
208
|
+
export interface RecentlyClosedEditor {
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* The uri of the closed editor.
|
|
212
|
+
*/
|
|
213
|
+
readonly uri: URI,
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The serializable view state of the closed editor.
|
|
217
|
+
*/
|
|
218
|
+
readonly viewState: object
|
|
219
|
+
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export namespace RecentlyClosedEditor {
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Transform a RecentlyClosedEditor into an object for storing.
|
|
226
|
+
*
|
|
227
|
+
* @param closedEditor the editor needs to be transformed.
|
|
228
|
+
*/
|
|
229
|
+
export function toObject(closedEditor: RecentlyClosedEditor): object {
|
|
230
|
+
const { uri, viewState } = closedEditor;
|
|
231
|
+
return {
|
|
232
|
+
uri: uri.toString(),
|
|
233
|
+
viewState: viewState
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Transform the given object to a RecentlyClosedEditor object if possible.
|
|
239
|
+
*/
|
|
240
|
+
export function fromObject(object: Partial<RecentlyClosedEditor>): RecentlyClosedEditor | undefined {
|
|
241
|
+
const { uri, viewState } = object;
|
|
242
|
+
if (uri !== undefined && viewState !== undefined) {
|
|
243
|
+
return {
|
|
244
|
+
uri: toUri(uri),
|
|
245
|
+
viewState: viewState
|
|
246
|
+
};
|
|
199
247
|
}
|
|
200
|
-
return
|
|
248
|
+
return undefined;
|
|
201
249
|
}
|
|
202
250
|
|
|
203
251
|
}
|