From 1354a94d0485be873942f5025e33011dfe96ee65 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Mon, 20 Jun 2022 08:48:58 +0200 Subject: [PATCH] First dev release of vscode-ws-jsonrpc from this repository - Aligened code with node 16 api - Moved CHANGELOGs to packages and the top-level one links to them - Aligned tsconfigs --- CHANGELOG.md | 305 +---------------- package-lock.json | 84 +++-- packages/client/CHANGELOG.md | 306 ++++++++++++++++++ packages/client/package.json | 5 +- packages/client/tsconfig.json | 7 +- packages/examples/client/package.json | 2 +- packages/examples/client/src/client.ts | 2 +- packages/examples/node/package.json | 2 +- .../examples/node/src/json-server-launcher.ts | 22 +- packages/examples/node/src/server.ts | 2 +- packages/vscode-ws-jsonrpc/CHANGELOG.md | 7 + packages/vscode-ws-jsonrpc/README.md | 10 +- packages/vscode-ws-jsonrpc/package.json | 13 +- .../vscode-ws-jsonrpc/src/server/launch.ts | 20 +- packages/vscode-ws-jsonrpc/tsconfig.json | 39 +-- tsconfig.json | 2 + 16 files changed, 446 insertions(+), 382 deletions(-) create mode 100644 packages/client/CHANGELOG.md create mode 100644 packages/vscode-ws-jsonrpc/CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md index a66fcdb01..666c4aef0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,306 +1,9 @@ # Changelog -All notable changes to this project will be documented in this file. +All notable changes for `monaco-languageclient` are found here: -## [2.0.0] - Not yet release +./packages/client/CHANGELOG.md -* TBA +All notable changes for `vscode-ws-jsonrpc` are found here: -## [1.1.0] - 2022-06-08 - -* feat(package.json): export monaco-converter #[376](https://github.com/TypeFox/monaco-languageclient/pull/376) -* Clean unregistered featured from registration requests #[372](https://github.com/TypeFox/monaco-languageclient/pull/372) -* Introduce global engines entries for node and npm #[370](https://github.com/TypeFox/monaco-languageclient/pull/370) -* Implement missing 3.17 api #[364](https://github.com/TypeFox/monaco-languageclient/pull/364) -* Remove unsupported features #[362](https://github.com/TypeFox/monaco-languageclient/pull/362) -* Do not include node code #[361](https://github.com/TypeFox/monaco-languageclient/pull/361) - -## [1.0.1] - 2022-05-21 - -* Add some typing on the code/proto converters [#359](https://github.com/TypeFox/monaco-languageclient/pull/359) -* Fix to vite 2.9.6 for now - -## [1.0.0] - 2022-05-20 - -* Switch to npm workspace and vite and thereby drop yarn, lerna and webpack [#340](https://github.com/TypeFox/monaco-languageclient/pull/340) - * Restructure project: All code is moved to packages directory - * Update and clean-up all dependencies - * Use monaco-editor in examples instead of monaco-editor-core - * README was fully revised - * Bugfixes resulting from this: - * fix: Fix vscode-compatibility using webpack [#342](https://github.com/TypeFox/monaco-languageclient/pull/342) - * Use ts-node for example [#344](https://github.com/TypeFox/monaco-languageclient/pull/344) - * Update README.md [#345](https://github.com/TypeFox/monaco-languageclient/pull/345) - * Integrate webpack client example as second option [#353](https://github.com/TypeFox/monaco-languageclient/pull/353) -* Make monaco workspace disposable [#330](https://github.com/TypeFox/monaco-languageclient/pull/330) -* Update the protocol to version 3.17 [#350](https://github.com/TypeFox/monaco-languageclient/pull/350) -* Fix code action diagnostics [#352](https://github.com/TypeFox/monaco-languageclient/pull/352) -* Fix resolving, never overwrite by undefined [#354](https://github.com/TypeFox/monaco-languageclient/pull/354) -* The `connectionProvider` now expects a `MessageTransports` instead of a `MessageConnection` -* Bump version to 1.0.0 - -## [0.18.1] - 2022-03-21 - -* Fix vscode api enum [#333](https://github.com/TypeFox/monaco-languageclient/pull/333) - -## [0.18.0] - 2022-03-15 - -* Update to monaco 0.33 & vscode 1.65 [#329](https://github.com/TypeFox/monaco-languageclient/pull/329) -* Updated minor versions of vscode-languageserver-textdocument and vscode-uri and removed engines entry from client - -## [0.17.4] - 2022-02-22 (2022-03-08) - -* First released as @codingame/monaco-languageclient@0.17.4 on specified date -* Release of monaco-languageclient@0.17.4 was made available on date in brackets -* Register providers using the document selector directly [#317](https://github.com/TypeFox/monaco-languageclient/pull/317) - -## [0.17.3] - 2021-12-21 (2022-02-23) - -* First released as @codingame/monaco-languageclient@0.17.3 on specified date -* Release of monaco-languageclient@0.17.3 was made available on date in brackets -* Releases `0.17.1` and `0.17.2` were mistakes -* Fix various issues: outdated api, missing stuff in compatibility-api... [#309](https://github.com/TypeFox/monaco-languageclient/pull/309) - -## [0.17.0] - 2021-11-10 (2022-02-23) - -* First released as @codingame/monaco-languageclient@0.17.0 on specified date -* Release of monaco-languageclient@0.17.0 was made available on date in brackets -* Update to monaco 0.30.1 [#301](https://github.com/TypeFox/monaco-languageclient/pull/301) - -## [0.16.1] - 2021-11-03 (2022-02-23) - -* First released as @codingame/monaco-languageclient@0.16.1 on specified date -* Release of monaco-languageclient@0.16.1 was made available on date in brackets -* Fix dropped tags in Diagnostic -> IMarkerData [#297](https://github.com/TypeFox/monaco-languageclient/pull/297) -* Missing protocol convention [#298](https://github.com/TypeFox/monaco-languageclient/pull/298) - -## [0.16.0] - 2021-10-11 (2022-02-23) - -* First released as @codingame/monaco-languageclient@0.16.0 on specified date -* Release of monaco-languageclient@0.15.1 was made available on date in brackets -* Updated `monaco-editor-core` version to `0.29.0` -* Async resolve code actions [#294](https://github.com/TypeFox/monaco-languageclient/pull/294) - -## [0.15.1] - 2021-09-20 (2022-02-23) - -* First released as @codingame/monaco-languageclient@0.15.1 on specified date -* Release of monaco-languageclient@0.15.1 was made available on date in brackets -* Resolve code actions [#290](https://github.com/TypeFox/monaco-languageclient/pull/290) -* Release `0.15.0` was skipped - -## [0.14.0] - 2021-08-05 (2022-02-23) - -* First released as @codingame/monaco-languageclient@0.14.0 on specified date -* Release of monaco-languageclient@0.14.0 was made available on date in brackets -* Upgraded to Monaco 0.22.3 - -### Breaking changes - -* `MonacoServices` now takes the `monaco` object instead of the `CommandRegistry` - -before: - -```typescript -MonacoServices.install(require('monaco-editor-core/esm/vs/platform/commands/common/commands').CommandsRegistry); -``` - -after: - -```typescript -import * as monaco from 'monaco-editor-core' - -MonacoServices.install(monaco); -``` - -* `MonacoServices` should now be installed using the command registry instead of the editor - -before: - -```typescript -const editor = monaco.editor.create(...); -MonacoServices.install(editor); -``` - -after: - -```typescript -MonacoServices.install(require('monaco-editor-core/esm/vs/platform/commands/common/commands').CommandsRegistry); -``` - -## [0.13.0] - 2020-04-06 - -* Upgraded to vscode-uri 2.x [741a3df](https://github.com/TypeFox/monaco-languageclient/commit/741a3dfb865eff55c3dcc4a51f74759921d3f2a5) - -## [0.12.0] - 2020-03-19 - -* Upgraded to Monaco 0.19.1 [#199](https://github.com/TypeFox/monaco-languageclient/pull/199) - -## [0.11.0] - 2020-01-23 - -* Upgraded to Monaco 0.18.1 [#178](https://github.com/TypeFox/monaco-languageclient/pull/178) - -## [0.10.2] - 2019-09-10 - -* register language features regardless whether a language is registered () - -## [0.10.1] - 2019-09-04 - -* aligned CompletionItemKind with Monaco 0.17.0 [#174](https://github.com/TypeFox/monaco-languageclient/pull/174) - -## [0.10.0] - 2019-08-26 - -* upgraded to LSP 5.3.0 and Monaco 0.17.0 - -### Breaking changes - -Switch to es6 from es5. For clients who cannot migrate to es6 please use babel to transpile Monaco and LSP to es5. - -* to configure babel wit webpack: - -```js - { - test: /\\.js$/, - // include only es6 dependencies to transpile them to es5 classes - include: /monaco-languageclient|monaco-jsonrpc|vscode-jsonrpc|vscode-languageserver-protocol|vscode-languageserver-types|vscode-languageclient/, - use: { - loader: 'babel-loader', - options: { - presets: ['@babel/preset-env'], - plugins: [ - // reuse runtime babel lib instead of generating it in each js file - '@babel/plugin-transform-runtime', - // ensure that classes are transpiled - '@babel/plugin-transform-classes' - ], - // see https://github.com/babel/babel/issues/8900#issuecomment-431240426 - sourceType: 'unambiguous', - cacheDirectory: true - } - } - } -``` - -## [0.9.0] - 2018-09-06 - -* use monaco-editor-core as a dev dependency to allow alternative implementations [#119](https://github.com/TypeFox/monaco-languageclient/pull/119) - -### Breaking changes - -Clients have to explicitly declare a dependency to `monaco-editor-core` or another package providing Monaco: - -* `monaco-editor-core` is tree shaked to get rid of unused VS Code's code. -* [@typefox/monaco-editor-core](https://www.npmjs.com/package/@typefox/monaco-editor-core) is a not tree-shaked alternative. - -## [0.8.0] - 2018-09-04 - -* updated dependency to Monaco 0.14.x, with adaptation for breaking changes from monaco [#107](https://github.com/TypeFox/monaco-languageclient/pull/107) - thanks to [@Twinside](https://github.com/Twinside) -* ensure that SignatureHelp and SignatureHelp has non-null arrays [#112](https://github.com/TypeFox/monaco-languageclient/pull/112) - thanks to [@rcjsuen](https://github.com/rcjsuen) - -## [0.7.3] - 2018-08-30 - -* fixed folding ranges conversion - [12d8c91](https://github.com/TypeFox/monaco-languageclient/commit/12d8c91cf1676061c44d43e745b7500c77ea4a14) -* implement `toJSON` for workspace configurations - [9e50a48](https://github.com/TypeFox/monaco-languageclient/commit/9e50a48addb474be66fa317684461976eda45192) -* fixed markdown conversion [#103](https://github.com/TypeFox/monaco-languageclient/pull/103) - -## [0.7.2] - 2018-08-02 - -* amd distribution ([#97](https://github.com/TypeFox/monaco-languageclient/pull/97)) - thanks to [@zewa666](https://github.com/zewa666) -* updated dependency to Monaco 0.13.2 ([#100](https://github.com/TypeFox/monaco-languageclient/pull/100)) -* register providers only for languages matching the documentSelector ([#101](https://github.com/TypeFox/monaco-languageclient/pull/101)) - thanks to [@gins3000](https://github.com/gins3000) - -## [0.7.0] - 2018-07-31 - -Updated to `vscode-languageclient` 4.4.0 to support LSP 3.10.0 features like hierarchical document symbols, go to type defition/implementation, workspace folders and document color provider ([#89](https://github.com/TypeFox/monaco-languageclient/pull/89)). - -### Breaking changes - -In order to use `vscode-languageclient` directly the compatibility layer was implemented for subset of `vscode` APIs used by the client: - -* `vscode-compatibility` should be used as an implementation of `vscode` module at the runtime - * to adjust module resolution with `webpack`: - - ```js - resolve: { - alias: { - 'vscode': require.resolve('monaco-languageclient/lib/vscode-compatibility') - } - } - ``` - - * `register-vscode` should be required once to adjust module resolution with `Node.js`, for example to stub `vscode` APIs for Mocha tests: - - ``` - --require monaco-languageclient/lib/register-vscode - ``` - -* `MonacoLanguageClient` should be used instead of `BaseLanguageClient` -* `MonacoServices` should be installed globally to be accessible for `vscode-compatibility` module, not per a language client - * for the use case with a single standalone editor: - - ```ts - import { MonacoServices } from 'monaco-languageclient'; - - MonacoServices.install(editor); - ``` - - * to support sophisticated use cases one can install custom Monaco services: - - ```ts - import { MonacoServices, Services } from 'monaco-languageclient'; - - const services: MonacoServices = { - worspace, languages, commands, window - }; - Services.install(services); - ``` - -## [0.6.0] - 2018-04-18 - -* updated dependency to Monaco 0.12 ([#70](https://github.com/TypeFox/monaco-languageclient/pull/70)) -* support `CompletionItem`'s `additionalTextEdits` property ([#39](https://github.com/TypeFox/monaco-languageclient/issues/39)) -* convert `monaco.MarkerSeverity.Hint` values to `DiagnosticSeverity.Hint` ([#71](https://github.com/TypeFox/monaco-languageclient/pull/71)) - -## [0.4.0] - 2018-02-13 - -* add support for `textDocument/documentLink` and `documentLink/resolve` ([#53](https://github.com/TypeFox/monaco-languageclient/issues/53)) -* state that `workspace/applyEdit` is supported in the capabilities ([#55](https://github.com/TypeFox/monaco-languageclient/pull/55)) -* state that versioned changes are supported in a `WorkspaceEdit` ([#56](https://github.com/TypeFox/monaco-languageclient/pull/56)) -* replaced `monaco-editor` with `monaco-editor-core` ([#58](https://github.com/TypeFox/monaco-languageclient/pull/58)) - -## [0.3.0] - 2018-02-08 - -* fix handling of `codeLens/resolve` if no provider exists ([#46](https://github.com/TypeFox/monaco-languageclient/pull/46)) -* removed `monaco-editor-core` dependency, keeping only `monaco-editor` ([#42](https://github.com/TypeFox/monaco-languageclient/issues/42)) -* fix typings in `glob-to-regexp`([#49](https://github.com/TypeFox/monaco-languageclient/pull/49)) - -## [0.2.1] - 2018-01-14 - -* allow a `rootUri` to be set with `createMonacoServices` ([#31](https://github.com/TypeFox/monaco-languageclient/issues/31)) - -## [0.2.0] - 2017-08-30 - -* handle `number` value of zero in a `Diagnostic`'s `code` ([#14](https://github.com/TypeFox/monaco-languageclient/pull/14)) -* add support to lazily load Monaco ([#19](https://github.com/TypeFox/monaco-languageclient/pull/19)) -* add support for `textDocument/codeActions` and `workspace/executeCommand` ([#21](https://github.com/TypeFox/monaco-languageclient/pull/21)) -* updated dependency to Monaco 0.10 ([#29](https://github.com/TypeFox/monaco-languageclient/pull/29)) - -## 0.1.0 - 2017-0 - -* initial 0.1.0 release, depends on Monaco 0.9.0 - -[0.13.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.12.0...v0.13.0 -[0.12.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.11.0...v0.12.0 -[0.11.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.10.2...v0.11.0 -[0.10.2]: https://github.com/TypeFox/monaco-languageclient/compare/v0.10.1...v0.10.2 -[0.10.1]: https://github.com/TypeFox/monaco-languageclient/compare/v0.10.0...v0.10.1 -[0.10.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.9.0...v0.10.0 -[0.9.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.8.0...v0.9.0 -[0.8.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.7.3...v0.8.0 -[0.7.3]: https://github.com/TypeFox/monaco-languageclient/compare/v0.7.2...v0.7.3 -[0.7.2]: https://github.com/TypeFox/monaco-languageclient/compare/v0.7.0...v0.7.2 -[0.7.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.6.3...v0.7.0 -[0.6.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.4.0...v0.6.1 -[0.4.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.3.0...v0.4.0 -[0.3.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.2.1...v0.3.0 -[0.2.1]: https://github.com/TypeFox/monaco-languageclient/compare/v0.2.0...v0.2.1 -[0.2.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.1.0...v0.2.0 +./packages/vscode-ws-jsonrpc/CHANGELOG.md diff --git a/package-lock.json b/package-lock.json index 6da8ef0b9..05a75817a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,6 +6,7 @@ "": { "workspaces": [ "packages/client", + "packages/vscode-ws-jsonrpc", "packages/examples/node", "packages/examples/client", "packages/examples/browser-lsp", @@ -24,14 +25,6 @@ "npm": ">=7.10.0" } }, - "node_modules/@codingame/monaco-jsonrpc": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@codingame/monaco-jsonrpc/-/monaco-jsonrpc-0.4.0.tgz", - "integrity": "sha512-5IQkYvFMyWQWutFhK77Tk5q1VIQoFySElqpAI1fUWXIIAepiYD7xJRawzMgJqhIzER7t44FbBN4uVvoXLRmJ6g==", - "dependencies": { - "vscode-jsonrpc": "^8.0.1" - } - }, "node_modules/@cspotcode/source-map-consumer": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", @@ -3199,6 +3192,10 @@ "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.3.tgz", "integrity": "sha512-EcswR2S8bpR7fD0YPeS7r2xXExrScVMxg4MedACaWHEtx9ftCF/qHG1xGkolzTPcEmjTavCQgbVzHUIdTMzFGA==" }, + "node_modules/vscode-ws-jsonrpc": { + "resolved": "packages/vscode-ws-jsonrpc", + "link": true + }, "node_modules/watchpack": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", @@ -3467,7 +3464,7 @@ "version": "2.0.0-dev.1", "license": "MIT", "dependencies": { - "glob-to-regexp": "^0.4.1", + "glob-to-regexp": "0.4.1", "vscode": "npm:@codingame/monaco-vscode-api@^1.68.0", "vscode-jsonrpc": "8.0.1", "vscode-languageclient": "8.0.1", @@ -3476,10 +3473,16 @@ }, "devDependencies": { "@types/glob-to-regexp": "^0.4.1", - "@types/node": "^16.11.7", + "@types/node": "16.11.7", "@types/vscode": "1.68.0" } }, + "packages/client/node_modules/@types/node": { + "version": "16.11.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.7.tgz", + "integrity": "sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==", + "dev": true + }, "packages/examples/browser": { "name": "browser-example", "dependencies": { @@ -3510,11 +3513,11 @@ "packages/examples/client": { "name": "example-client", "dependencies": { - "@codingame/monaco-jsonrpc": "^0.4.0", "monaco-editor": "0.33.0", "monaco-editor-workers": "0.33.0", "monaco-languageclient": "../../client", - "normalize-url": "^7.0.3" + "normalize-url": "^7.0.3", + "vscode-ws-jsonrpc": "../../vscode-ws-jsonrpc" }, "devDependencies": { "css-loader": "^6.7.1", @@ -3530,7 +3533,6 @@ "packages/examples/node": { "name": "node-example", "dependencies": { - "@codingame/monaco-jsonrpc": "^0.4.0", "@types/ws": "^8.5.3", "express": "^4.17.3", "normalize-url": "^7.0.3", @@ -3538,6 +3540,7 @@ "vscode-json-languageservice": "^5.0.0", "vscode-languageserver": "8.0.1", "vscode-uri": "^3.0.3", + "vscode-ws-jsonrpc": "../../vscode-ws-jsonrpc", "ws": "^8.5.0" }, "devDependencies": { @@ -3545,17 +3548,25 @@ "@types/node": "^16.11.7", "ts-node": "^10.7.0" } - } - }, - "dependencies": { - "@codingame/monaco-jsonrpc": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@codingame/monaco-jsonrpc/-/monaco-jsonrpc-0.4.0.tgz", - "integrity": "sha512-5IQkYvFMyWQWutFhK77Tk5q1VIQoFySElqpAI1fUWXIIAepiYD7xJRawzMgJqhIzER7t44FbBN4uVvoXLRmJ6g==", - "requires": { + }, + "packages/vscode-ws-jsonrpc": { + "version": "0.5.0-dev.0", + "license": "MIT", + "dependencies": { "vscode-jsonrpc": "^8.0.1" + }, + "devDependencies": { + "@types/node": "16.11.7" } }, + "packages/vscode-ws-jsonrpc/node_modules/@types/node": { + "version": "16.11.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.7.tgz", + "integrity": "sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==", + "dev": true + } + }, + "dependencies": { "@cspotcode/source-map-consumer": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", @@ -4488,7 +4499,6 @@ "example-client": { "version": "file:packages/examples/client", "requires": { - "@codingame/monaco-jsonrpc": "^0.4.0", "css-loader": "^6.7.1", "file-loader": "^6.2.0", "http-server": "^14.1.0", @@ -4500,6 +4510,7 @@ "source-map-loader": "^3.0.1", "style-loader": "^3.3.1", "ts-loader": "^9.3.0", + "vscode-ws-jsonrpc": "../../vscode-ws-jsonrpc", "webpack-cli": "^4.9.2" } }, @@ -5069,14 +5080,22 @@ "version": "file:packages/client", "requires": { "@types/glob-to-regexp": "^0.4.1", - "@types/node": "^16.11.7", + "@types/node": "16.11.7", "@types/vscode": "1.68.0", - "glob-to-regexp": "^0.4.1", + "glob-to-regexp": "0.4.1", "vscode": "npm:@codingame/monaco-vscode-api@^1.68.0", "vscode-jsonrpc": "8.0.1", "vscode-languageclient": "8.0.1", "vscode-languageserver-textdocument": "1.0.5", "vscode-uri": "3.0.3" + }, + "dependencies": { + "@types/node": { + "version": "16.11.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.7.tgz", + "integrity": "sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==", + "dev": true + } } }, "ms": { @@ -5105,7 +5124,6 @@ "node-example": { "version": "file:packages/examples/node", "requires": { - "@codingame/monaco-jsonrpc": "^0.4.0", "@types/express": "^4.17.13", "@types/node": "^16.11.7", "@types/ws": "^8.5.3", @@ -5116,6 +5134,7 @@ "vscode-json-languageservice": "^5.0.0", "vscode-languageserver": "8.0.1", "vscode-uri": "^3.0.3", + "vscode-ws-jsonrpc": "../../vscode-ws-jsonrpc", "ws": "^8.5.0" } }, @@ -6003,6 +6022,21 @@ "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.3.tgz", "integrity": "sha512-EcswR2S8bpR7fD0YPeS7r2xXExrScVMxg4MedACaWHEtx9ftCF/qHG1xGkolzTPcEmjTavCQgbVzHUIdTMzFGA==" }, + "vscode-ws-jsonrpc": { + "version": "file:packages/vscode-ws-jsonrpc", + "requires": { + "@types/node": "16.11.7", + "vscode-jsonrpc": "^8.0.1" + }, + "dependencies": { + "@types/node": { + "version": "16.11.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.7.tgz", + "integrity": "sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==", + "dev": true + } + } + }, "watchpack": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md new file mode 100644 index 000000000..92186a052 --- /dev/null +++ b/packages/client/CHANGELOG.md @@ -0,0 +1,306 @@ +# Changelog + +All notable changes to this npm module are documented in this file. + +## [2.0.0] - Not yet release + +* TBA + +## [1.1.0] - 2022-06-08 + +* feat(package.json): export monaco-converter #[376](https://github.com/TypeFox/monaco-languageclient/pull/376) +* Clean unregistered featured from registration requests #[372](https://github.com/TypeFox/monaco-languageclient/pull/372) +* Introduce global engines entries for node and npm #[370](https://github.com/TypeFox/monaco-languageclient/pull/370) +* Implement missing 3.17 api #[364](https://github.com/TypeFox/monaco-languageclient/pull/364) +* Remove unsupported features #[362](https://github.com/TypeFox/monaco-languageclient/pull/362) +* Do not include node code #[361](https://github.com/TypeFox/monaco-languageclient/pull/361) + +## [1.0.1] - 2022-05-21 + +* Add some typing on the code/proto converters [#359](https://github.com/TypeFox/monaco-languageclient/pull/359) +* Fix to vite 2.9.6 for now + +## [1.0.0] - 2022-05-20 + +* Switch to npm workspace and vite and thereby drop yarn, lerna and webpack [#340](https://github.com/TypeFox/monaco-languageclient/pull/340) + * Restructure project: All code is moved to packages directory + * Update and clean-up all dependencies + * Use monaco-editor in examples instead of monaco-editor-core + * README was fully revised + * Bugfixes resulting from this: + * fix: Fix vscode-compatibility using webpack [#342](https://github.com/TypeFox/monaco-languageclient/pull/342) + * Use ts-node for example [#344](https://github.com/TypeFox/monaco-languageclient/pull/344) + * Update README.md [#345](https://github.com/TypeFox/monaco-languageclient/pull/345) + * Integrate webpack client example as second option [#353](https://github.com/TypeFox/monaco-languageclient/pull/353) +* Make monaco workspace disposable [#330](https://github.com/TypeFox/monaco-languageclient/pull/330) +* Update the protocol to version 3.17 [#350](https://github.com/TypeFox/monaco-languageclient/pull/350) +* Fix code action diagnostics [#352](https://github.com/TypeFox/monaco-languageclient/pull/352) +* Fix resolving, never overwrite by undefined [#354](https://github.com/TypeFox/monaco-languageclient/pull/354) +* The `connectionProvider` now expects a `MessageTransports` instead of a `MessageConnection` +* Bump version to 1.0.0 + +## [0.18.1] - 2022-03-21 + +* Fix vscode api enum [#333](https://github.com/TypeFox/monaco-languageclient/pull/333) + +## [0.18.0] - 2022-03-15 + +* Update to monaco 0.33 & vscode 1.65 [#329](https://github.com/TypeFox/monaco-languageclient/pull/329) +* Updated minor versions of vscode-languageserver-textdocument and vscode-uri and removed engines entry from client + +## [0.17.4] - 2022-02-22 (2022-03-08) + +* First released as @codingame/monaco-languageclient@0.17.4 on specified date +* Release of monaco-languageclient@0.17.4 was made available on date in brackets +* Register providers using the document selector directly [#317](https://github.com/TypeFox/monaco-languageclient/pull/317) + +## [0.17.3] - 2021-12-21 (2022-02-23) + +* First released as @codingame/monaco-languageclient@0.17.3 on specified date +* Release of monaco-languageclient@0.17.3 was made available on date in brackets +* Releases `0.17.1` and `0.17.2` were mistakes +* Fix various issues: outdated api, missing stuff in compatibility-api... [#309](https://github.com/TypeFox/monaco-languageclient/pull/309) + +## [0.17.0] - 2021-11-10 (2022-02-23) + +* First released as @codingame/monaco-languageclient@0.17.0 on specified date +* Release of monaco-languageclient@0.17.0 was made available on date in brackets +* Update to monaco 0.30.1 [#301](https://github.com/TypeFox/monaco-languageclient/pull/301) + +## [0.16.1] - 2021-11-03 (2022-02-23) + +* First released as @codingame/monaco-languageclient@0.16.1 on specified date +* Release of monaco-languageclient@0.16.1 was made available on date in brackets +* Fix dropped tags in Diagnostic -> IMarkerData [#297](https://github.com/TypeFox/monaco-languageclient/pull/297) +* Missing protocol convention [#298](https://github.com/TypeFox/monaco-languageclient/pull/298) + +## [0.16.0] - 2021-10-11 (2022-02-23) + +* First released as @codingame/monaco-languageclient@0.16.0 on specified date +* Release of monaco-languageclient@0.15.1 was made available on date in brackets +* Updated `monaco-editor-core` version to `0.29.0` +* Async resolve code actions [#294](https://github.com/TypeFox/monaco-languageclient/pull/294) + +## [0.15.1] - 2021-09-20 (2022-02-23) + +* First released as @codingame/monaco-languageclient@0.15.1 on specified date +* Release of monaco-languageclient@0.15.1 was made available on date in brackets +* Resolve code actions [#290](https://github.com/TypeFox/monaco-languageclient/pull/290) +* Release `0.15.0` was skipped + +## [0.14.0] - 2021-08-05 (2022-02-23) + +* First released as @codingame/monaco-languageclient@0.14.0 on specified date +* Release of monaco-languageclient@0.14.0 was made available on date in brackets +* Upgraded to Monaco 0.22.3 + +### Breaking changes + +* `MonacoServices` now takes the `monaco` object instead of the `CommandRegistry` + +before: + +```typescript +MonacoServices.install(require('monaco-editor-core/esm/vs/platform/commands/common/commands').CommandsRegistry); +``` + +after: + +```typescript +import * as monaco from 'monaco-editor-core' + +MonacoServices.install(monaco); +``` + +* `MonacoServices` should now be installed using the command registry instead of the editor + +before: + +```typescript +const editor = monaco.editor.create(...); +MonacoServices.install(editor); +``` + +after: + +```typescript +MonacoServices.install(require('monaco-editor-core/esm/vs/platform/commands/common/commands').CommandsRegistry); +``` + +## [0.13.0] - 2020-04-06 + +* Upgraded to vscode-uri 2.x [741a3df](https://github.com/TypeFox/monaco-languageclient/commit/741a3dfb865eff55c3dcc4a51f74759921d3f2a5) + +## [0.12.0] - 2020-03-19 + +* Upgraded to Monaco 0.19.1 [#199](https://github.com/TypeFox/monaco-languageclient/pull/199) + +## [0.11.0] - 2020-01-23 + +* Upgraded to Monaco 0.18.1 [#178](https://github.com/TypeFox/monaco-languageclient/pull/178) + +## [0.10.2] - 2019-09-10 + +* register language features regardless whether a language is registered () + +## [0.10.1] - 2019-09-04 + +* aligned CompletionItemKind with Monaco 0.17.0 [#174](https://github.com/TypeFox/monaco-languageclient/pull/174) + +## [0.10.0] - 2019-08-26 + +* upgraded to LSP 5.3.0 and Monaco 0.17.0 + +### Breaking changes + +Switch to es6 from es5. For clients who cannot migrate to es6 please use babel to transpile Monaco and LSP to es5. + +* to configure babel wit webpack: + +```js + { + test: /\\.js$/, + // include only es6 dependencies to transpile them to es5 classes + include: /monaco-languageclient|monaco-jsonrpc|vscode-jsonrpc|vscode-languageserver-protocol|vscode-languageserver-types|vscode-languageclient/, + use: { + loader: 'babel-loader', + options: { + presets: ['@babel/preset-env'], + plugins: [ + // reuse runtime babel lib instead of generating it in each js file + '@babel/plugin-transform-runtime', + // ensure that classes are transpiled + '@babel/plugin-transform-classes' + ], + // see https://github.com/babel/babel/issues/8900#issuecomment-431240426 + sourceType: 'unambiguous', + cacheDirectory: true + } + } + } +``` + +## [0.9.0] - 2018-09-06 + +* use monaco-editor-core as a dev dependency to allow alternative implementations [#119](https://github.com/TypeFox/monaco-languageclient/pull/119) + +### Breaking changes + +Clients have to explicitly declare a dependency to `monaco-editor-core` or another package providing Monaco: + +* `monaco-editor-core` is tree shaked to get rid of unused VS Code's code. +* [@typefox/monaco-editor-core](https://www.npmjs.com/package/@typefox/monaco-editor-core) is a not tree-shaked alternative. + +## [0.8.0] - 2018-09-04 + +* updated dependency to Monaco 0.14.x, with adaptation for breaking changes from monaco [#107](https://github.com/TypeFox/monaco-languageclient/pull/107) - thanks to [@Twinside](https://github.com/Twinside) +* ensure that SignatureHelp and SignatureHelp has non-null arrays [#112](https://github.com/TypeFox/monaco-languageclient/pull/112) - thanks to [@rcjsuen](https://github.com/rcjsuen) + +## [0.7.3] - 2018-08-30 + +* fixed folding ranges conversion - [12d8c91](https://github.com/TypeFox/monaco-languageclient/commit/12d8c91cf1676061c44d43e745b7500c77ea4a14) +* implement `toJSON` for workspace configurations - [9e50a48](https://github.com/TypeFox/monaco-languageclient/commit/9e50a48addb474be66fa317684461976eda45192) +* fixed markdown conversion [#103](https://github.com/TypeFox/monaco-languageclient/pull/103) + +## [0.7.2] - 2018-08-02 + +* amd distribution ([#97](https://github.com/TypeFox/monaco-languageclient/pull/97)) - thanks to [@zewa666](https://github.com/zewa666) +* updated dependency to Monaco 0.13.2 ([#100](https://github.com/TypeFox/monaco-languageclient/pull/100)) +* register providers only for languages matching the documentSelector ([#101](https://github.com/TypeFox/monaco-languageclient/pull/101)) - thanks to [@gins3000](https://github.com/gins3000) + +## [0.7.0] - 2018-07-31 + +Updated to `vscode-languageclient` 4.4.0 to support LSP 3.10.0 features like hierarchical document symbols, go to type defition/implementation, workspace folders and document color provider ([#89](https://github.com/TypeFox/monaco-languageclient/pull/89)). + +### Breaking changes + +In order to use `vscode-languageclient` directly the compatibility layer was implemented for subset of `vscode` APIs used by the client: + +* `vscode-compatibility` should be used as an implementation of `vscode` module at the runtime + * to adjust module resolution with `webpack`: + + ```js + resolve: { + alias: { + 'vscode': require.resolve('monaco-languageclient/lib/vscode-compatibility') + } + } + ``` + + * `register-vscode` should be required once to adjust module resolution with `Node.js`, for example to stub `vscode` APIs for Mocha tests: + + ``` + --require monaco-languageclient/lib/register-vscode + ``` + +* `MonacoLanguageClient` should be used instead of `BaseLanguageClient` +* `MonacoServices` should be installed globally to be accessible for `vscode-compatibility` module, not per a language client + * for the use case with a single standalone editor: + + ```ts + import { MonacoServices } from 'monaco-languageclient'; + + MonacoServices.install(editor); + ``` + + * to support sophisticated use cases one can install custom Monaco services: + + ```ts + import { MonacoServices, Services } from 'monaco-languageclient'; + + const services: MonacoServices = { + worspace, languages, commands, window + }; + Services.install(services); + ``` + +## [0.6.0] - 2018-04-18 + +* updated dependency to Monaco 0.12 ([#70](https://github.com/TypeFox/monaco-languageclient/pull/70)) +* support `CompletionItem`'s `additionalTextEdits` property ([#39](https://github.com/TypeFox/monaco-languageclient/issues/39)) +* convert `monaco.MarkerSeverity.Hint` values to `DiagnosticSeverity.Hint` ([#71](https://github.com/TypeFox/monaco-languageclient/pull/71)) + +## [0.4.0] - 2018-02-13 + +* add support for `textDocument/documentLink` and `documentLink/resolve` ([#53](https://github.com/TypeFox/monaco-languageclient/issues/53)) +* state that `workspace/applyEdit` is supported in the capabilities ([#55](https://github.com/TypeFox/monaco-languageclient/pull/55)) +* state that versioned changes are supported in a `WorkspaceEdit` ([#56](https://github.com/TypeFox/monaco-languageclient/pull/56)) +* replaced `monaco-editor` with `monaco-editor-core` ([#58](https://github.com/TypeFox/monaco-languageclient/pull/58)) + +## [0.3.0] - 2018-02-08 + +* fix handling of `codeLens/resolve` if no provider exists ([#46](https://github.com/TypeFox/monaco-languageclient/pull/46)) +* removed `monaco-editor-core` dependency, keeping only `monaco-editor` ([#42](https://github.com/TypeFox/monaco-languageclient/issues/42)) +* fix typings in `glob-to-regexp`([#49](https://github.com/TypeFox/monaco-languageclient/pull/49)) + +## [0.2.1] - 2018-01-14 + +* allow a `rootUri` to be set with `createMonacoServices` ([#31](https://github.com/TypeFox/monaco-languageclient/issues/31)) + +## [0.2.0] - 2017-08-30 + +* handle `number` value of zero in a `Diagnostic`'s `code` ([#14](https://github.com/TypeFox/monaco-languageclient/pull/14)) +* add support to lazily load Monaco ([#19](https://github.com/TypeFox/monaco-languageclient/pull/19)) +* add support for `textDocument/codeActions` and `workspace/executeCommand` ([#21](https://github.com/TypeFox/monaco-languageclient/pull/21)) +* updated dependency to Monaco 0.10 ([#29](https://github.com/TypeFox/monaco-languageclient/pull/29)) + +## 0.1.0 - 2017-0 + +* initial 0.1.0 release, depends on Monaco 0.9.0 + +[0.13.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.12.0...v0.13.0 +[0.12.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.11.0...v0.12.0 +[0.11.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.10.2...v0.11.0 +[0.10.2]: https://github.com/TypeFox/monaco-languageclient/compare/v0.10.1...v0.10.2 +[0.10.1]: https://github.com/TypeFox/monaco-languageclient/compare/v0.10.0...v0.10.1 +[0.10.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.9.0...v0.10.0 +[0.9.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.8.0...v0.9.0 +[0.8.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.7.3...v0.8.0 +[0.7.3]: https://github.com/TypeFox/monaco-languageclient/compare/v0.7.2...v0.7.3 +[0.7.2]: https://github.com/TypeFox/monaco-languageclient/compare/v0.7.0...v0.7.2 +[0.7.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.6.3...v0.7.0 +[0.6.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.4.0...v0.6.1 +[0.4.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.3.0...v0.4.0 +[0.3.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.2.1...v0.3.0 +[0.2.1]: https://github.com/TypeFox/monaco-languageclient/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/TypeFox/monaco-languageclient/compare/v0.1.0...v0.2.0 diff --git a/packages/client/package.json b/packages/client/package.json index 5816e89e3..df7c744e8 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -45,7 +45,10 @@ "files": [ "dist/amd", "lib", - "src" + "src", + "README.md", + "CHANGELOG.md", + "License.txt" ], "dependencies": { "glob-to-regexp": "0.4.1", diff --git a/packages/client/tsconfig.json b/packages/client/tsconfig.json index 9c2ac9f1c..e225925dc 100644 --- a/packages/client/tsconfig.json +++ b/packages/client/tsconfig.json @@ -4,19 +4,14 @@ "rootDir": "src", "outDir": "lib", "declarationDir": "lib", - "noUnusedParameters": false, "target": "es2020", "module": "es2020", "moduleResolution": "node", - "inlineSources": false, - "stripInternal": true, "lib": [ "es2016", "dom" ], - "strict": true, - "noImplicitReturns": true, - "noUnusedLocals": true + "noUnusedParameters": false }, "include": [ "src/**/*" diff --git a/packages/examples/client/package.json b/packages/examples/client/package.json index 217e93a51..06c6ec14d 100644 --- a/packages/examples/client/package.json +++ b/packages/examples/client/package.json @@ -2,7 +2,7 @@ "name": "example-client", "private": true, "dependencies": { - "vscode-ws-jsonrpc": "^0.5.0-dev.0", + "vscode-ws-jsonrpc": "../../vscode-ws-jsonrpc", "monaco-editor": "0.33.0", "monaco-editor-workers": "0.33.0", "monaco-languageclient": "../../client", diff --git a/packages/examples/client/src/client.ts b/packages/examples/client/src/client.ts index 438551656..397bbc2ac 100644 --- a/packages/examples/client/src/client.ts +++ b/packages/examples/client/src/client.ts @@ -22,7 +22,7 @@ import { buildWorkerDefinition } from 'monaco-editor-workers'; buildWorkerDefinition('dist', new URL('', window.location.href).href, false); import { MonacoLanguageClient, CloseAction, ErrorAction, MonacoServices, MessageTransports } from 'monaco-languageclient'; -import { toSocket, WebSocketMessageReader, WebSocketMessageWriter } from '@codingame/monaco-jsonrpc'; +import { toSocket, WebSocketMessageReader, WebSocketMessageWriter } from 'vscode-ws-jsonrpc'; import normalizeUrl from 'normalize-url'; // register Monaco languages diff --git a/packages/examples/node/package.json b/packages/examples/node/package.json index 8922c9706..aa098269b 100644 --- a/packages/examples/node/package.json +++ b/packages/examples/node/package.json @@ -2,7 +2,7 @@ "name": "node-example", "private": true, "dependencies": { - "vscode-ws-jsonrpc": "^0.5.0-dev.0", + "vscode-ws-jsonrpc": "../../vscode-ws-jsonrpc", "@types/ws": "^8.5.3", "express": "^4.17.3", "normalize-url": "^7.0.3", diff --git a/packages/examples/node/src/json-server-launcher.ts b/packages/examples/node/src/json-server-launcher.ts index 6e5dbe3f4..7e2942324 100644 --- a/packages/examples/node/src/json-server-launcher.ts +++ b/packages/examples/node/src/json-server-launcher.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ import * as path from 'path'; -import * as rpc from "@codingame/monaco-jsonrpc"; -import * as server from "@codingame/monaco-jsonrpc/lib/server"; +import * as rpc from "vscode-ws-jsonrpc"; +import * as server from "vscode-ws-jsonrpc/lib/server"; import * as lsp from "vscode-languageserver"; import { start } from "./json-server"; import { Message } from 'vscode-languageserver'; @@ -18,15 +18,17 @@ export function launch(socket: rpc.IWebSocket) { const extJsonServerPath = path.resolve(__dirname, 'ext-json-server.js'); const socketConnection = server.createConnection(reader, writer, () => socket.dispose()); const serverConnection = server.createServerProcess('JSON', 'node', [extJsonServerPath]); - server.forward(socketConnection, serverConnection, message => { - if (Message.isRequest(message)) { - if (message.method === lsp.InitializeRequest.type.method) { - const initializeParams = message.params as lsp.InitializeParams; - initializeParams.processId = process.pid; + if (serverConnection) { + server.forward(socketConnection, serverConnection, message => { + if (Message.isRequest(message)) { + if (message.method === lsp.InitializeRequest.type.method) { + const initializeParams = message.params as lsp.InitializeParams; + initializeParams.processId = process.pid; + } } - } - return message; - }); + return message; + }); + } } else { // start the language server inside the current process start(reader, writer); diff --git a/packages/examples/node/src/server.ts b/packages/examples/node/src/server.ts index 5c211ae99..0451191c8 100644 --- a/packages/examples/node/src/server.ts +++ b/packages/examples/node/src/server.ts @@ -7,7 +7,7 @@ import * as http from "http"; import * as url from "url"; import * as net from "net"; import express from "express"; -import * as rpc from "@codingame/monaco-jsonrpc"; +import * as rpc from "vscode-ws-jsonrpc"; import { launch } from "./json-server-launcher"; process.on('uncaughtException', function (err: any) { diff --git a/packages/vscode-ws-jsonrpc/CHANGELOG.md b/packages/vscode-ws-jsonrpc/CHANGELOG.md new file mode 100644 index 000000000..87e3ca1c7 --- /dev/null +++ b/packages/vscode-ws-jsonrpc/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +All notable changes to this npm module are documented in this file. + +## [0.5.0-dev.0] - 2022-06-17 + +* Merged npm packages `@codingame/monaco-jsonrpc` and `vscode-ws-jsonrpc` into this package. diff --git a/packages/vscode-ws-jsonrpc/README.md b/packages/vscode-ws-jsonrpc/README.md index 784009815..3d10a1839 100644 --- a/packages/vscode-ws-jsonrpc/README.md +++ b/packages/vscode-ws-jsonrpc/README.md @@ -1,7 +1,9 @@ # VSCode WebSocket JSON RPC + NPM module to implement communication between a jsonrpc client and server over WebSocket. -### Client side connection handling +## Client side connection handling + ```ts import * as rpc from 'vscode-ws-jsonrpc'; @@ -16,7 +18,8 @@ rpc.listen({ }); ``` -### Server side connection handling +## Server side connection handling + ```ts import * as rpc from 'vscode-ws-jsonrpc'; @@ -33,7 +36,8 @@ connection.onNotification(notification, (param: string) => { connection.listen(); ``` -### Server side connection forwarding +## Server side connection forwarding + ```ts import * as rpc from 'vscode-ws-jsonrpc'; import * as server from 'vscode-ws-jsonrpc/lib/server'; diff --git a/packages/vscode-ws-jsonrpc/package.json b/packages/vscode-ws-jsonrpc/package.json index 2268482e0..34e32d13f 100644 --- a/packages/vscode-ws-jsonrpc/package.json +++ b/packages/vscode-ws-jsonrpc/package.json @@ -12,7 +12,14 @@ "url": "https://github.com/TypeFox/monaco-languageclient/issues" }, "main": "./lib/index.js", - "typings": "./lib/index", + "types": "./lib/index.d.ts", + "files": [ + "lib", + "src", + "README.md", + "CHANGELOG.md", + "License.txt" + ], "dependencies": { "vscode-jsonrpc": "^8.0.1" }, @@ -20,10 +27,10 @@ "@types/node": "16.11.7" }, "scripts": { - "prepublish": "npm run compile", + "clean": "npx shx rm -fr lib tsconfig.tsbuildinfo", "compile": "tsc", "watch": "tsc -w", - "clean": "rimraf lib" + "build": "npm run clean && npm run compile" }, "homepage": "https://github.com/TypeFox/vscode-ws-jsonrpc/blob/main/packages/vscode-ws-jsonrpc/README.md", "directories": { diff --git a/packages/vscode-ws-jsonrpc/src/server/launch.ts b/packages/vscode-ws-jsonrpc/src/server/launch.ts index b9c86f78d..838da62a4 100644 --- a/packages/vscode-ws-jsonrpc/src/server/launch.ts +++ b/packages/vscode-ws-jsonrpc/src/server/launch.ts @@ -10,14 +10,16 @@ import { StreamMessageReader, StreamMessageWriter, SocketMessageReader, SocketMe import { IConnection, createConnection } from "./connection"; import { IWebSocket, WebSocketMessageReader, WebSocketMessageWriter, IWebSocketConnection } from '../socket'; -export function createServerProcess(serverName: string, command: string, args?: string[], options?: cp.SpawnOptions): IConnection { - const serverProcess = cp.spawn(command, args, options); +export function createServerProcess(serverName: string, command: string, args?: string[], options?: cp.SpawnOptions): IConnection | undefined { + const serverProcess = cp.spawn(command, args || [], options || {}); serverProcess.on('error', error => console.error(`Launching ${serverName} Server failed: ${error}`) ); - serverProcess.stderr.on('data', data => - console.error(`${serverName} Server: ${data}`) - ); + if (serverProcess.stderr !== null) { + serverProcess.stderr.on('data', data => + console.error(`${serverName} Server: ${data}`) + ); + } return createProcessStreamConnection(serverProcess); } @@ -37,8 +39,12 @@ export function createSocketConnection(outSocket: net.Socket, inSocket: net.Sock return createConnection(reader, writer, onDispose); } -export function createProcessStreamConnection(process: cp.ChildProcess): IConnection { - return createStreamConnection(process.stdout, process.stdin, () => process.kill()); +export function createProcessStreamConnection(process: cp.ChildProcess): IConnection | undefined { + if (process.stdout !== null && process.stdin !== null) { + return createStreamConnection(process.stdout, process.stdin, () => process.kill()); + } else { + return undefined; + } } export function createStreamConnection(outStream: stream.Readable, inStream: stream.Writable, onDispose: () => void): IConnection { diff --git a/packages/vscode-ws-jsonrpc/tsconfig.json b/packages/vscode-ws-jsonrpc/tsconfig.json index 34d4d91a2..2749d9ac4 100644 --- a/packages/vscode-ws-jsonrpc/tsconfig.json +++ b/packages/vscode-ws-jsonrpc/tsconfig.json @@ -1,23 +1,18 @@ { - "compilerOptions": { - "target": "es6", - "module": "commonjs", - "moduleResolution": "node", - "sourceMap": true, - "inlineSources": false, - "declaration": true, - "stripInternal": true, - "lib": [ - "es2016", "dom" - ], - "outDir": "lib", - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": true - }, - "include": [ - "src" - ] -} \ No newline at end of file + "extends": "../../tsconfig", + "compilerOptions": { + "rootDir": "src", + "outDir": "lib", + "declarationDir": "lib", + "target": "ES2017", + "module": "commonjs", + "moduleResolution": "node", + "lib": [ + "es2016", + "dom" + ], + }, + "include": [ + "src" + ] +} diff --git a/tsconfig.json b/tsconfig.json index 6de5a0f39..8508a4151 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,6 +13,8 @@ "declaration": true, "declarationMap": true, "sourceMap": true, + "inlineSources": false, + "stripInternal": true, "strict": true, "strictPropertyInitialization": false, "importHelpers": true,