@eclipse-glsp/client
Version:
A sprotty-based client for GLSP
48 lines • 3.36 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.hoverModule = void 0;
/********************************************************************************
* Copyright (c) 2020-2024 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the Eclipse
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
* with the GNU Classpath Exception which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
const sprotty_1 = require("@eclipse-glsp/sprotty");
const focus_state_change_action_1 = require("../../base/focus/focus-state-change-action");
const tool_1 = require("../../base/tool-manager/tool");
const hover_1 = require("./hover");
exports.hoverModule = new sprotty_1.FeatureModule((bind, _unbind, isBound) => {
const context = { bind, isBound };
(0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.PopupVNodePostprocessor, sprotty_1.PopupPositionUpdater);
(0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.MouseListener, hover_1.GlspHoverMouseListener);
(0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.PopupMouseListener, sprotty_1.PopupHoverMouseListener);
(0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.KeyListener, sprotty_1.HoverKeyListener);
bind(sprotty_1.TYPES.HoverState).toConstantValue({
mouseOverTimer: undefined,
mouseOutTimer: undefined,
popupOpen: false,
previousPopupElement: undefined
});
bind(sprotty_1.ClosePopupActionHandler).toSelf().inSingletonScope();
(0, sprotty_1.configureCommand)(context, sprotty_1.HoverFeedbackCommand);
(0, sprotty_1.configureCommand)(context, sprotty_1.SetPopupModelCommand);
(0, sprotty_1.configureActionHandler)(context, sprotty_1.SetPopupModelCommand.KIND, sprotty_1.ClosePopupActionHandler);
(0, sprotty_1.configureActionHandler)(context, sprotty_1.FitToScreenCommand.KIND, sprotty_1.ClosePopupActionHandler);
(0, sprotty_1.configureActionHandler)(context, sprotty_1.CenterCommand.KIND, sprotty_1.ClosePopupActionHandler);
(0, sprotty_1.configureActionHandler)(context, sprotty_1.SetViewportCommand.KIND, sprotty_1.ClosePopupActionHandler);
(0, sprotty_1.configureActionHandler)(context, sprotty_1.MoveCommand.KIND, sprotty_1.ClosePopupActionHandler);
(0, sprotty_1.configureActionHandler)(context, focus_state_change_action_1.FocusStateChangedAction.KIND, sprotty_1.ClosePopupActionHandler);
(0, sprotty_1.configureActionHandler)(context, tool_1.EnableToolsAction.KIND, hover_1.GlspHoverMouseListener);
(0, sprotty_1.configureActionHandler)(context, tool_1.EnableDefaultToolsAction.KIND, hover_1.GlspHoverMouseListener);
(0, sprotty_1.configureActionHandler)(context, focus_state_change_action_1.FocusStateChangedAction.KIND, hover_1.GlspHoverMouseListener);
}, { featureId: Symbol('hover') });
//# sourceMappingURL=hover-module.js.map