UNPKG

2.15 kBJavaScriptView Raw
1"use strict";
2// *****************************************************************************
3// Copyright (C) 2018 Red Hat, Inc. and others.
4//
5// This program and the accompanying materials are made available under the
6// terms of the Eclipse Public License v. 2.0 which is available at
7// http://www.eclipse.org/legal/epl-2.0.
8//
9// This Source Code may also be made available under the following Secondary
10// Licenses when the conditions for such availability set forth in the Eclipse
11// Public License v. 2.0 are satisfied: GNU General Public License, version 2
12// with the GNU Classpath Exception which is available at
13// https://www.gnu.org/software/classpath/license.html.
14//
15// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16// *****************************************************************************
17var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18 if (k2 === undefined) k2 = k;
19 Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20}) : (function(o, m, k, k2) {
21 if (k2 === undefined) k2 = k;
22 o[k2] = m[k];
23}));
24var __exportStar = (this && this.__exportStar) || function(m, exports) {
25 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26};
27Object.defineProperty(exports, "__esModule", { value: true });
28exports.NavigatableWidgetOpenHandler = void 0;
29const widget_open_handler_1 = require("./widget-open-handler");
30__exportStar(require("./navigatable-types"), exports);
31class NavigatableWidgetOpenHandler extends widget_open_handler_1.WidgetOpenHandler {
32 createWidgetOptions(uri, options) {
33 return {
34 kind: 'navigatable',
35 uri: this.serializeUri(uri)
36 };
37 }
38 serializeUri(uri) {
39 if (uri.scheme === 'file') {
40 return uri.withoutFragment().normalizePath().toString();
41 }
42 else {
43 return uri.withoutFragment().toString();
44 }
45 }
46}
47exports.NavigatableWidgetOpenHandler = NavigatableWidgetOpenHandler;
48//# sourceMappingURL=navigatable.js.map
\No newline at end of file