UNPKG

@eclipse-glsp/protocol

Version:

The protocol definition for client-server communication in GLSP

54 lines 2.42 kB
"use strict"; /******************************************************************************** * Copyright (c) 2021-2023 STMicroelectronics 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 ********************************************************************************/ Object.defineProperty(exports, "__esModule", { value: true }); exports.SetContextActions = exports.RequestContextActions = void 0; const type_util_1 = require("../utils/type-util"); const base_protocol_1 = require("./base-protocol"); var RequestContextActions; (function (RequestContextActions) { RequestContextActions.KIND = 'requestContextActions'; function is(object) { return base_protocol_1.RequestAction.hasKind(object, RequestContextActions.KIND) && (0, type_util_1.hasStringProp)(object, 'contextId') && (0, type_util_1.hasObjectProp)(object, 'editorContext'); } RequestContextActions.is = is; function create(options) { return { kind: RequestContextActions.KIND, requestId: '', ...options }; } RequestContextActions.create = create; })(RequestContextActions || (exports.RequestContextActions = RequestContextActions = {})); var SetContextActions; (function (SetContextActions) { SetContextActions.KIND = 'setContextActions'; function is(object) { return base_protocol_1.Action.hasKind(object, SetContextActions.KIND) && (0, type_util_1.hasArrayProp)(object, 'actions'); } SetContextActions.is = is; function create(actions, options = {}) { return { kind: SetContextActions.KIND, responseId: '', actions, ...options }; } SetContextActions.create = create; })(SetContextActions || (exports.SetContextActions = SetContextActions = {})); //# sourceMappingURL=contexts.js.map