@eclipse-glsp/protocol
Advanced tools
Comparing version 0.9.0-next.83b3785f to 0.9.0-next.884f860b
/******************************************************************************** | ||
* Copyright (c) 2020 EclipseSource and others. | ||
* Copyright (c) 2020-2021 EclipseSource and others. | ||
* | ||
@@ -16,3 +16,3 @@ * This program and the accompanying materials are made available under the | ||
********************************************************************************/ | ||
import { ActionMessage } from "sprotty"; | ||
import { ActionMessage } from 'sprotty'; | ||
export interface InitializeParameters { | ||
@@ -69,6 +69,2 @@ /** | ||
/** | ||
* Client name. | ||
*/ | ||
readonly name: string; | ||
/** | ||
* Current client state. | ||
@@ -87,3 +83,3 @@ */ | ||
*/ | ||
initializeServer(params: InitializeParameters): Promise<Boolean>; | ||
initializeServer(params: InitializeParameters): Promise<boolean>; | ||
/** | ||
@@ -113,3 +109,2 @@ * Send a `shutdown` notification to the server. | ||
id: string; | ||
name: string; | ||
} | ||
@@ -116,0 +111,0 @@ function isOptions(object: any): object is Options; |
@@ -51,4 +51,3 @@ "use strict"; | ||
function isOptions(object) { | ||
return object !== undefined && "id" in object && typeof object["id"] === "string" | ||
&& "name" in object && typeof object["name"] === "string"; | ||
return object !== undefined && 'id' in object && typeof object['id'] === 'string'; | ||
} | ||
@@ -55,0 +54,0 @@ GLSPClient.isOptions = isOptions; |
/******************************************************************************** | ||
* Copyright (c) 2019-2020 EclipseSource and others. | ||
* Copyright (c) 2019-2021 EclipseSource and others. | ||
* | ||
@@ -16,8 +16,7 @@ * This program and the accompanying materials are made available under the | ||
********************************************************************************/ | ||
import { ActionMessage } from "sprotty"; | ||
import { Message, MessageConnection } from "vscode-ws-jsonrpc"; | ||
import { ActionMessageHandler, ClientState, GLSPClient, InitializeParameters } from "../glsp-client"; | ||
import { ConnectionProvider, JsonrpcGLSPClient } from "./glsp-jsonrpc-client"; | ||
import { ActionMessage } from 'sprotty'; | ||
import { Message, MessageConnection } from 'vscode-ws-jsonrpc'; | ||
import { ActionMessageHandler, ClientState, GLSPClient, InitializeParameters } from '../glsp-client'; | ||
import { ConnectionProvider, JsonrpcGLSPClient } from './glsp-jsonrpc-client'; | ||
export declare class BaseJsonrpcGLSPClient implements GLSPClient { | ||
readonly name: string; | ||
readonly id: string; | ||
@@ -31,3 +30,3 @@ protected readonly connectionProvider: ConnectionProvider; | ||
shutdownServer(): void; | ||
initializeServer(params: InitializeParameters): Promise<Boolean>; | ||
initializeServer(params: InitializeParameters): Promise<boolean>; | ||
onActionMessage(handler: ActionMessageHandler): void; | ||
@@ -34,0 +33,0 @@ sendActionMessage(message: ActionMessage): void; |
@@ -16,6 +16,6 @@ /******************************************************************************** | ||
********************************************************************************/ | ||
import { ActionMessage } from "sprotty"; | ||
import { MessageConnection, NotificationType, RequestType } from "vscode-jsonrpc"; | ||
import { Logger, NotificationType0 } from "vscode-ws-jsonrpc"; | ||
import { GLSPClient, InitializeParameters } from "../glsp-client"; | ||
import { ActionMessage } from 'sprotty'; | ||
import { MessageConnection, NotificationType, RequestType } from 'vscode-jsonrpc'; | ||
import { Logger, NotificationType0 } from 'vscode-ws-jsonrpc'; | ||
import { GLSPClient, InitializeParameters } from '../glsp-client'; | ||
export declare type MaybePromise<T> = T | Promise<T> | PromiseLike<T>; | ||
@@ -29,3 +29,3 @@ export declare type ConnectionProvider = MessageConnection | (() => MaybePromise<MessageConnection>); | ||
const ActionMessageNotification: NotificationType<ActionMessage, void>; | ||
const InitializeRequest: RequestType<InitializeParameters, Boolean, void, void>; | ||
const InitializeRequest: RequestType<InitializeParameters, boolean, void, void>; | ||
const ShutdownNotification: NotificationType0<void>; | ||
@@ -32,0 +32,0 @@ const ClientNotReadyMsg = "JsonrpcGLSPClient is not ready yet"; |
@@ -10,3 +10,3 @@ "use strict"; | ||
function isOptions(object) { | ||
return glsp_client_1.GLSPClient.isOptions(object) && "connectionProvider" in object; | ||
return glsp_client_1.GLSPClient.isOptions(object) && 'connectionProvider' in object; | ||
} | ||
@@ -13,0 +13,0 @@ JsonrpcGLSPClient.isOptions = isOptions; |
@@ -25,3 +25,3 @@ "use strict"; | ||
function getPort(argsKey, defaultPort) { | ||
argsKey = "--" + argsKey.replace("--", "").replace("=", "") + "="; | ||
argsKey = "--" + argsKey.replace('--', '').replace('=', '') + "="; | ||
var args = process.argv.filter(function (a) { return a.startsWith(argsKey); }); | ||
@@ -28,0 +28,0 @@ if (args.length > 0) { |
{ | ||
"name": "@eclipse-glsp/protocol", | ||
"version": "0.9.0-next.83b3785f", | ||
"version": "0.9.0-next.884f860b", | ||
"description": "The protocol definition for client-server communication in GLSP", | ||
@@ -15,32 +15,22 @@ "license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)", | ||
], | ||
"homepage": "https://www.eclipse.org/glsp/", | ||
"bugs": "https://github.com/eclipse-glsp/glsp-client/issues", | ||
"files": [ | ||
"lib", | ||
"src" | ||
], | ||
"author": { | ||
"name": "Eclipse GLSP" | ||
}, | ||
"homepage": "https://www.eclipse.org/glsp/", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/eclipse-glsp/glsp-client.git" | ||
}, | ||
"bugs": "https://github.com/eclipse-glsp/glsp/issues", | ||
"contributors": [ | ||
{ | ||
"name": "Philip Langer", | ||
"email": "planger@eclipsesource.com", | ||
"url": "https://www.eclipsesource.com" | ||
}, | ||
{ | ||
"name": "Tobias Ortmayr", | ||
"email": "tortmayr@eclipsesource.com", | ||
"url": "https://www.eclipsesource.com" | ||
}, | ||
{ | ||
"name": "Martin Fleck", | ||
"email": "mfleck@eclipsesource.com", | ||
"url": "https://www.eclipsesource.com" | ||
"name": "Eclipse GLSP Project", | ||
"email": "glsp-dev@eclipse.org", | ||
"url": "https://projects.eclipse.org/projects/ecd.glsp" | ||
} | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/eclipse-glsp/glsp-client.git" | ||
}, | ||
"files": [ | ||
"lib", | ||
"src" | ||
], | ||
"dependencies": { | ||
@@ -54,10 +44,9 @@ "uuid": "7.0.3", | ||
"rimraf": "^2.6.1", | ||
"tslint": "^5.5.0", | ||
"typescript": "^3.9.2" | ||
}, | ||
"scripts": { | ||
"prepare": "yarn run clean && yarn run build", | ||
"prepare": "yarn clean && yarn build && yarn lint", | ||
"clean": "rimraf lib", | ||
"build": "tsc && yarn run lint", | ||
"lint": "tslint -c ../../tslint.json --project ./tsconfig.json", | ||
"build": "tsc", | ||
"lint": "eslint -c ./.eslintrc.js --ext .ts ./src", | ||
"watch": "tsc -w" | ||
@@ -64,0 +53,0 @@ }, |
/******************************************************************************** | ||
* Copyright (c) 2020 EclipseSource and others. | ||
* Copyright (c) 2020-2021 EclipseSource and others. | ||
* | ||
@@ -16,4 +16,4 @@ * This program and the accompanying materials are made available under the | ||
********************************************************************************/ | ||
import { ActionMessage } from "sprotty"; | ||
import * as uuid from "uuid"; | ||
import { ActionMessage } from 'sprotty'; | ||
import * as uuid from 'uuid'; | ||
@@ -29,3 +29,3 @@ export interface InitializeParameters<> { | ||
*/ | ||
options?: any | ||
options?: any; | ||
} | ||
@@ -83,7 +83,2 @@ | ||
/** | ||
* Client name. | ||
*/ | ||
readonly name: string; | ||
/** | ||
* Current client state. | ||
@@ -104,3 +99,3 @@ */ | ||
*/ | ||
initializeServer(params: InitializeParameters): Promise<Boolean>; | ||
initializeServer(params: InitializeParameters): Promise<boolean>; | ||
@@ -110,3 +105,3 @@ /** | ||
*/ | ||
shutdownServer(): void | ||
shutdownServer(): void; | ||
@@ -136,9 +131,7 @@ /** | ||
id: string; | ||
name: string; | ||
} | ||
export function isOptions(object: any): object is Options { | ||
return object !== undefined && "id" in object && typeof object["id"] === "string" | ||
&& "name" in object && typeof object["name"] === "string"; | ||
return object !== undefined && 'id' in object && typeof object['id'] === 'string'; | ||
} | ||
} |
/******************************************************************************** | ||
* Copyright (c) 2019-2020 EclipseSource and others. | ||
* Copyright (c) 2019-2021 EclipseSource and others. | ||
* | ||
@@ -16,11 +16,10 @@ * This program and the accompanying materials are made available under the | ||
********************************************************************************/ | ||
import { ActionMessage } from "sprotty"; | ||
import { Message, MessageConnection } from "vscode-ws-jsonrpc"; | ||
import { ActionMessage } from 'sprotty'; | ||
import { Message, MessageConnection } from 'vscode-ws-jsonrpc'; | ||
import { ActionMessageHandler, ClientState, GLSPClient, InitializeParameters } from "../glsp-client"; | ||
import { ConnectionProvider, JsonrpcGLSPClient } from "./glsp-jsonrpc-client"; | ||
import { ActionMessageHandler, ClientState, GLSPClient, InitializeParameters } from '../glsp-client'; | ||
import { ConnectionProvider, JsonrpcGLSPClient } from './glsp-jsonrpc-client'; | ||
export class BaseJsonrpcGLSPClient implements GLSPClient { | ||
readonly name: string; | ||
readonly id: string; | ||
@@ -44,3 +43,3 @@ protected readonly connectionProvider: ConnectionProvider; | ||
initializeServer(params: InitializeParameters): Promise<Boolean> { | ||
initializeServer(params: InitializeParameters): Promise<boolean> { | ||
if (this.checkConnectionState()) { | ||
@@ -47,0 +46,0 @@ return this.resolvedConnection!.sendRequest(JsonrpcGLSPClient.InitializeRequest, params); |
@@ -16,4 +16,4 @@ /******************************************************************************** | ||
********************************************************************************/ | ||
import { ActionMessage } from "sprotty"; | ||
import { MessageConnection, NotificationType, RequestType } from "vscode-jsonrpc"; | ||
import { ActionMessage } from 'sprotty'; | ||
import { MessageConnection, NotificationType, RequestType } from 'vscode-jsonrpc'; | ||
import { | ||
@@ -26,7 +26,6 @@ createMessageConnection, | ||
WebSocketMessageWriter | ||
} from "vscode-ws-jsonrpc"; | ||
} from 'vscode-ws-jsonrpc'; | ||
import { GLSPClient, InitializeParameters } from "../glsp-client"; | ||
import { GLSPClient, InitializeParameters } from '../glsp-client'; | ||
export type MaybePromise<T> = T | Promise<T> | PromiseLike<T>; | ||
@@ -41,7 +40,7 @@ export type ConnectionProvider = MessageConnection | (() => MaybePromise<MessageConnection>); | ||
export function isOptions(object: any): object is Options { | ||
return GLSPClient.isOptions(object) && "connectionProvider" in object; | ||
return GLSPClient.isOptions(object) && 'connectionProvider' in object; | ||
} | ||
export const ActionMessageNotification = new NotificationType<ActionMessage, void>('process'); | ||
export const InitializeRequest = new RequestType<InitializeParameters, Boolean, void, void>('initialize'); | ||
export const InitializeRequest = new RequestType<InitializeParameters, boolean, void, void>('initialize'); | ||
export const ShutdownNotification = new NotificationType0<void>('shutdown'); | ||
@@ -58,3 +57,2 @@ export const ClientNotReadyMsg = 'JsonrpcGLSPClient is not ready yet'; | ||
export function error(message: string, ...optionalParams: any[]): void { | ||
@@ -61,0 +59,0 @@ console.error(`[JsonrpcGLSPClient] ${message}`, optionalParams); |
@@ -23,3 +23,3 @@ /******************************************************************************** | ||
export function getPort(argsKey: string, defaultPort?: number): number { | ||
argsKey = `--${argsKey.replace("--", "").replace("=", "")}=`; | ||
argsKey = `--${argsKey.replace('--', '').replace('=', '')}=`; | ||
const args = process.argv.filter(a => a.startsWith(argsKey)); | ||
@@ -26,0 +26,0 @@ if (args.length > 0) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 4 instances in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 3 instances in 1 package
4
67769
9
886