vscode-jsonrpc
Advanced tools
Comparing version 4.0.0 to 4.1.0-next.1
@@ -40,3 +40,3 @@ /*--------------------------------------------------------------------------------------------- | ||
this._emitter.fire(undefined); | ||
this._emitter = undefined; | ||
this.dispose(); | ||
} | ||
@@ -57,2 +57,8 @@ } | ||
} | ||
dispose() { | ||
if (this._emitter) { | ||
this._emitter.dispose(); | ||
this._emitter = undefined; | ||
} | ||
} | ||
} | ||
@@ -80,5 +86,12 @@ class CancellationTokenSource { | ||
dispose() { | ||
this.cancel(); | ||
if (!this._token) { | ||
// ensure to initialize with an empty token if we had none | ||
this._token = CancellationToken.None; | ||
} | ||
else if (this._token instanceof MutableToken) { | ||
// actually dispose | ||
this._token.dispose(); | ||
} | ||
} | ||
} | ||
exports.CancellationTokenSource = CancellationTokenSource; |
@@ -124,3 +124,3 @@ /* -------------------------------------------------------------------------------------------- | ||
else { | ||
return new Error(`Reader recevied error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`); | ||
return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`); | ||
} | ||
@@ -176,3 +176,3 @@ } | ||
if (msg === null) { | ||
/** We haven't recevied the full message yet. */ | ||
/** We haven't received the full message yet. */ | ||
this.setPartialMessageTimer(); | ||
@@ -179,0 +179,0 @@ return; |
@@ -38,2 +38,3 @@ /** | ||
const RequestCancelled: number; | ||
const ContentModified: number; | ||
const MessageWriteError: number; | ||
@@ -76,6 +77,6 @@ const MessageReadError: number; | ||
/** | ||
* The result of a request. This can be omitted in | ||
* the case of an error. | ||
* The result of a request. This member is REQUIRED on success. | ||
* This member MUST NOT exist if there was an error invoking the method. | ||
*/ | ||
result?: any; | ||
result?: string | number | boolean | object | null; | ||
/** | ||
@@ -82,0 +83,0 @@ * The error object in case a request fails. |
@@ -25,2 +25,3 @@ /* -------------------------------------------------------------------------------------------- | ||
ErrorCodes.RequestCancelled = -32800; | ||
ErrorCodes.ContentModified = -32801; | ||
// Defined by VSCode library. | ||
@@ -27,0 +28,0 @@ ErrorCodes.MessageWriteError = 1; |
@@ -46,3 +46,3 @@ /* -------------------------------------------------------------------------------------------- | ||
else { | ||
return new Error(`Writer recevied error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`); | ||
return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`); | ||
} | ||
@@ -49,0 +49,0 @@ } |
{ | ||
"name": "vscode-jsonrpc", | ||
"description": "A json rpc implementation over streams", | ||
"version": "4.0.0", | ||
"version": "4.1.0-next.1", | ||
"author": "Microsoft Corporation", | ||
@@ -9,3 +9,4 @@ "license": "MIT", | ||
"type": "git", | ||
"url": "https://github.com/Microsoft/vscode-languageserver-node.git" | ||
"url": "https://github.com/Microsoft/vscode-languageserver-node.git", | ||
"directory": "jsonrpc" | ||
}, | ||
@@ -12,0 +13,0 @@ "bugs": { |
@@ -23,3 +23,3 @@ # VSCode JSON RPC | ||
let notification = new NotificationType<string, void>('testNotification'); | ||
let notification = new rpc.NotificationType<string, void>('testNotification'); | ||
@@ -41,3 +41,3 @@ connection.listen(); | ||
let notification = new NotificationType<string, void>('testNotification'); | ||
let notification = new rpc.NotificationType<string, void>('testNotification'); | ||
connection.onNotification(notification, (param: string) => { | ||
@@ -66,2 +66,2 @@ console.log(param); // This prints Hello World | ||
## License | ||
[MIT](https://github.com/Microsoft/vscode-languageserver-node/blob/master/License.txt) | ||
[MIT](https://github.com/Microsoft/vscode-languageserver-node/blob/master/License.txt) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119136
2911
65
2