{"name":"typescript-language-server","version":"0.4.0-dev.b361793","description":"Language Server Protocol (LSP) implementation for TypeScript using tsserver","author":{"name":"TypeFox and others"},"license":"Apache-2.0","repository":{"type":"git","url":"https://github.com/theia-ide/typescript-language-server.git"},"bin":{"typescript-language-server":"./lib/cli.js"},"dependencies":{"command-exists":"1.2.6","commander":"^2.11.0","fs-extra":"^7.0.0","p-debounce":"^1.0.0","tempy":"^0.2.1","vscode-languageserver":"^4.4.0","vscode-uri":"^1.0.5"},"scripts":{"prepare":"echo 'skip'","clean":"rimraf lib","test":"mocha --exit --reporter spec \"./lib/**/*.spec.js\"","lint":"tslint -c ../tslint.json --project ."},"devDependencies":{"@types/fs-extra":"^5.0.4","@types/p-debounce":"^1.0.0","@types/tempy":"^0.1.0"},"gitHead":"b3617931417ca190fea1784ab74ed2f594a0c80c","licenseText":"                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n","_id":"typescript-language-server@0.4.0-dev.b361793","dist":{"shasum":"ddd5a41095cbf3c4040e0ca674b61a8c10546b10","tarball":"http://registry-npm.ywwl.com/typescript-language-server/download/typescript-language-server-0.4.0-dev.b361793.tgz","integrity":"sha512-eBmVXJoThYFrxGMyd/fiPwV5lpIs0+fCZ9e1RQ/ZqOwEgyWlhoIwdHm+YHS7u61lLgrhplN0+7Frld0BGvYOew==","fileCount":104,"unpackedSize":263955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqF3rCRA9TVsSAnZWagAA+t0P/1QXwhqcu0wba9CjBCcw\nKNRrTchZqkmDw8VpN6/tJ1grth/6ZLIApzfOcFqP7xyQ8xZjrA35+y2pcoH7\nFGkj4pdDCkkIYUjTnofoz8cyAZhYh2oej7aoqSwV8iRuT8G73GsvgipHEtYh\nD1kEi85VXcOTjE82FSHSgzzuJtfV2pFcD2V+sNwVqsTgPHT0jCDXstbetJim\negK9Y09I3QwEcqzYKeEW3UV2Tji48YThastUG/vMviclgTX305zi1S2yzi58\nhcEcprAQ0kH1iabRv2FCpNE7nqDrZ/dFpSOy77zHpJZwnDljZGl5ZlgxB14X\naszvnta0I8S7Uemxlj3g1pMQP5uvzy3Q19+Os5FM0T49vRX/HLsF3CMcJSmL\nR3j5LysXVR228yy0+PwSF2rPAZMEPMq0ZJN2Bwgpn0K+80i+ujlN0XbVqXi8\nb0sdiXmYL0YsD9P9RHph4zixaHHWWzCfA/QbtaIjHiD9Ru3k/MT67nBvwyAn\nKr7i3WOGANpHz2jnuHM3rA7L19Y+llHzOxqZN1LIKVkIrDY5IXFt8hpLj0DF\nPJnEE4izCccKmHV8mH2te5spvx64hSqTm3NPO9zbPJ0qyQPHUtBWTDQDXL3r\nXZQqWgBPtDyiS8hmcFZe0s7/E87tR/LAyTfm0WAS/Zg3dyhyxLLFoRx3dPng\nhbvq\r\n=wf9z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICLI3Cu4nA+bO7UiQdeaVHR2YNaRZ88UIwekz78VHjoBAiAMujr2DqVWFLKwpCLCEpr6MN/pZbKtAkXTTKdAiQWKsA=="}],"size":56668,"noattachment":false,"key":"/typescript-language-server/-/typescript-language-server-0.4.0-dev.b361793.tgz"},"maintainers":[{"email":"mail@prabir.me","name":"prabir"},{"email":"sven.efftinge@typefox.io","name":"svenefftinge"}],"_npmUser":{"name":"theia","email":"theia@typefox.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typescript-language-server_0.4.0-dev.b361793_1537760744321_0.1768065432145296"},"_hasShrinkwrap":false,"readme":"[![Discord][discord-src]][discord-href]\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n\n# TypeScript Language Server\n\n[Language Server Protocol](https://github.com/Microsoft/language-server-protocol) implementation for TypeScript wrapping `tsserver`.\n\nBased on concepts and ideas from https://github.com/prabirshrestha/typescript-language-server and originally maintained by [TypeFox](https://typefox.io).\n\nMaintained by a [community of contributors](https://github.com/typescript-language-server/typescript-language-server/graphs/contributors) like you.\n\n<!-- MarkdownTOC -->\n\n- [Installing](#installing)\n- [Running the language server](#running-the-language-server)\n- [CLI Options](#cli-options)\n- [Configuration](#configuration)\n- [Features](#features)\n    - [Code actions on save](#code-actions-on-save)\n    - [Workspace commands \\(`workspace/executeCommand`\\)](#workspace-commands-workspaceexecutecommand)\n        - [Go to Source Definition](#go-to-source-definition)\n        - [Apply Workspace Edits](#apply-workspace-edits)\n        - [Apply Code Action](#apply-code-action)\n        - [Apply Refactoring](#apply-refactoring)\n        - [Organize Imports](#organize-imports)\n        - [Rename File](#rename-file)\n        - [Configure plugin](#configure-plugin)\n    - [Code Lenses \\(`textDocument/codeLens`\\)](#code-lenses-textdocumentcodelens)\n    - [Inlay hints \\(`textDocument/inlayHint`\\)](#inlay-hints-textdocumentinlayhint)\n    - [TypeScript Version Notification](#typescript-version-notification)\n- [Development](#development)\n    - [Build](#build)\n    - [Dev](#dev)\n    - [Test](#test)\n    - [Publishing](#publishing)\n\n<!-- /MarkdownTOC -->\n\n## Installing\n\n```sh\nnpm install -g typescript-language-server typescript\n```\n\n## Running the language server\n\n```\ntypescript-language-server --stdio\n```\n\n## CLI Options\n\n```\n  Usage: typescript-language-server [options]\n\n\n  Options:\n\n    -V, --version                          output the version number\n    --stdio                                use stdio (required option)\n    --log-level <log-level>                A number indicating the log level (4 = log, 3 = info, 2 = warn, 1 = error). Defaults to `3`.\n    -h, --help                             output usage information\n```\n\n## Configuration\n\nSee [configuration documentation](./docs/configuration.md).\n\n## Features\n\n### Code actions on save\n\nServer announces support for the following code action kinds:\n\n - `source.fixAll.ts` - despite the name, fixes a couple of specific issues: unreachable code, await in non-async functions, incorrectly implemented interface\n - `source.removeUnused.ts` - removes declared but unused variables\n - `source.addMissingImports.ts` - adds imports for used but not imported symbols\n - `source.removeUnusedImports.ts` - removes unused imports\n - `source.sortImports.ts` - sorts imports\n - `source.organizeImports.ts` - organizes and removes unused imports\n\nThis allows editors that support running code actions on save to automatically run fixes associated with those kinds.\n\nThose code actions, if they apply in the current code, should also be presented in the list of \"Source Actions\" if the editor exposes those.\n\nThe user can enable it with a setting similar to (can vary per-editor):\n\n```js\n\"codeActionsOnSave\": {\n    \"source.organizeImports.ts\": true,\n    // or just\n    \"source.organizeImports\": true,\n}\n```\n\n### Workspace commands (`workspace/executeCommand`)\n\nSee [LSP specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_executeCommand).\n\nMost of the time, you'll execute commands with arguments retrieved from another request like `textDocument/codeAction`. There are some use cases for calling them manually.\n\n`lsp` refers to the language server protocol types, `tsp` refers to the typescript server protocol types.\n\n#### Go to Source Definition\n\n- Request:\n    ```ts\n    {\n        command: `_typescript.goToSourceDefinition`\n        arguments: [\n            lsp.DocumentUri,  // String URI of the document\n            lsp.Position,     // Line and character position (zero-based)\n        ]\n    }\n    ```\n- Response:\n    ```ts\n    lsp.Location[] | null\n    ```\n\n(This command is supported from Typescript 4.7.)\n\n#### Apply Workspace Edits\n\n- Request:\n    ```ts\n    {\n        command: `_typescript.applyWorkspaceEdit`\n        arguments: [lsp.WorkspaceEdit]\n    }\n    ```\n- Response:\n    ```ts\n    lsp.ApplyWorkspaceEditResult\n    ```\n\n#### Apply Code Action\n\n- Request:\n    ```ts\n    {\n        command: `_typescript.applyCodeAction`\n        arguments: [\n            tsp.CodeAction,  // TypeScript Code Action object\n        ]\n    }\n    ```\n- Response:\n    ```ts\n    void\n    ```\n\n#### Apply Refactoring\n\n- Request:\n    ```ts\n    {\n        command: `_typescript.applyRefactoring`\n        arguments: [\n            tsp.GetEditsForRefactorRequestArgs,\n        ]\n    }\n    ```\n- Response:\n    ```ts\n    void\n    ```\n\n#### Organize Imports\n\n- Request:\n    ```ts\n    {\n        command: `_typescript.organizeImports`\n        arguments: [\n            // The \"skipDestructiveCodeActions\" argument is supported from Typescript 4.4+\n            [string] | [string, { skipDestructiveCodeActions?: boolean }],\n        ]\n    }\n    ```\n- Response:\n    ```ts\n    void\n    ```\n\n#### Rename File\n\n- Request:\n    ```ts\n    {\n        command: `_typescript.applyRenameFile`\n        arguments: [\n            { sourceUri: string; targetUri: string; },\n        ]\n    }\n    ```\n- Response:\n    ```ts\n    void\n    ```\n\n#### Configure plugin\n\n- Request:\n    ```ts\n    {\n        command: `_typescript.configurePlugin`\n        arguments: [pluginName: string, configuration: any]\n    }\n    ```\n- Response:\n    ```ts\n    void\n    ```\n\n### Code Lenses (`textDocument/codeLens`)\n\nCode lenses can be enabled using the `implementationsCodeLens` and `referencesCodeLens` [workspace configuration options](/docs/configuration.md/#workspacedidchangeconfiguration).\n\nCode lenses provide a count of **references** and/or **implemenations** for symbols in the document. For clients that support it it's also possible to click on those to navigate to the relevant locations in the the project. Do note that clicking those trigger a `editor.action.showReferences` command which is something that client needs to have explicit support for. Many do by default but some don't. An example command will look like this:\n\n```ts\ncommand: {\n    title: '1 reference',\n    command: 'editor.action.showReferences',\n    arguments: [\n        'file://project/foo.ts',    // URI\n        { line: 1, character: 1 },  // Position\n        [                           // A list of Location objects.\n            {\n                uri: 'file://project/bar.ts',\n                range: {\n                    start: {\n                        line: 7,\n                        character: 24,\n                    },\n                    end: {\n                        line: 7,\n                        character: 28,\n                    },\n                },\n            },\n        ],\n    ],\n}\n```\n\n### Inlay hints (`textDocument/inlayHint`)\n\nFor the request to return any results, some or all of the following options need to be enabled through `preferences`:\n\n```ts\nexport interface InlayHintsOptions extends UserPreferences {\n    includeInlayParameterNameHints: 'none' | 'literals' | 'all';\n    includeInlayParameterNameHintsWhenArgumentMatchesName: boolean;\n    includeInlayFunctionParameterTypeHints: boolean;\n    includeInlayVariableTypeHints: boolean;\n    includeInlayVariableTypeHintsWhenTypeMatchesName: boolean;\n    includeInlayPropertyDeclarationTypeHints: boolean;\n    includeInlayFunctionLikeReturnTypeHints: boolean;\n    includeInlayEnumMemberValueHints: boolean;\n}\n```\n\n### TypeScript Version Notification\n\nRight after initializing, the server sends a custom `$/typescriptVersion` notification that carries information about the version of TypeScript that is utilized by the server. The editor can then display that information in the UI.\n\nThe `$/typescriptVersion` notification params include two properties:\n\n - `version` - a semantic version (for example `4.8.4`)\n - `source` - a string specifying whether used TypeScript version comes from the local workspace (`workspace`), is explicitly specified through a `initializationOptions.tsserver.path` setting (`user-setting`) or was bundled with the server (`bundled`)\n\n## Development\n\n### Build\n\n```sh\nyarn build\n```\n\n### Dev\n\nBuild and rebuild on change.\n\n```sh\nyarn dev\n```\n\n### Test\n\n - `yarn test` - run all tests in watch mode for developing\n - `yarn test:commit` - run all tests once\n\nBy default only console logs of level `warning` and higher are printed to the console. You can override the `CONSOLE_LOG_LEVEL` level in `package.json` to either `log`, `info`, `warning` or `error` to log other levels.\n\n### Publishing\n\nThe project uses https://github.com/google-github-actions/release-please-action Github action to automatically release new version on merging a release PR.\n\n[npm-version-src]: https://img.shields.io/npm/dt/typescript-language-server.svg?style=flat-square\n[npm-version-href]: https://npmjs.com/package/typescript-language-server\n[npm-downloads-src]: https://img.shields.io/npm/v/typescript-language-server/latest.svg?style=flat-square\n[npm-downloads-href]: https://npmjs.com/package/typescript-language-server\n[discord-src]: https://img.shields.io/discord/873659987413573634?style=flat-square\n[discord-href]: https://discord.gg/AC7Vs6hwFa\n","publish_time":1537760747101,"_cnpm_publish_time":1537760747101,"dist-tags":{"latest":"6.0.3","logs":"3.3.3-0"}}