├── .eslintignore ├── .eslintrc.base.json ├── .eslintrc.json ├── .gitattributes ├── .github ├── commands.yml ├── locker.yml └── needs_more_info.yml ├── .gitignore ├── .lsifrc.json ├── .tsconfigrc.js ├── .vscode ├── launch.json ├── settings.json └── tasks.json ├── License.txt ├── README.md ├── SECURITY.md ├── azure-pipelines.yml ├── build ├── azure-pipelines │ ├── darwin │ │ └── build.yml │ ├── linux │ │ ├── build.yml │ │ └── xvfb.init │ ├── pipeline.yml │ ├── templates │ │ ├── pack-steps.yml │ │ └── test-steps.yml │ └── win32 │ │ └── build.yml ├── bin │ ├── all.js │ ├── fix-esm.js │ ├── linking.js │ ├── runBrowserTests.js │ ├── symlink-client-tests-publish.js │ ├── symlink-testbed.js │ ├── symlink-tests.js │ ├── symlink.js │ ├── tsc.js │ └── webpack.js └── npm │ ├── fail.js │ └── post-publish.js ├── client-node-tests ├── .eslintignore ├── .eslintrc.json ├── .mocharc.json ├── bin │ └── runTests.js ├── extension.js ├── package-lock.json ├── package.json ├── src │ ├── converter.test.ts │ ├── helpers.test.ts │ ├── index.ts │ ├── integration.test.ts │ ├── memoryFileSystemProvider.ts │ ├── runTests.ts │ ├── servers │ │ ├── crashOnShutdownServer.ts │ │ ├── crashServer.ts │ │ ├── customServer.ts │ │ ├── fullNotebookServer.ts │ │ ├── nullServer.ts │ │ ├── simpleNotebookServer.ts │ │ ├── startStopServer.ts │ │ ├── testServer.ts │ │ └── timeoutOnShutdownServer.ts │ ├── tsconfig.json │ ├── tsconfig.publish.json │ ├── tsconfig.watch.json │ └── workspaceFolder.test.ts ├── tsconfig.json ├── tsconfig.publish.json └── tsconfig.watch.json ├── client ├── .eslintignore ├── .eslintrc.json ├── .npmignore ├── License.txt ├── README.md ├── bin │ └── updateVSCode.js ├── package-lock.json ├── package.json ├── src │ ├── browser │ │ ├── main.ts │ │ ├── tsconfig.json │ │ ├── tsconfig.publish.json │ │ └── tsconfig.watch.json │ ├── common │ │ ├── api.ts │ │ ├── callHierarchy.ts │ │ ├── client.ts │ │ ├── codeAction.ts │ │ ├── codeConverter.ts │ │ ├── codeLens.ts │ │ ├── colorProvider.ts │ │ ├── completion.ts │ │ ├── configuration.ts │ │ ├── declaration.ts │ │ ├── definition.ts │ │ ├── diagnostic.ts │ │ ├── documentHighlight.ts │ │ ├── documentLink.ts │ │ ├── documentSymbol.ts │ │ ├── executeCommand.ts │ │ ├── features.ts │ │ ├── fileOperations.ts │ │ ├── fileSystemWatcher.ts │ │ ├── foldingRange.ts │ │ ├── formatting.ts │ │ ├── hover.ts │ │ ├── implementation.ts │ │ ├── inlayHint.ts │ │ ├── inlineCompletion.ts │ │ ├── inlineValue.ts │ │ ├── linkedEditingRange.ts │ │ ├── notebook.ts │ │ ├── progress.ts │ │ ├── progressPart.ts │ │ ├── protocolCallHierarchyItem.ts │ │ ├── protocolCodeAction.ts │ │ ├── protocolCodeLens.ts │ │ ├── protocolCompletionItem.ts │ │ ├── protocolConverter.ts │ │ ├── protocolDiagnostic.ts │ │ ├── protocolDocumentLink.ts │ │ ├── protocolInlayHint.ts │ │ ├── protocolTypeHierarchyItem.ts │ │ ├── protocolWorkspaceSymbol.ts │ │ ├── reference.ts │ │ ├── rename.ts │ │ ├── selectionRange.ts │ │ ├── semanticTokens.ts │ │ ├── signatureHelp.ts │ │ ├── textDocumentContent.ts │ │ ├── textSynchronization.ts │ │ ├── tsconfig.json │ │ ├── tsconfig.publish.json │ │ ├── tsconfig.watch.json │ │ ├── typeDefinition.ts │ │ ├── typeHierarchy.ts │ │ ├── utils │ │ │ ├── async.ts │ │ │ ├── globPattern.ts │ │ │ ├── is.ts │ │ │ └── uuid.ts │ │ ├── workspaceFolder.ts │ │ └── workspaceSymbol.ts │ └── node │ │ ├── main.ts │ │ ├── processes.ts │ │ ├── terminateProcess.sh │ │ ├── tsconfig.json │ │ ├── tsconfig.publish.json │ │ └── tsconfig.watch.json ├── tsconfig.json ├── tsconfig.publish.json ├── tsconfig.watch.json └── typings │ └── vscode.proposed.codeActionAI.d.ts ├── favicon.ico ├── jsconfig.json ├── jsonrpc ├── .eslintignore ├── .eslintrc.json ├── .mocharc.json ├── .npmignore ├── License.txt ├── README.md ├── package-lock.json ├── package.json ├── src │ ├── browser │ │ ├── main.ts │ │ ├── ril.ts │ │ ├── test │ │ │ ├── cancelWorker.ts │ │ │ ├── index.html │ │ │ ├── test.ts │ │ │ ├── tsconfig.json │ │ │ ├── tsconfig.publish.json │ │ │ ├── tsconfig.watch.json │ │ │ ├── webpack.config.js │ │ │ └── worker.ts │ │ ├── tsconfig.json │ │ ├── tsconfig.publish.json │ │ └── tsconfig.watch.json │ ├── common │ │ ├── api.ts │ │ ├── cancellation.ts │ │ ├── connection.ts │ │ ├── disposable.ts │ │ ├── encoding.ts │ │ ├── events.ts │ │ ├── is.ts │ │ ├── linkedMap.ts │ │ ├── messageBuffer.ts │ │ ├── messageReader.ts │ │ ├── messageWriter.ts │ │ ├── messages.ts │ │ ├── ral.ts │ │ ├── semaphore.ts │ │ ├── sharedArrayCancellation.ts │ │ ├── test │ │ │ ├── general.test.ts │ │ │ ├── linkedMap.test.ts │ │ │ ├── tsconfig.json │ │ │ ├── tsconfig.publish.json │ │ │ └── tsconfig.watch.json │ │ ├── tsconfig.json │ │ ├── tsconfig.publish.json │ │ └── tsconfig.watch.json │ └── node │ │ ├── main.ts │ │ ├── ril.ts │ │ ├── test │ │ ├── connection.test.ts │ │ ├── customCancellationStrategy.ts │ │ ├── messages.test.ts │ │ ├── tsconfig.json │ │ ├── tsconfig.publish.json │ │ └── tsconfig.watch.json │ │ ├── tsconfig.json │ │ ├── tsconfig.publish.json │ │ └── tsconfig.watch.json ├── thirdpartynotices.txt ├── tsconfig.json ├── tsconfig.publish.json ├── tsconfig.tsbuildinfo ├── tsconfig.watch.json ├── typings │ └── thenable.d.ts └── webpack.config.js ├── package-lock.json ├── package.json ├── protocol ├── .eslintignore ├── .eslintrc.json ├── .mocharc.json ├── .npmignore ├── License.txt ├── README.md ├── metaModel.json ├── metaModel.schema.json ├── package-lock.json ├── package.json ├── src │ ├── browser │ │ ├── main.ts │ │ ├── test │ │ │ ├── index.html │ │ │ ├── test.ts │ │ │ ├── tsconfig.json │ │ │ ├── tsconfig.publish.json │ │ │ ├── tsconfig.watch.json │ │ │ ├── webpack.config.js │ │ │ └── worker.ts │ │ ├── tsconfig.json │ │ ├── tsconfig.publish.json │ │ └── tsconfig.watch.json │ ├── common │ │ ├── api.ts │ │ ├── connection.ts │ │ ├── messages.ts │ │ ├── protocol.$.ts │ │ ├── protocol.callHierarchy.ts │ │ ├── protocol.colorProvider.ts │ │ ├── protocol.configuration.ts │ │ ├── protocol.declaration.ts │ │ ├── protocol.diagnostic.ts │ │ ├── protocol.fileOperations.ts │ │ ├── protocol.foldingRange.ts │ │ ├── protocol.implementation.ts │ │ ├── protocol.inlayHint.ts │ │ ├── protocol.inlineCompletion.ts │ │ ├── protocol.inlineValue.ts │ │ ├── protocol.linkedEditingRange.ts │ │ ├── protocol.moniker.ts │ │ ├── protocol.notebook.ts │ │ ├── protocol.progress.ts │ │ ├── protocol.selectionRange.ts │ │ ├── protocol.semanticTokens.ts │ │ ├── protocol.showDocument.ts │ │ ├── protocol.textDocumentContent.ts │ │ ├── protocol.ts │ │ ├── protocol.typeDefinition.ts │ │ ├── protocol.typeHierarchy.ts │ │ ├── protocol.workspaceFolder.ts │ │ ├── tsconfig.json │ │ ├── tsconfig.publish.json │ │ ├── tsconfig.watch.json │ │ └── utils │ │ │ └── is.ts │ └── node │ │ ├── main.ts │ │ ├── test │ │ ├── connection.test.ts │ │ ├── tsconfig.json │ │ ├── tsconfig.publish.json │ │ └── tsconfig.watch.json │ │ ├── tsconfig.json │ │ ├── tsconfig.publish.json │ │ └── tsconfig.watch.json ├── thirdpartynotices.txt ├── tsconfig.json ├── tsconfig.publish.json └── tsconfig.watch.json ├── server ├── .eslintignore ├── .eslintrc.json ├── .gitignore ├── .mocharc.json ├── .npmignore ├── License.txt ├── README.md ├── bin │ └── installServerIntoExtension ├── package-lock.json ├── package.json ├── src │ ├── browser │ │ ├── main.ts │ │ ├── tsconfig.json │ │ ├── tsconfig.publish.json │ │ └── tsconfig.watch.json │ ├── common │ │ ├── api.ts │ │ ├── callHierarchy.ts │ │ ├── configuration.ts │ │ ├── diagnostic.ts │ │ ├── fileOperations.ts │ │ ├── foldingRange.ts │ │ ├── inlayHint.ts │ │ ├── inlineCompletion.proposed.ts │ │ ├── inlineValue.ts │ │ ├── linkedEditingRange.ts │ │ ├── moniker.ts │ │ ├── notebook.ts │ │ ├── progress.ts │ │ ├── semanticTokens.ts │ │ ├── server.ts │ │ ├── showDocument.ts │ │ ├── textDocumentContent.ts │ │ ├── textDocuments.ts │ │ ├── tsconfig.json │ │ ├── tsconfig.publish.json │ │ ├── tsconfig.watch.json │ │ ├── typeHierarchy.ts │ │ ├── utils │ │ │ ├── is.ts │ │ │ └── uuid.ts │ │ └── workspaceFolder.ts │ └── node │ │ ├── files.ts │ │ ├── main.ts │ │ ├── resolve.ts │ │ ├── test │ │ ├── connection.test.ts │ │ ├── sematicTokens.test.ts │ │ ├── textdocuments.test.ts │ │ ├── tsconfig.json │ │ ├── tsconfig.publish.json │ │ └── tsconfig.watch.json │ │ ├── tsconfig.json │ │ ├── tsconfig.publish.json │ │ └── tsconfig.watch.json ├── thirdpartynotices.txt ├── tsconfig.json ├── tsconfig.publish.json ├── tsconfig.watch.json └── typings │ └── thenable.d.ts ├── testbed ├── .eslintrc.json ├── client │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── extension.ts │ │ └── measure.ts │ └── tsconfig.json ├── package-lock.json ├── package.json ├── server │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── fullNotebookServer.ts │ │ ├── server.ts │ │ └── simpleNotebookServer.ts │ └── tsconfig.json ├── tsconfig.json └── workspace │ ├── .vscode │ └── settings.json │ ├── bug.bat │ ├── bug.ipynb │ ├── bug2.bat │ ├── python.ipynb │ ├── test.bat │ ├── test.github-issues │ ├── test.ipynb │ ├── test.txt │ ├── test2.bat │ ├── test3.bat │ └── test4.bat ├── textDocument ├── .eslintignore ├── .eslintrc.json ├── .mocharc.json ├── .npmignore ├── License.txt ├── README.md ├── package-lock.json ├── package.json ├── src │ ├── main.ts │ ├── test │ │ ├── edits.test.ts │ │ ├── helper.ts │ │ ├── textdocument.test.ts │ │ ├── tsconfig.esm.publish.json │ │ ├── tsconfig.json │ │ ├── tsconfig.umd.publish.json │ │ └── tsconfig.watch.json │ ├── tsconfig.esm.publish.json │ ├── tsconfig.json │ ├── tsconfig.umd.publish.json │ └── tsconfig.watch.json ├── thirdpartynotices.txt ├── tsconfig.esm.json ├── tsconfig.esm.publish.json ├── tsconfig.json ├── tsconfig.publish.json ├── tsconfig.umd.publish.json └── tsconfig.watch.json ├── tools ├── .eslintrc.json ├── package-lock.json ├── package.json ├── src │ ├── generator-main.ts │ ├── metaModel.ts │ ├── typescripts.ts │ ├── validate-main.ts │ └── visitor.ts ├── tsconfig.json └── tsconfig.watch.json ├── tsconfig-gen ├── .eslintrc.json ├── .npmignore ├── LICENSE.md ├── README.md ├── SECURITY.md ├── ThirdPartyNotices.txt ├── bin │ └── tsconfig-gen ├── package-lock.json ├── package.json ├── src │ ├── generator.ts │ ├── main.ts │ └── types.ts ├── tsconfig.json ├── tsconfig.publish.json └── tsconfig.watch.json ├── tsconfig.json ├── tsconfig.watch.json └── types ├── .eslintignore ├── .eslintrc.json ├── .mocharc.json ├── .npmignore ├── License.txt ├── README.md ├── package-lock.json ├── package.json ├── src ├── main.ts ├── test │ ├── edits.test.ts │ ├── textdocument.test.ts │ ├── tsconfig.esm.publish.json │ ├── tsconfig.json │ ├── tsconfig.umd.publish.json │ ├── tsconfig.watch.json │ └── typeguards.test.ts ├── tsconfig.esm.publish.json ├── tsconfig.json ├── tsconfig.umd.publish.json └── tsconfig.watch.json ├── thirdpartynotices.txt ├── tsconfig.esm.publish.json ├── tsconfig.json ├── tsconfig.publish.json ├── tsconfig.umd.publish.json └── tsconfig.watch.json /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib 3 | !.tsconfigrc.js -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parserOptions": { 3 | "ecmaVersion": 2020 4 | }, 5 | 6 | "env": { 7 | "commonjs": true, 8 | "es6": true 9 | }, 10 | "rules": { 11 | "semi": "error", 12 | "no-extra-semi": "warn", 13 | "curly": "warn", 14 | "quotes": ["error", "single", { "allowTemplateLiterals": true } ], 15 | "eqeqeq": "error", 16 | "indent": ["warn", "tab", { "SwitchCase": 1 } ] 17 | } 18 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | LICENSE.txt eol=crlf 4 | ThirdPartyNotices.txt eol=crlf 5 | 6 | *.bat eol=crlf 7 | *.cmd eol=crlf 8 | *.ps1 eol=lf 9 | *.sh eol=lf -------------------------------------------------------------------------------- /.github/locker.yml: -------------------------------------------------------------------------------- 1 | { 2 | daysAfterClose: 45, 3 | daysSinceLastUpdate: 3, 4 | ignoredLabels: ['*out-of-scope'], 5 | perform: true 6 | } -------------------------------------------------------------------------------- /.github/needs_more_info.yml: -------------------------------------------------------------------------------- 1 | { 2 | daysUntilClose: 7, 3 | needsMoreInfoLabel: 'needs more info', 4 | perform: true, 5 | closeComment: "This issue has been closed automatically because it needs more information and has not had recent activity. See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!" 6 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | *.lsif 5 | *.db 6 | 7 | # Runtime data 8 | pids 9 | *.pid 10 | *.seed 11 | 12 | # Directory for instrumented libs generated by jscoverage/JSCover 13 | lib-cov 14 | 15 | # Coverage directory used by tools like istanbul 16 | coverage 17 | 18 | # node-waf configuration 19 | .lock-wscript 20 | 21 | # Compiled binary addons (http://nodejs.org/api/addons.html) 22 | build/Release 23 | lib/ 24 | out/ 25 | dist/ 26 | 27 | # Dependency directory 28 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- 29 | node_modules 30 | 31 | # Debug log from npm 32 | npm-debug.log 33 | 34 | client-node-tests/.vscode-test 35 | vscode-languageserver-types*.tgz 36 | vscode-languageserver-textdocument*.tgz 37 | vscode-jsonrpc*.tgz 38 | vscode-languageserver-protocol*.tgz 39 | vscode-languageserver*.tgz 40 | vscode-languageclient*.tgz 41 | 42 | # Don't track a file automatically generated by macOS 43 | .DS_Store -------------------------------------------------------------------------------- /.lsifrc.json: -------------------------------------------------------------------------------- 1 | { 2 | // The root TypeScript project to index 3 | "project": "./tsconfig.json", 4 | // The name of the output file 5 | "out": "lsp.lsif", 6 | // A mapping describing which packages are published to npm and what TS project files is used 7 | // to generate the package code. 8 | "publishedPackages": [ 9 | { "package": "./textDocument/package.json", "project": "./textDocument/tsconfig.json" }, 10 | { "package": "./types/package.json", "project": "./types/tsconfig.json" }, 11 | { "package": "./jsonrpc/package.json", "project": "./jsonrpc/tsconfig.json" }, 12 | { "package": "./protocol/package.json", "project": "./protocol/tsconfig.json" }, 13 | { "package": "./server/package.json", "project": "./server/tsconfig.json" }, 14 | { "package": "./client/package.json", "project": "./client/tsconfig.json" } 15 | ], 16 | // Get the source info from the package.json file 17 | "source": "./package.json", 18 | // The catalog information 19 | "catalogInfo": { 20 | "uri": "lsif-cat://microsoft.com/azure/devdiv/vscode/vscode-languageserver-node", 21 | "name": "VS Code LSP implementation in Node" 22 | } 23 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "npm: watch", 6 | "type": "npm", 7 | "script": "watch", 8 | "group": { 9 | "kind": "build", 10 | "isDefault": true 11 | }, 12 | "runOptions": { 13 | "runOn": "folderOpen" 14 | }, 15 | "isBackground": true, 16 | "presentation": { 17 | "panel": "dedicated", 18 | "reveal": "never" 19 | }, 20 | "problemMatcher": [ 21 | "$tsc-watch" 22 | ] 23 | }, 24 | { 25 | "label": "npm: compile", 26 | "type": "npm", 27 | "script": "compile", 28 | "problemMatcher": [ 29 | "$tsc" 30 | ], 31 | "presentation": { 32 | "panel": "dedicated", 33 | "reveal": "silent" 34 | } 35 | }, 36 | { 37 | "label": "npm: clean", 38 | "type": "npm", 39 | "script": "clean", 40 | "presentation": { 41 | "reveal": "never", 42 | "focus": false, 43 | "panel": "shared", 44 | "showReuseMessage": true, 45 | "clear": false 46 | }, 47 | "problemMatcher": [] 48 | }, 49 | { 50 | "label": "npm: watch:testbed", 51 | "type": "npm", 52 | "script": "watch:testbed", 53 | "group": "build", 54 | "isBackground": true, 55 | "dependsOn":[ "npm: symlink:testbed" ], 56 | "presentation": { 57 | "panel": "dedicated", 58 | "reveal": "never" 59 | }, 60 | "problemMatcher": [ 61 | "$tsc-watch" 62 | ] 63 | }, 64 | { 65 | "type": "npm", 66 | "script": "symlink:testbed", 67 | "problemMatcher": [], 68 | "label": "npm: symlink:testbed", 69 | "detail": "node ./build/bin/symlink-testbed.js" 70 | } 71 | ] 72 | } -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) Microsoft Corporation 3 | 4 | All rights reserved. 5 | 6 | MIT License 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation 9 | files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, 10 | modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software 11 | is furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 16 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 17 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 18 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | trigger: 2 | batch: true 3 | branches: 4 | include: [ '*' ] 5 | tags: 6 | include: [ 'release/*/*' ] 7 | pr: 8 | branches: 9 | include: [ 'main', 'release/*' ] 10 | 11 | jobs: 12 | - job: Windows 13 | pool: 14 | vmImage: 'windows-latest' 15 | steps: 16 | - template: build/azure-pipelines/win32/build.yml 17 | 18 | - job: Linux 19 | pool: 20 | vmImage: 'ubuntu-latest' 21 | steps: 22 | - template: build/azure-pipelines/linux/build.yml 23 | 24 | - job: macOS 25 | pool: 26 | vmImage: macOS-latest 27 | steps: 28 | - template: build/azure-pipelines/darwin/build.yml 29 | -------------------------------------------------------------------------------- /build/azure-pipelines/darwin/build.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - task: NodeTool@0 3 | inputs: 4 | versionSpec: '22.17.0' 5 | displayName: 'Install Node.js' 6 | 7 | - script: | 8 | npm install 9 | npm run symlink 10 | displayName: 'Install Dependencies' 11 | 12 | - script: | 13 | npm run compile 14 | displayName: 'Compile' 15 | 16 | - script: | 17 | npm run lint 18 | displayName: 'Hygiene Checks' 19 | 20 | - script: | 21 | npm run test 22 | displayName: 'Unit Tests' -------------------------------------------------------------------------------- /build/azure-pipelines/linux/build.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - script: | 3 | set -e 4 | sudo apt-get update 5 | sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 6 | sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb 7 | sudo chmod +x /etc/init.d/xvfb 8 | sudo update-rc.d xvfb defaults 9 | sudo service xvfb start 10 | 11 | - task: NodeTool@0 12 | inputs: 13 | versionSpec: '22.17.0' 14 | displayName: 'Install Node.js' 15 | 16 | - script: | 17 | npm install 18 | npm run symlink 19 | displayName: 'Install Dependencies' 20 | 21 | - script: | 22 | npm run compile 23 | displayName: 'Compile' 24 | 25 | - script: | 26 | npm run lint 27 | displayName: 'Hygiene Checks' 28 | 29 | - script: | 30 | DISPLAY=:10 npm run test 31 | displayName: 'Unit Tests' -------------------------------------------------------------------------------- /build/azure-pipelines/linux/xvfb.init: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # /etc/rc.d/init.d/xvfbd 4 | # 5 | # chkconfig: 345 95 28 6 | # description: Starts/Stops X Virtual Framebuffer server 7 | # processname: Xvfb 8 | # 9 | ### BEGIN INIT INFO 10 | # Provides: xvfb 11 | # Required-Start: $remote_fs $syslog 12 | # Required-Stop: $remote_fs $syslog 13 | # Default-Start: 2 3 4 5 14 | # Default-Stop: 0 1 6 15 | # Short-Description: Start xvfb at boot time 16 | # Description: Enable xvfb provided by daemon. 17 | ### END INIT INFO 18 | 19 | [ "${NETWORKING}" = "no" ] && exit 0 20 | 21 | PROG="/usr/bin/Xvfb" 22 | PROG_OPTIONS=":10 -ac -screen 0 1024x768x24" 23 | PROG_OUTPUT="/tmp/Xvfb.out" 24 | 25 | case "$1" in 26 | start) 27 | echo "Starting : X Virtual Frame Buffer " 28 | $PROG $PROG_OPTIONS>>$PROG_OUTPUT 2>&1 & 29 | disown -ar 30 | ;; 31 | stop) 32 | echo "Shutting down : X Virtual Frame Buffer" 33 | killproc $PROG 34 | RETVAL=$? 35 | [ $RETVAL -eq 0 ] && /bin/rm -f /var/lock/subsys/Xvfb 36 | /var/run/Xvfb.pid 37 | echo 38 | ;; 39 | restart|reload) 40 | $0 stop 41 | $0 start 42 | RETVAL=$? 43 | ;; 44 | status) 45 | status Xvfb 46 | RETVAL=$? 47 | ;; 48 | *) 49 | echo $"Usage: $0 (start|stop|restart|reload|status)" 50 | exit 1 51 | esac 52 | 53 | exit $RETVAL 54 | -------------------------------------------------------------------------------- /build/azure-pipelines/templates/pack-steps.yml: -------------------------------------------------------------------------------- 1 | ############################################################################################### 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # Licensed under the MIT License. See License.txt in the project root for license information. 4 | ############################################################################################### 5 | parameters: 6 | - name: package 7 | 8 | steps: 9 | - script: npm install --root-only 10 | workingDirectory: $(Build.SourcesDirectory) 11 | displayName: Install dependencies 12 | - bash: | 13 | /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & 14 | echo ">>> Started xvfb" 15 | displayName: Start xvfb 16 | condition: eq(variables['Agent.OS'], 'Linux') -------------------------------------------------------------------------------- /build/azure-pipelines/templates/test-steps.yml: -------------------------------------------------------------------------------- 1 | ############################################################################################### 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # Licensed under the MIT License. See License.txt in the project root for license information. 4 | ############################################################################################### 5 | parameters: 6 | - name: package 7 | type: string 8 | - name: script 9 | type: string 10 | default: 'all:publish' 11 | 12 | steps: 13 | - script: npm install --root-only 14 | workingDirectory: $(Build.SourcesDirectory) 15 | displayName: Install dependencies 16 | - bash: | 17 | /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & 18 | echo ">>> Started xvfb" 19 | displayName: Start xvfb 20 | condition: eq(variables['Agent.OS'], 'Linux') 21 | - script: npm run ${{ parameters.script }} 22 | workingDirectory: $(Build.SourcesDirectory)/${{ parameters.package }} 23 | displayName: Verify package -------------------------------------------------------------------------------- /build/azure-pipelines/win32/build.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - task: NodeTool@0 3 | inputs: 4 | versionSpec: '22.17.0' 5 | displayName: 'Install Node.js' 6 | 7 | - script: | 8 | npm install 9 | displayName: 'Install Dependencies' 10 | 11 | - script: | 12 | npm run symlink 13 | displayName: 'Symlink Dependencies' 14 | 15 | - script: | 16 | npm run compile 17 | displayName: 'Compile' 18 | 19 | - script: | 20 | npm run lint 21 | displayName: 'Hygiene Checks' 22 | 23 | - script: | 24 | set PATHEXT=.COM;.EXE;.BAT;.CMD; 25 | npm run test 26 | displayName: 'Unit Tests' -------------------------------------------------------------------------------- /build/bin/fix-esm.js: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 'use strict'; 6 | //@ts-check 7 | 8 | const fs = require('fs'); 9 | 10 | const pkg = { type: 'module' }; 11 | 12 | fs.writeFileSync('lib/esm/package.json', JSON.stringify(pkg, undefined, 2) + '\n'); 13 | -------------------------------------------------------------------------------- /build/bin/symlink-client-tests-publish.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | //@ts-check 8 | 9 | const path = require('path'); 10 | const ln = require('./linking'); 11 | 12 | const root = path.dirname(path.dirname(__dirname)); 13 | 14 | (async function main() { 15 | console.log('Symlinking node modules for publish setup'); 16 | 17 | // Hard link the client to have a real path from the node_modules folder 18 | const extensionFolder = path.join(root, 'client-node-tests'); 19 | await ln.tryHardLink(path.join(root, 'client'), path.join(extensionFolder, 'node_modules', 'vscode-languageclient')); 20 | })(); -------------------------------------------------------------------------------- /build/bin/symlink-tests.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | //@ts-check 8 | 9 | const path = require('path'); 10 | const ln = require('./linking'); 11 | 12 | const root = path.dirname(path.dirname(__dirname)); 13 | 14 | (async function main() { 15 | console.log('Symlinking node modules for test setup'); 16 | 17 | // test-extension 18 | const extensionFolder = path.join(root, 'client-node-tests'); 19 | await ln.tryLinkJsonRpc(extensionFolder); 20 | await ln.tryLinkTypes(extensionFolder); 21 | await ln.tryLinkProtocol(extensionFolder); 22 | await ln.tryLink(extensionFolder, 'vscode-languageserver', path.join('..', '..', 'server')); 23 | 24 | // Hard link the client to have a real path from the node_modules folder 25 | await ln.tryHardLink(path.join(root, 'client'), path.join(extensionFolder, 'node_modules', 'vscode-languageclient')); 26 | })(); -------------------------------------------------------------------------------- /build/bin/tsc.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | require('../../node_modules/typescript/lib/tsc.js') -------------------------------------------------------------------------------- /build/bin/webpack.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | require('../../node_modules/webpack/bin/webpack.js'); -------------------------------------------------------------------------------- /build/npm/fail.js: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | process.exitCode = 1; -------------------------------------------------------------------------------- /build/npm/post-publish.js: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | const cp = require('child_process'); 7 | const path = require('path'); 8 | const fs = require('fs'); 9 | const readline = require('readline'); 10 | const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm'; 11 | 12 | function updateNextTag() { 13 | 14 | // read package.json from the current working directory 15 | var packageJSON = JSON.parse(fs.readFileSync('package.json').toString()); 16 | var name = packageJSON.name; 17 | var version = packageJSON.version; 18 | if (version.indexOf('next') !== -1) { 19 | return; 20 | } 21 | 22 | opts = {}; 23 | opts.stdio = 'inherit'; 24 | 25 | console.log(name + ": set 'next' tag to latest version"); 26 | 27 | const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); 28 | 29 | rl.question('Enter OTP token: ', (token) => { 30 | const result = cp.spawnSync(npm, ['--otp', token, 'dist-tags', 'add', name + '@' + version, 'next'], opts); 31 | 32 | rl.close(); 33 | 34 | if (result.error || result.status !== 0) { 35 | process.exit(1); 36 | } 37 | }); 38 | } 39 | 40 | updateNextTag(); -------------------------------------------------------------------------------- /client-node-tests/.eslintignore: -------------------------------------------------------------------------------- 1 | lib 2 | node_modules -------------------------------------------------------------------------------- /client-node-tests/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../.eslintrc.base.json", 3 | "parserOptions": { 4 | "project": ["./src/tsconfig.json"] 5 | }, 6 | "rules": { 7 | } 8 | } -------------------------------------------------------------------------------- /client-node-tests/.mocharc.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec": "lib/test", 3 | "extension": ["js"], 4 | "recursive": true, 5 | "ui": "tdd" 6 | } -------------------------------------------------------------------------------- /client-node-tests/bin/runTests.js: -------------------------------------------------------------------------------- 1 | let path = require('path'); 2 | 3 | process.env.CODE_TESTS_PATH = path.join(process.cwd(), 'lib'); 4 | process.env.CODE_EXTENSIONS_PATH = path.join(process.cwd()); 5 | 6 | // Run the actual tests 7 | require('vscode/bin/test'); -------------------------------------------------------------------------------- /client-node-tests/extension.js: -------------------------------------------------------------------------------- 1 | function activate(context) { 2 | } 3 | exports.activate = activate; 4 | 5 | // this method is called when your extension is deactivated 6 | function deactivate() { 7 | } 8 | 9 | module.exports = { 10 | activate, 11 | deactivate 12 | } -------------------------------------------------------------------------------- /client-node-tests/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test-extension", 3 | "displayName": "test-extension", 4 | "publisher": "ms-vscode", 5 | "private": true, 6 | "description": "", 7 | "version": "0.0.1", 8 | "engines": { 9 | "vscode": "^1.91.0" 10 | }, 11 | "categories": [ 12 | "Other" 13 | ], 14 | "activationEvents": [ 15 | "*" 16 | ], 17 | "main": "./extension.js", 18 | "contributes": {}, 19 | "scripts": { 20 | "clean": "rimraf lib", 21 | "compile": "tsc -b ./tsconfig.json", 22 | "watch": "tsc -b ./tsconfig.watch.json -w", 23 | "lint": "eslint --ext ts src", 24 | "test": "node ../build/bin/symlink-tests.js && node lib/runTests.js", 25 | "all": "npm run clean && npm run compile && npm run lint && npm run test", 26 | "symlink:publish": "node ../build/bin/symlink-client-tests-publish.js", 27 | "compile:publish": "tsc -b ./tsconfig.publish.json", 28 | "test:publish": "node lib/runTests.js", 29 | "all:publish": "git clean -xfd . && npm install && npm run symlink:publish && npm run compile:publish && npm run test:publish" 30 | }, 31 | "dependencies": { 32 | "minimatch": "^10.0.3", 33 | "vscode-languageserver": "10.0.0-next.14", 34 | "vscode-uri": "3.0.8" 35 | }, 36 | "devDependencies": { 37 | "@types/glob": "^8.1.0", 38 | "@types/minimatch": "^5.1.2", 39 | "@types/sinon": "^17.0.3", 40 | "@types/uuid": "^10.0.0", 41 | "@types/vscode": "1.91.0", 42 | "@types/node": "20.17.9", 43 | "@vscode/test-electron": "^2.4.1", 44 | "find-process": "^1.4.7", 45 | "glob": "^11.0.0", 46 | "sinon": "^19.0.2", 47 | "uuid": "^11.0.3" 48 | }, 49 | "enabledApiProposals": [] 50 | } 51 | -------------------------------------------------------------------------------- /client-node-tests/src/index.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | import Mocha from 'mocha'; 3 | import { glob } from 'glob'; 4 | 5 | export function run(testsRoot: string, cb: (error: any, failures?: number) => void): void { 6 | // Create the mocha test 7 | const mocha = new Mocha({ 8 | ui: 'tdd', 9 | color: true 10 | }); 11 | 12 | 13 | glob('**/**.test.js', { cwd: testsRoot }).then((files) => { 14 | // Add files to the test suite 15 | files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); 16 | 17 | try { 18 | // Run the mocha test 19 | mocha 20 | .run(failures => { 21 | cb(null, failures); 22 | }); 23 | 24 | } catch (err) { 25 | cb(err); 26 | } 27 | }, (err) => { 28 | if (err) { 29 | return cb(err); 30 | } 31 | 32 | }); 33 | } -------------------------------------------------------------------------------- /client-node-tests/src/servers/crashOnShutdownServer.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | import { createConnection, Connection, InitializeParams } from 'vscode-languageserver/node'; 7 | 8 | const connection: Connection = createConnection(); 9 | connection.onInitialize((_params: InitializeParams): any => { 10 | return { capabilities: {} }; 11 | }); 12 | connection.onShutdown(() => { 13 | process.exit(100); 14 | }); 15 | connection.listen(); 16 | -------------------------------------------------------------------------------- /client-node-tests/src/servers/crashServer.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | import { createConnection, Connection, InitializeParams, NotificationType0 } from 'vscode-languageserver/node'; 7 | 8 | namespace CrashNotification { 9 | export const type = new NotificationType0('test/crash'); 10 | } 11 | 12 | const connection: Connection = createConnection(); 13 | connection.onInitialize((_params: InitializeParams): any => { 14 | return { 15 | capabilities: { 16 | } 17 | }; 18 | }); 19 | connection.onNotification(CrashNotification.type, () => { 20 | process.exit(100); 21 | }); 22 | connection.listen(); -------------------------------------------------------------------------------- /client-node-tests/src/servers/customServer.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | import { createConnection, Connection, InitializeParams, InitializeResult } from 'vscode-languageserver/node'; 7 | 8 | const connection: Connection = createConnection(); 9 | connection.onInitialize((_params: InitializeParams): InitializeResult => { 10 | return { 11 | capabilities: { 12 | } 13 | }; 14 | }); 15 | 16 | connection.onRequest('request', (param: { value: number }): number => { 17 | return param.value + 1; 18 | }); 19 | 20 | connection.onNotification('notification', () => { 21 | }); 22 | 23 | connection.onRequest('triggerRequest', async () => { 24 | await connection.sendRequest('request'); 25 | }); 26 | 27 | connection.onRequest('triggerNotification', async () => { 28 | await connection.sendNotification('notification'); 29 | }); 30 | 31 | connection.listen(); -------------------------------------------------------------------------------- /client-node-tests/src/servers/nullServer.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | import { createConnection, Connection, InitializeParams } from 'vscode-languageserver/node'; 7 | 8 | const connection: Connection = createConnection(); 9 | connection.onInitialize((_params: InitializeParams): any => { 10 | return { 11 | capabilities: { 12 | } 13 | }; 14 | }); 15 | connection.onShutdown(() => { 16 | }); 17 | connection.listen(); -------------------------------------------------------------------------------- /client-node-tests/src/servers/startStopServer.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | import { createConnection, Connection, InitializeParams } from 'vscode-languageserver/node'; 7 | 8 | const connection: Connection = createConnection(); 9 | connection.onInitialize((_params: InitializeParams): any => { 10 | return { 11 | capabilities: { 12 | executeCommandProvider: { 13 | commands: ['foo.command'], 14 | } 15 | } 16 | }; 17 | }); 18 | connection.onShutdown(() => { 19 | }); 20 | connection.listen(); -------------------------------------------------------------------------------- /client-node-tests/src/servers/timeoutOnShutdownServer.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | import { createConnection, Connection, InitializeParams } from 'vscode-languageserver/node'; 7 | 8 | const connection: Connection = createConnection(); 9 | connection.onInitialize((_params: InitializeParams): any => { 10 | return { capabilities: {} }; 11 | }); 12 | connection.onShutdown(async () => { 13 | return new Promise((resolve) => { 14 | setTimeout(resolve, 200000); 15 | }); 16 | }); 17 | connection.listen(); -------------------------------------------------------------------------------- /client-node-tests/src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [ 7 | "node", 8 | "vscode", 9 | "mocha" 10 | ], 11 | "lib": [ 12 | "es2023", 13 | "webworker" 14 | ], 15 | "strict": true, 16 | "noImplicitAny": true, 17 | "noImplicitReturns": true, 18 | "noImplicitThis": true, 19 | "declaration": true, 20 | "stripInternal": true, 21 | "sourceMap": true, 22 | "declarationMap": true, 23 | "noUnusedLocals": true, 24 | "noUnusedParameters": true, 25 | "target": "es2022", 26 | "outDir": "../lib", 27 | "tsBuildInfoFile": "../lib/compile.tsbuildInfo", 28 | "incremental": true 29 | }, 30 | "include": [ 31 | "." 32 | ] 33 | } -------------------------------------------------------------------------------- /client-node-tests/src/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [ 7 | "node", 8 | "vscode", 9 | "mocha" 10 | ], 11 | "lib": [ 12 | "es2023", 13 | "webworker" 14 | ], 15 | "strict": true, 16 | "noImplicitAny": true, 17 | "noImplicitReturns": true, 18 | "noImplicitThis": true, 19 | "declaration": true, 20 | "stripInternal": true, 21 | "sourceMap": false, 22 | "declarationMap": false, 23 | "noUnusedLocals": true, 24 | "noUnusedParameters": true, 25 | "target": "es2022", 26 | "outDir": "../lib", 27 | "tsBuildInfoFile": "../lib/publish.tsbuildInfo", 28 | "incremental": true 29 | }, 30 | "include": [ 31 | "." 32 | ] 33 | } -------------------------------------------------------------------------------- /client-node-tests/src/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [ 7 | "node", 8 | "vscode", 9 | "mocha" 10 | ], 11 | "lib": [ 12 | "es2023", 13 | "webworker" 14 | ], 15 | "strict": true, 16 | "noImplicitAny": true, 17 | "noImplicitReturns": true, 18 | "noImplicitThis": true, 19 | "declaration": true, 20 | "stripInternal": true, 21 | "sourceMap": true, 22 | "declarationMap": true, 23 | "noUnusedLocals": false, 24 | "noUnusedParameters": false, 25 | "assumeChangesOnlyAffectDirectDependencies": true, 26 | "target": "es2022", 27 | "outDir": "../lib", 28 | "tsBuildInfoFile": "../lib/watch.tsbuildInfo", 29 | "incremental": true 30 | }, 31 | "include": [ 32 | "." 33 | ] 34 | } -------------------------------------------------------------------------------- /client-node-tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./../protocol/tsconfig.json" 10 | }, 11 | { 12 | "path": "./../client/tsconfig.json" 13 | }, 14 | { 15 | "path": "./../server/tsconfig.json" 16 | }, 17 | { 18 | "path": "./src/tsconfig.json" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /client-node-tests/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./src/tsconfig.publish.json" 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /client-node-tests/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./../protocol/tsconfig.watch.json" 10 | }, 11 | { 12 | "path": "./../client/tsconfig.watch.json" 13 | }, 14 | { 15 | "path": "./../server/tsconfig.watch.json" 16 | }, 17 | { 18 | "path": "./src/tsconfig.watch.json" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /client/.eslintignore: -------------------------------------------------------------------------------- 1 | lib 2 | node_modules -------------------------------------------------------------------------------- /client/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../.eslintrc.base.json", 3 | "parserOptions": { 4 | "project": ["src/browser/tsconfig.json", "src/common/tsconfig.json", "src/node/tsconfig.json"] 5 | }, 6 | "rules": { 7 | } 8 | } -------------------------------------------------------------------------------- /client/.npmignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | lib/**/test/ 3 | .vscode-test/ 4 | lib/**/*.map 5 | lib/**/*.tsbuildInfo 6 | src/ 7 | test/ 8 | bin/ 9 | .eslintrc* 10 | .eslintignore 11 | .mocharc* 12 | .gitignore 13 | gulpfile.js 14 | tsd.json 15 | tsconfig*.json -------------------------------------------------------------------------------- /client/License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) Microsoft Corporation 2 | 3 | All rights reserved. 4 | 5 | MIT License 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | -------------------------------------------------------------------------------- /client/README.md: -------------------------------------------------------------------------------- 1 | # VSCode Language Server - Client Module 2 | 3 | [![NPM Version](https://img.shields.io/npm/v/vscode-languageclient.svg)](https://npmjs.org/package/vscode-languageclient) 4 | [![NPM Downloads](https://img.shields.io/npm/dm/vscode-languageclient.svg)](https://npmjs.org/package/vscode-languageclient) 5 | [![Build Status](https://dev.azure.com/ms/vscode-languageserver-node/_apis/build/status/microsoft.vscode-languageserver-node?branchName=main)](https://dev.azure.com/ms/vscode-languageserver-node/_build/latest?definitionId=439&branchName=main) 6 | 7 | This npm module allows VSCode extensions to easily integrate language servers adhering to the [language server protocol](https://github.com/Microsoft/vscode-languageserver-protocol) 8 | 9 | See [here](https://code.visualstudio.com/docs/extensions/example-language-server) for a detailed documentation on how to 10 | implement language servers for [VSCode](https://code.visualstudio.com/). 11 | 12 | ## History 13 | 14 | For the history please see the [main repository](https://github.com/Microsoft/vscode-languageserver-node/blob/master/README.md) 15 | 16 | ## License 17 | [MIT](https://github.com/Microsoft/vscode-languageserver-node/blob/master/License.txt) 18 | -------------------------------------------------------------------------------- /client/bin/updateVSCode.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const fs = require('fs'); 3 | 4 | const packageJSON = require('../package.json'); 5 | const engineVersion = packageJSON.engines.vscode; 6 | 7 | if (!engineVersion) { 8 | throw new Error(`'engines.vscode' not set in package.json`); 9 | } 10 | 11 | const regexp = /const REQUIRED_VSCODE_VERSION = '([^\']+)';/; 12 | 13 | const mainPath = path.join(__dirname, '../src/node/main.ts'); 14 | const mainSource = fs.readFileSync(mainPath).toString(); 15 | const match = mainSource.match(regexp); 16 | if (!match && match[1]) { 17 | throw new Error(`Unable to find 'const REQUIRED_VSCODE_VERSION' in main.ts`); 18 | } 19 | if (match[1] !== engineVersion) { 20 | console.log(`Updating REQUIRED_VSCODE_VERSION in main.ts to ${engineVersion}`); 21 | const updatedSource = mainSource.replace(regexp, `const REQUIRED_VSCODE_VERSION = '${engineVersion}';`); 22 | fs.writeFileSync(mainPath, updatedSource); 23 | } else { 24 | console.log(`No change needed: REQUIRED_VSCODE_VERSION in main.ts is already ${engineVersion}`); 25 | } -------------------------------------------------------------------------------- /client/src/browser/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "vscode" 5 | ], 6 | "module": "node16", 7 | "moduleResolution": "node16", 8 | "rootDir": ".", 9 | "lib": [ 10 | "es2023", 11 | "webworker" 12 | ], 13 | "strict": true, 14 | "noImplicitAny": true, 15 | "noImplicitReturns": true, 16 | "noImplicitThis": true, 17 | "declaration": true, 18 | "stripInternal": true, 19 | "sourceMap": true, 20 | "declarationMap": true, 21 | "noUnusedLocals": true, 22 | "noUnusedParameters": true, 23 | "target": "es2022", 24 | "outDir": "../../lib/browser", 25 | "tsBuildInfoFile": "../../lib/browser/compile.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "references": [ 32 | { 33 | "path": "../common/tsconfig.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /client/src/browser/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "vscode" 5 | ], 6 | "module": "node16", 7 | "moduleResolution": "node16", 8 | "rootDir": ".", 9 | "lib": [ 10 | "es2023", 11 | "webworker" 12 | ], 13 | "strict": true, 14 | "noImplicitAny": true, 15 | "noImplicitReturns": true, 16 | "noImplicitThis": true, 17 | "declaration": true, 18 | "stripInternal": true, 19 | "sourceMap": false, 20 | "declarationMap": false, 21 | "noUnusedLocals": true, 22 | "noUnusedParameters": true, 23 | "target": "es2022", 24 | "outDir": "../../lib/browser", 25 | "tsBuildInfoFile": "../../lib/browser/publish.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "references": [ 32 | { 33 | "path": "../common/tsconfig.publish.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /client/src/browser/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "vscode" 5 | ], 6 | "module": "node16", 7 | "moduleResolution": "node16", 8 | "rootDir": ".", 9 | "lib": [ 10 | "es2023", 11 | "webworker" 12 | ], 13 | "strict": true, 14 | "noImplicitAny": true, 15 | "noImplicitReturns": true, 16 | "noImplicitThis": true, 17 | "declaration": true, 18 | "stripInternal": true, 19 | "sourceMap": true, 20 | "declarationMap": true, 21 | "noUnusedLocals": false, 22 | "noUnusedParameters": false, 23 | "assumeChangesOnlyAffectDirectDependencies": true, 24 | "target": "es2022", 25 | "outDir": "../../lib/browser", 26 | "tsBuildInfoFile": "../../lib/browser/watch.tsbuildInfo", 27 | "incremental": true 28 | }, 29 | "include": [ 30 | "." 31 | ], 32 | "references": [ 33 | { 34 | "path": "../common/tsconfig.watch.json" 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /client/src/common/protocolCallHierarchyItem.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import * as code from 'vscode'; 7 | import { LSPAny } from 'vscode-languageserver-protocol'; 8 | 9 | export default class ProtocolCallHierarchyItem extends code.CallHierarchyItem { 10 | 11 | public data?: LSPAny; 12 | 13 | constructor(kind: code.SymbolKind, name: string, detail: string, uri: code.Uri, range: code.Range, selectionRange: code.Range, data?: LSPAny) { 14 | super(kind, name, detail, uri, range, selectionRange); 15 | if (data !== undefined) { this.data = data; } 16 | } 17 | } -------------------------------------------------------------------------------- /client/src/common/protocolCodeAction.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import * as vscode from 'vscode'; 7 | import { LSPAny } from 'vscode-languageserver-protocol'; 8 | 9 | export default class ProtocolCodeAction extends vscode.CodeAction { 10 | 11 | public readonly data: LSPAny | undefined; 12 | 13 | constructor(title: string, data: LSPAny | undefined) { 14 | super(title); 15 | this.data = data; 16 | } 17 | } -------------------------------------------------------------------------------- /client/src/common/protocolCodeLens.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import * as code from 'vscode'; 7 | 8 | export default class ProtocolCodeLens extends code.CodeLens { 9 | 10 | public data: any; 11 | 12 | constructor(range: code.Range) { 13 | super(range); 14 | } 15 | } -------------------------------------------------------------------------------- /client/src/common/protocolCompletionItem.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import * as code from 'vscode'; 7 | import * as proto from 'vscode-languageserver-protocol'; 8 | 9 | export default class ProtocolCompletionItem extends code.CompletionItem { 10 | 11 | public data: any; 12 | public fromEdit: boolean | undefined; 13 | public documentationFormat: string | undefined; 14 | public originalItemKind: proto.CompletionItemKind | undefined; 15 | public deprecated: boolean | undefined; 16 | public insertTextMode: proto.InsertTextMode | undefined; 17 | 18 | constructor(label: string | code.CompletionItemLabel) { 19 | super(label); 20 | } 21 | } -------------------------------------------------------------------------------- /client/src/common/protocolDiagnostic.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import * as vscode from 'vscode'; 7 | import { LSPAny } from 'vscode-languageserver-protocol'; 8 | import * as Is from './utils/is'; 9 | 10 | /** 11 | * We keep this for a while to not break servers which adopted 12 | * proposed API. 13 | */ 14 | export interface DiagnosticCode { 15 | value: string | number; 16 | target: string; 17 | } 18 | 19 | export namespace DiagnosticCode { 20 | export function is(value: any): value is DiagnosticCode { 21 | const candidate: DiagnosticCode = value as DiagnosticCode; 22 | return candidate !== undefined && candidate !== null && (Is.number(candidate.value) || Is.string(candidate.value)) && Is.string(candidate.target); 23 | } 24 | } 25 | 26 | export class ProtocolDiagnostic extends vscode.Diagnostic { 27 | 28 | public readonly data: LSPAny | undefined; 29 | public hasDiagnosticCode: boolean; 30 | 31 | constructor(range: vscode.Range, message: string, severity: vscode.DiagnosticSeverity, data: LSPAny | undefined) { 32 | super(range, message, severity); 33 | this.data = data; 34 | this.hasDiagnosticCode = false; 35 | } 36 | } -------------------------------------------------------------------------------- /client/src/common/protocolDocumentLink.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import * as code from 'vscode'; 7 | 8 | export default class ProtocolDocumentLink extends code.DocumentLink { 9 | 10 | public data: any; 11 | 12 | constructor(range: code.Range, target?: code.Uri | undefined) { 13 | super(range, target); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /client/src/common/protocolInlayHint.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import * as code from 'vscode'; 7 | 8 | export default class ProtocolInlayHint extends code.InlayHint { 9 | 10 | public data: any; 11 | 12 | constructor(position: code.Position, label: string | code.InlayHintLabelPart[], kind?: code.InlayHintKind) { 13 | super(position, label, kind); 14 | } 15 | } -------------------------------------------------------------------------------- /client/src/common/protocolTypeHierarchyItem.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import * as code from 'vscode'; 7 | import { LSPAny } from 'vscode-languageserver-protocol'; 8 | 9 | export default class ProtocolTypeHierarchyItem extends code.TypeHierarchyItem { 10 | 11 | public data?: LSPAny; 12 | 13 | constructor(kind: code.SymbolKind, name: string, detail: string, uri: code.Uri, range: code.Range, selectionRange: code.Range, data?: LSPAny) { 14 | super(kind, name, detail, uri, range, selectionRange); 15 | if (data !== undefined) { this.data = data; } 16 | } 17 | } -------------------------------------------------------------------------------- /client/src/common/protocolWorkspaceSymbol.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import * as code from 'vscode'; 7 | import { LSPAny } from 'vscode-languageserver-protocol'; 8 | 9 | export default class WorkspaceSymbol extends code.SymbolInformation { 10 | 11 | public data?: LSPAny; 12 | public readonly hasRange: boolean; 13 | 14 | constructor(name: string, kind: code.SymbolKind, containerName: string, locationOrUri: code.Location | code.Uri, data: LSPAny | undefined) { 15 | const hasRange = !(locationOrUri instanceof code.Uri); 16 | super(name, kind, containerName, hasRange ? locationOrUri : new code.Location(locationOrUri, new code.Range(0,0,0,0))); 17 | this.hasRange = hasRange; 18 | if (data !== undefined) { 19 | this.data = data; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /client/src/common/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "vscode" 5 | ], 6 | "module": "node16", 7 | "moduleResolution": "node16", 8 | "rootDir": ".", 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es2022", 20 | "lib": [ 21 | "es2023" 22 | ], 23 | "outDir": "../../lib/common", 24 | "tsBuildInfoFile": "../../lib/common/compile.tsbuildInfo", 25 | "incremental": true, 26 | "composite": true 27 | }, 28 | "include": [ 29 | "." 30 | ] 31 | } -------------------------------------------------------------------------------- /client/src/common/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "vscode" 5 | ], 6 | "module": "node16", 7 | "moduleResolution": "node16", 8 | "rootDir": ".", 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": false, 16 | "declarationMap": false, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es2022", 20 | "lib": [ 21 | "es2023" 22 | ], 23 | "outDir": "../../lib/common", 24 | "tsBuildInfoFile": "../../lib/common/publish.tsbuildInfo", 25 | "incremental": true, 26 | "composite": true 27 | }, 28 | "include": [ 29 | "." 30 | ] 31 | } -------------------------------------------------------------------------------- /client/src/common/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "vscode" 5 | ], 6 | "module": "node16", 7 | "moduleResolution": "node16", 8 | "rootDir": ".", 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": false, 18 | "noUnusedParameters": false, 19 | "assumeChangesOnlyAffectDirectDependencies": true, 20 | "target": "es2022", 21 | "lib": [ 22 | "es2023" 23 | ], 24 | "outDir": "../../lib/common", 25 | "tsBuildInfoFile": "../../lib/common/watch.tsbuildInfo", 26 | "incremental": true, 27 | "composite": true 28 | }, 29 | "include": [ 30 | "." 31 | ] 32 | } -------------------------------------------------------------------------------- /client/src/common/utils/globPattern.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import * as minimatch from 'minimatch'; 7 | 8 | import { Uri } from 'vscode'; 9 | import type { GlobPattern } from 'vscode-languageserver-protocol'; 10 | 11 | export function matchGlobPattern(pattern: GlobPattern, resource: Uri): boolean { 12 | let miniMatchPattern: string; 13 | if (typeof pattern === 'string') { 14 | miniMatchPattern = pattern.replace(/\\/g, '/'); 15 | } else { 16 | try { 17 | const baseUri = Uri.parse(typeof pattern.baseUri === 'string' ? pattern.baseUri : pattern.baseUri.uri); 18 | miniMatchPattern = baseUri.with({ path: baseUri.path + '/' + pattern.pattern }).fsPath.replace(/\\/g, '/'); 19 | } catch (error) { 20 | return false; 21 | } 22 | } 23 | const matcher = new minimatch.Minimatch(miniMatchPattern, { noext: true }); 24 | if (!matcher.makeRe()) { 25 | return false; 26 | } 27 | return matcher.match(resource.fsPath); 28 | } -------------------------------------------------------------------------------- /client/src/node/processes.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import * as cp from 'child_process'; 7 | import ChildProcess = cp.ChildProcess; 8 | 9 | import { join } from 'path'; 10 | 11 | const isWindows = (process.platform === 'win32'); 12 | const isMacintosh = (process.platform === 'darwin'); 13 | const isLinux = (process.platform === 'linux'); 14 | export function terminate(process: ChildProcess & { pid: number }, cwd?: string): boolean { 15 | if (isWindows) { 16 | try { 17 | // This we run in Atom execFileSync is available. 18 | // Ignore stderr since this is otherwise piped to parent.stderr 19 | // which might be already closed. 20 | const options: any = { 21 | stdio: ['pipe', 'pipe', 'ignore'] 22 | }; 23 | if (cwd) { 24 | options.cwd = cwd; 25 | } 26 | (cp).execFileSync('taskkill', ['/T', '/F', '/PID', process.pid.toString()], options); 27 | return true; 28 | } catch (err) { 29 | return false; 30 | } 31 | } else if (isLinux || isMacintosh) { 32 | try { 33 | const cmd = join(__dirname, 'terminateProcess.sh'); 34 | const result = (cp).spawnSync(cmd, [process.pid.toString()]); 35 | return result.error ? false : true; 36 | } catch (err) { 37 | return false; 38 | } 39 | } else { 40 | process.kill('SIGKILL'); 41 | return true; 42 | } 43 | } -------------------------------------------------------------------------------- /client/src/node/terminateProcess.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # -------------------------------------------------------------------------------------------- 3 | # Copyright (c) Microsoft Corporation. All rights reserved. 4 | # Licensed under the MIT License. See License.txt in the project root for license information. 5 | # -------------------------------------------------------------------------------------------- 6 | 7 | terminateTree() { 8 | for cpid in $(pgrep -P $1); do 9 | terminateTree $cpid 10 | done 11 | kill -9 $1 > /dev/null 2>&1 12 | } 13 | 14 | for pid in $*; do 15 | terminateTree $pid 16 | done -------------------------------------------------------------------------------- /client/src/node/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "node", 5 | "vscode" 6 | ], 7 | "module": "node16", 8 | "moduleResolution": "node16", 9 | "rootDir": ".", 10 | "strict": true, 11 | "noImplicitAny": true, 12 | "noImplicitReturns": true, 13 | "noImplicitThis": true, 14 | "declaration": true, 15 | "stripInternal": true, 16 | "sourceMap": true, 17 | "declarationMap": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "target": "es2022", 21 | "lib": [ 22 | "es2023" 23 | ], 24 | "outDir": "../../lib/node", 25 | "tsBuildInfoFile": "../../lib/node/compile.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "references": [ 32 | { 33 | "path": "../common/tsconfig.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /client/src/node/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "node", 5 | "vscode" 6 | ], 7 | "module": "node16", 8 | "moduleResolution": "node16", 9 | "rootDir": ".", 10 | "strict": true, 11 | "noImplicitAny": true, 12 | "noImplicitReturns": true, 13 | "noImplicitThis": true, 14 | "declaration": true, 15 | "stripInternal": true, 16 | "sourceMap": false, 17 | "declarationMap": false, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "target": "es2022", 21 | "lib": [ 22 | "es2023" 23 | ], 24 | "outDir": "../../lib/node", 25 | "tsBuildInfoFile": "../../lib/node/publish.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "references": [ 32 | { 33 | "path": "../common/tsconfig.publish.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /client/src/node/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "node", 5 | "vscode" 6 | ], 7 | "module": "node16", 8 | "moduleResolution": "node16", 9 | "rootDir": ".", 10 | "strict": true, 11 | "noImplicitAny": true, 12 | "noImplicitReturns": true, 13 | "noImplicitThis": true, 14 | "declaration": true, 15 | "stripInternal": true, 16 | "sourceMap": true, 17 | "declarationMap": true, 18 | "noUnusedLocals": false, 19 | "noUnusedParameters": false, 20 | "assumeChangesOnlyAffectDirectDependencies": true, 21 | "target": "es2022", 22 | "lib": [ 23 | "es2023" 24 | ], 25 | "outDir": "../../lib/node", 26 | "tsBuildInfoFile": "../../lib/node/watch.tsbuildInfo", 27 | "incremental": true 28 | }, 29 | "include": [ 30 | "." 31 | ], 32 | "references": [ 33 | { 34 | "path": "../common/tsconfig.watch.json" 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./../protocol/tsconfig.json" 10 | }, 11 | { 12 | "path": "./src/common/tsconfig.json" 13 | }, 14 | { 15 | "path": "./src/browser/tsconfig.json" 16 | }, 17 | { 18 | "path": "./src/node/tsconfig.json" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /client/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./src/common/tsconfig.publish.json" 10 | }, 11 | { 12 | "path": "./src/browser/tsconfig.publish.json" 13 | }, 14 | { 15 | "path": "./src/node/tsconfig.publish.json" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /client/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./../protocol/tsconfig.watch.json" 10 | }, 11 | { 12 | "path": "./src/common/tsconfig.watch.json" 13 | }, 14 | { 15 | "path": "./src/browser/tsconfig.watch.json" 16 | }, 17 | { 18 | "path": "./src/node/tsconfig.watch.json" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /client/typings/vscode.proposed.codeActionAI.d.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | declare module 'vscode' { 7 | 8 | export interface CodeAction { 9 | /** 10 | * Marks this as an AI action. 11 | * 12 | * Ex: A quick fix should be marked AI if it invokes AI. 13 | */ 14 | isAI?: boolean; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/vscode-languageserver-node/3412a17149850f445bf35b4ad71148cfe5f8411e/favicon.ico -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "checkJs": true, 5 | "module": "commonjs", 6 | "target": "es2020", 7 | "types": [ 8 | "node" 9 | ], 10 | "lib": [ 11 | "es2020" 12 | ] 13 | }, 14 | "exclude": [ 15 | "node_modules" 16 | ], 17 | "include": [ 18 | "./.tsconfigrc.js" 19 | ] 20 | } -------------------------------------------------------------------------------- /jsonrpc/.eslintignore: -------------------------------------------------------------------------------- 1 | lib 2 | dist -------------------------------------------------------------------------------- /jsonrpc/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../.eslintrc.base.json", 3 | "parserOptions": { 4 | "project": ["src/browser/tsconfig.json", "src/browser/test/tsconfig.json", "src/common/tsconfig.json", "src/common/test/tsconfig.json", "src/node/tsconfig.json", "src/node/test/tsconfig.json"] 5 | }, 6 | "rules": { 7 | "no-console": "error" 8 | } 9 | } -------------------------------------------------------------------------------- /jsonrpc/.mocharc.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec": ["lib/common/test", "lib/node/test"], 3 | "extension": ["js"], 4 | "recursive": true, 5 | "ui": "tdd" 6 | } -------------------------------------------------------------------------------- /jsonrpc/.npmignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | dist/ 3 | lib/**/test/ 4 | lib/**/*.map 5 | lib/**/*.tsbuildInfo 6 | src/ 7 | test/ 8 | .eslintrc* 9 | .eslintignore 10 | .mocharc* 11 | .gitignore 12 | gulpfile.js 13 | tsd.json 14 | tsconfig*.json 15 | webpack.config.js -------------------------------------------------------------------------------- /jsonrpc/License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) Microsoft Corporation 2 | 3 | All rights reserved. 4 | 5 | MIT License 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | -------------------------------------------------------------------------------- /jsonrpc/src/browser/test/cancelWorker.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import { RequestType0 } from '../../common/messages'; 7 | import { SharedArrayReceiverStrategy, SharedArraySenderStrategy } from '../../common/sharedArrayCancellation'; 8 | 9 | import { BrowserMessageReader, BrowserMessageWriter, createMessageConnection } from '../main'; 10 | 11 | const reader: BrowserMessageReader = new BrowserMessageReader(self); 12 | const writer: BrowserMessageWriter = new BrowserMessageWriter(self); 13 | 14 | const type = new RequestType0('test/handleCancel'); 15 | const connection = createMessageConnection(reader, writer, undefined, { cancellationStrategy: { sender: new SharedArraySenderStrategy(), receiver: new SharedArrayReceiverStrategy() } }); 16 | connection.onRequest(type, (token) => { 17 | const start = Date.now(); 18 | while(Date.now() - start < 1000) { 19 | if (token.isCancellationRequested) { 20 | return true; 21 | } 22 | } 23 | return false; 24 | }); 25 | 26 | connection.listen(); -------------------------------------------------------------------------------- /jsonrpc/src/browser/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "node16", 7 | "moduleResolution": "node16", 8 | "rootDir": ".", 9 | "lib": [ 10 | "es2023", 11 | "webworker" 12 | ], 13 | "strict": true, 14 | "noImplicitAny": true, 15 | "noImplicitReturns": true, 16 | "noImplicitThis": true, 17 | "declaration": true, 18 | "stripInternal": true, 19 | "sourceMap": true, 20 | "declarationMap": true, 21 | "noUnusedLocals": true, 22 | "noUnusedParameters": true, 23 | "target": "es2022", 24 | "outDir": "../../../lib/browser/test", 25 | "tsBuildInfoFile": "../../../lib/browser/test/compile.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "references": [ 32 | { 33 | "path": "../tsconfig.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /jsonrpc/src/browser/test/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "node16", 7 | "moduleResolution": "node16", 8 | "rootDir": ".", 9 | "lib": [ 10 | "es2023", 11 | "webworker" 12 | ], 13 | "strict": true, 14 | "noImplicitAny": true, 15 | "noImplicitReturns": true, 16 | "noImplicitThis": true, 17 | "declaration": true, 18 | "stripInternal": true, 19 | "sourceMap": false, 20 | "declarationMap": false, 21 | "noUnusedLocals": true, 22 | "noUnusedParameters": true, 23 | "target": "es2022", 24 | "outDir": "../../../lib/browser/test", 25 | "tsBuildInfoFile": "../../../lib/browser/test/publish.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "references": [ 32 | { 33 | "path": "../tsconfig.publish.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /jsonrpc/src/browser/test/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "node16", 7 | "moduleResolution": "node16", 8 | "rootDir": ".", 9 | "lib": [ 10 | "es2023", 11 | "webworker" 12 | ], 13 | "strict": true, 14 | "noImplicitAny": true, 15 | "noImplicitReturns": true, 16 | "noImplicitThis": true, 17 | "declaration": true, 18 | "stripInternal": true, 19 | "sourceMap": true, 20 | "declarationMap": true, 21 | "noUnusedLocals": false, 22 | "noUnusedParameters": false, 23 | "assumeChangesOnlyAffectDirectDependencies": true, 24 | "target": "es2022", 25 | "outDir": "../../../lib/browser/test", 26 | "tsBuildInfoFile": "../../../lib/browser/test/watch.tsbuildInfo", 27 | "incremental": true 28 | }, 29 | "include": [ 30 | "." 31 | ], 32 | "references": [ 33 | { 34 | "path": "../tsconfig.watch.json" 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /jsonrpc/src/browser/test/worker.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import { ResponseMessage } from '../../common/messages'; 7 | import { BrowserMessageReader, BrowserMessageWriter } from '../main'; 8 | 9 | const reader: BrowserMessageReader = new BrowserMessageReader(self); 10 | const writer: BrowserMessageWriter = new BrowserMessageWriter(self); 11 | 12 | reader.listen((_message) => { 13 | const response: ResponseMessage = { 14 | jsonrpc: '2.0', 15 | id: 1, 16 | result: 42 17 | }; 18 | void writer.write(response); 19 | }); -------------------------------------------------------------------------------- /jsonrpc/src/browser/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "lib": [ 8 | "es2023", 9 | "webworker" 10 | ], 11 | "strict": true, 12 | "noImplicitAny": true, 13 | "noImplicitReturns": true, 14 | "noImplicitThis": true, 15 | "declaration": true, 16 | "stripInternal": true, 17 | "sourceMap": true, 18 | "declarationMap": true, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "target": "es2022", 22 | "outDir": "../../lib/browser", 23 | "tsBuildInfoFile": "../../lib/browser/compile.tsbuildInfo", 24 | "incremental": true, 25 | "composite": true 26 | }, 27 | "include": [ 28 | "." 29 | ], 30 | "exclude": [ 31 | "test" 32 | ], 33 | "references": [ 34 | { 35 | "path": "../common/tsconfig.json" 36 | } 37 | ] 38 | } -------------------------------------------------------------------------------- /jsonrpc/src/browser/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "lib": [ 8 | "es2023", 9 | "webworker" 10 | ], 11 | "strict": true, 12 | "noImplicitAny": true, 13 | "noImplicitReturns": true, 14 | "noImplicitThis": true, 15 | "declaration": true, 16 | "stripInternal": true, 17 | "sourceMap": false, 18 | "declarationMap": false, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "target": "es2022", 22 | "outDir": "../../lib/browser", 23 | "tsBuildInfoFile": "../../lib/browser/publish.tsbuildInfo", 24 | "incremental": true, 25 | "composite": true 26 | }, 27 | "include": [ 28 | "." 29 | ], 30 | "exclude": [ 31 | "test" 32 | ], 33 | "references": [ 34 | { 35 | "path": "../common/tsconfig.publish.json" 36 | } 37 | ] 38 | } -------------------------------------------------------------------------------- /jsonrpc/src/browser/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "lib": [ 8 | "es2023", 9 | "webworker" 10 | ], 11 | "strict": true, 12 | "noImplicitAny": true, 13 | "noImplicitReturns": true, 14 | "noImplicitThis": true, 15 | "declaration": true, 16 | "stripInternal": true, 17 | "sourceMap": true, 18 | "declarationMap": true, 19 | "noUnusedLocals": false, 20 | "noUnusedParameters": false, 21 | "assumeChangesOnlyAffectDirectDependencies": true, 22 | "target": "es2022", 23 | "outDir": "../../lib/browser", 24 | "tsBuildInfoFile": "../../lib/browser/watch.tsbuildInfo", 25 | "incremental": true, 26 | "composite": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "exclude": [ 32 | "test" 33 | ], 34 | "references": [ 35 | { 36 | "path": "../common/tsconfig.watch.json" 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /jsonrpc/src/common/disposable.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | 6 | export interface Disposable { 7 | /** 8 | * Dispose this object. 9 | */ 10 | dispose(): void; 11 | } 12 | 13 | export namespace Disposable { 14 | export function create(func: () => void): Disposable { 15 | return { 16 | dispose: func 17 | }; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /jsonrpc/src/common/is.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | export function boolean(value: any): value is boolean { 7 | return value === true || value === false; 8 | } 9 | 10 | export function string(value: any): value is string { 11 | return typeof value === 'string' || value instanceof String; 12 | } 13 | 14 | export function number(value: any): value is number { 15 | return typeof value === 'number' || value instanceof Number; 16 | } 17 | 18 | export function error(value: any): value is Error { 19 | return value instanceof Error; 20 | } 21 | 22 | export function func(value: any): value is Function { 23 | return typeof value === 'function'; 24 | } 25 | 26 | export function array(value: any): value is T[] { 27 | return Array.isArray(value); 28 | } 29 | 30 | export function stringArray(value: any): value is string[] { 31 | return array(value) && (value).every(elem => string(elem)); 32 | } -------------------------------------------------------------------------------- /jsonrpc/src/common/test/general.test.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 'use strict'; 6 | 7 | import assert from 'assert'; 8 | import { Trace } from '../api'; 9 | 10 | suite('General Tests', () => { 11 | test('Trace#fromString', () => { 12 | assert(Trace.Off === Trace.fromString(10 as any)); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /jsonrpc/src/common/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "node16", 7 | "moduleResolution": "node16", 8 | "rootDir": ".", 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es2022", 20 | "lib": [ 21 | "es2023" 22 | ], 23 | "outDir": "../../../lib/common/test", 24 | "tsBuildInfoFile": "../../../lib/common/test/compile.tsbuildInfo", 25 | "incremental": true 26 | }, 27 | "include": [ 28 | "." 29 | ], 30 | "references": [ 31 | { 32 | "path": "../tsconfig.json" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /jsonrpc/src/common/test/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "node16", 7 | "moduleResolution": "node16", 8 | "rootDir": ".", 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": false, 16 | "declarationMap": false, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es2022", 20 | "lib": [ 21 | "es2023" 22 | ], 23 | "outDir": "../../../lib/common/test", 24 | "tsBuildInfoFile": "../../../lib/common/test/publish.tsbuildInfo", 25 | "incremental": true 26 | }, 27 | "include": [ 28 | "." 29 | ], 30 | "references": [ 31 | { 32 | "path": "../tsconfig.publish.json" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /jsonrpc/src/common/test/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "node16", 7 | "moduleResolution": "node16", 8 | "rootDir": ".", 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": false, 18 | "noUnusedParameters": false, 19 | "assumeChangesOnlyAffectDirectDependencies": true, 20 | "target": "es2022", 21 | "lib": [ 22 | "es2023" 23 | ], 24 | "outDir": "../../../lib/common/test", 25 | "tsBuildInfoFile": "../../../lib/common/test/watch.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "references": [ 32 | { 33 | "path": "../tsconfig.watch.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /jsonrpc/src/common/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": true, 14 | "declarationMap": true, 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | "target": "es2022", 18 | "lib": [ 19 | "es2023" 20 | ], 21 | "outDir": "../../lib/common", 22 | "tsBuildInfoFile": "../../lib/common/compile.tsbuildInfo", 23 | "incremental": true, 24 | "composite": true 25 | }, 26 | "include": [ 27 | "." 28 | ], 29 | "exclude": [ 30 | "test" 31 | ] 32 | } -------------------------------------------------------------------------------- /jsonrpc/src/common/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": false, 14 | "declarationMap": false, 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | "target": "es2022", 18 | "lib": [ 19 | "es2023" 20 | ], 21 | "outDir": "../../lib/common", 22 | "tsBuildInfoFile": "../../lib/common/publish.tsbuildInfo", 23 | "incremental": true, 24 | "composite": true 25 | }, 26 | "include": [ 27 | "." 28 | ], 29 | "exclude": [ 30 | "test" 31 | ] 32 | } -------------------------------------------------------------------------------- /jsonrpc/src/common/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": true, 14 | "declarationMap": true, 15 | "noUnusedLocals": false, 16 | "noUnusedParameters": false, 17 | "assumeChangesOnlyAffectDirectDependencies": true, 18 | "target": "es2022", 19 | "lib": [ 20 | "es2023" 21 | ], 22 | "outDir": "../../lib/common", 23 | "tsBuildInfoFile": "../../lib/common/watch.tsbuildInfo", 24 | "incremental": true, 25 | "composite": true 26 | }, 27 | "include": [ 28 | "." 29 | ], 30 | "exclude": [ 31 | "test" 32 | ] 33 | } -------------------------------------------------------------------------------- /jsonrpc/src/node/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "node", 5 | "mocha" 6 | ], 7 | "module": "node16", 8 | "moduleResolution": "node16", 9 | "rootDir": ".", 10 | "strict": true, 11 | "noImplicitAny": true, 12 | "noImplicitReturns": true, 13 | "noImplicitThis": true, 14 | "declaration": true, 15 | "stripInternal": true, 16 | "sourceMap": true, 17 | "declarationMap": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "target": "es2022", 21 | "lib": [ 22 | "es2023" 23 | ], 24 | "outDir": "../../../lib/node/test", 25 | "tsBuildInfoFile": "../../../lib/node/test/compile.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "references": [ 32 | { 33 | "path": "../tsconfig.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /jsonrpc/src/node/test/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "node", 5 | "mocha" 6 | ], 7 | "module": "node16", 8 | "moduleResolution": "node16", 9 | "rootDir": ".", 10 | "strict": true, 11 | "noImplicitAny": true, 12 | "noImplicitReturns": true, 13 | "noImplicitThis": true, 14 | "declaration": true, 15 | "stripInternal": true, 16 | "sourceMap": false, 17 | "declarationMap": false, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "target": "es2022", 21 | "lib": [ 22 | "es2023" 23 | ], 24 | "outDir": "../../../lib/node/test", 25 | "tsBuildInfoFile": "../../../lib/node/test/publish.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "references": [ 32 | { 33 | "path": "../tsconfig.publish.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /jsonrpc/src/node/test/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "node", 5 | "mocha" 6 | ], 7 | "module": "node16", 8 | "moduleResolution": "node16", 9 | "rootDir": ".", 10 | "strict": true, 11 | "noImplicitAny": true, 12 | "noImplicitReturns": true, 13 | "noImplicitThis": true, 14 | "declaration": true, 15 | "stripInternal": true, 16 | "sourceMap": true, 17 | "declarationMap": true, 18 | "noUnusedLocals": false, 19 | "noUnusedParameters": false, 20 | "assumeChangesOnlyAffectDirectDependencies": true, 21 | "target": "es2022", 22 | "lib": [ 23 | "es2023" 24 | ], 25 | "outDir": "../../../lib/node/test", 26 | "tsBuildInfoFile": "../../../lib/node/test/watch.tsbuildInfo", 27 | "incremental": true 28 | }, 29 | "include": [ 30 | "." 31 | ], 32 | "references": [ 33 | { 34 | "path": "../tsconfig.watch.json" 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /jsonrpc/src/node/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [ 7 | "node" 8 | ], 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es2022", 20 | "lib": [ 21 | "es2023" 22 | ], 23 | "outDir": "../../lib/node", 24 | "tsBuildInfoFile": "../../lib/node/compile.tsbuildInfo", 25 | "incremental": true, 26 | "composite": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "exclude": [ 32 | "test" 33 | ], 34 | "references": [ 35 | { 36 | "path": "../common/tsconfig.json" 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /jsonrpc/src/node/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [ 7 | "node" 8 | ], 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": false, 16 | "declarationMap": false, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es2022", 20 | "lib": [ 21 | "es2023" 22 | ], 23 | "outDir": "../../lib/node", 24 | "tsBuildInfoFile": "../../lib/node/publish.tsbuildInfo", 25 | "incremental": true, 26 | "composite": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "exclude": [ 32 | "test" 33 | ], 34 | "references": [ 35 | { 36 | "path": "../common/tsconfig.publish.json" 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /jsonrpc/src/node/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [ 7 | "node" 8 | ], 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": false, 18 | "noUnusedParameters": false, 19 | "assumeChangesOnlyAffectDirectDependencies": true, 20 | "target": "es2022", 21 | "lib": [ 22 | "es2023" 23 | ], 24 | "outDir": "../../lib/node", 25 | "tsBuildInfoFile": "../../lib/node/watch.tsbuildInfo", 26 | "incremental": true, 27 | "composite": true 28 | }, 29 | "include": [ 30 | "." 31 | ], 32 | "exclude": [ 33 | "test" 34 | ], 35 | "references": [ 36 | { 37 | "path": "../common/tsconfig.watch.json" 38 | } 39 | ] 40 | } -------------------------------------------------------------------------------- /jsonrpc/thirdpartynotices.txt: -------------------------------------------------------------------------------- 1 | NOTICES AND INFORMATION 2 | Do Not Translate or Localize 3 | 4 | This software incorporates material from third parties. 5 | Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, 6 | or you may send a check or money order for US $5.00, including the product name, 7 | the open source component name, platform, and version number, to: 8 | 9 | Source Code Compliance Team 10 | Microsoft Corporation 11 | One Microsoft Way 12 | Redmond, WA 98052 13 | USA 14 | 15 | Notwithstanding any other terms, you may reverse engineer this software to the extent 16 | required to debug changes to any libraries licensed under the GNU Lesser General Public License. -------------------------------------------------------------------------------- /jsonrpc/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./src/common/tsconfig.json" 10 | }, 11 | { 12 | "path": "./src/common/test/tsconfig.json" 13 | }, 14 | { 15 | "path": "./src/browser/tsconfig.json" 16 | }, 17 | { 18 | "path": "./src/browser/test/tsconfig.json" 19 | }, 20 | { 21 | "path": "./src/node/tsconfig.json" 22 | }, 23 | { 24 | "path": "./src/node/test/tsconfig.json" 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /jsonrpc/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./src/common/tsconfig.publish.json" 10 | }, 11 | { 12 | "path": "./src/common/test/tsconfig.publish.json" 13 | }, 14 | { 15 | "path": "./src/browser/tsconfig.publish.json" 16 | }, 17 | { 18 | "path": "./src/browser/test/tsconfig.publish.json" 19 | }, 20 | { 21 | "path": "./src/node/tsconfig.publish.json" 22 | }, 23 | { 24 | "path": "./src/node/test/tsconfig.publish.json" 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /jsonrpc/tsconfig.tsbuildinfo: -------------------------------------------------------------------------------- 1 | {"program":{"fileNames":[],"fileInfos":[],"root":[],"options":{"composite":true}},"version":"5.5.2"} -------------------------------------------------------------------------------- /jsonrpc/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./src/common/tsconfig.watch.json" 10 | }, 11 | { 12 | "path": "./src/common/test/tsconfig.watch.json" 13 | }, 14 | { 15 | "path": "./src/browser/tsconfig.watch.json" 16 | }, 17 | { 18 | "path": "./src/browser/test/tsconfig.watch.json" 19 | }, 20 | { 21 | "path": "./src/node/tsconfig.watch.json" 22 | }, 23 | { 24 | "path": "./src/node/test/tsconfig.watch.json" 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /jsonrpc/typings/thenable.d.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | interface Thenable extends PromiseLike { } -------------------------------------------------------------------------------- /jsonrpc/webpack.config.js: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | //@ts-check 6 | /** @typedef {import('webpack').Configuration} WebpackConfig **/ 7 | 8 | 'use strict'; 9 | 10 | module.exports = { 11 | context: __dirname, 12 | mode: 'none', 13 | target: 'webworker', 14 | resolve: { 15 | mainFields: ['module', 'main'], 16 | extensions: ['.js'] // support ts-files and js-files 17 | }, 18 | entry: { 19 | extension: './lib/browser/main.js', 20 | }, 21 | devtool: 'source-map', 22 | output: { 23 | filename: 'main.js' 24 | } 25 | }; -------------------------------------------------------------------------------- /protocol/.eslintignore: -------------------------------------------------------------------------------- 1 | lib 2 | node_modules -------------------------------------------------------------------------------- /protocol/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../.eslintrc.base.json", 3 | "parserOptions": { 4 | "project": ["src/common/tsconfig.json", "src/browser/tsconfig.json", "src/browser/test/tsconfig.json", "src/node/tsconfig.json", "src/node/test/tsconfig.json"] 5 | }, 6 | "rules": { 7 | "no-console": "error", 8 | "@typescript-eslint/no-floating-promises": "error" 9 | } 10 | } -------------------------------------------------------------------------------- /protocol/.mocharc.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec": "lib/node/test", 3 | "extension": ["js"], 4 | "recursive": true, 5 | "ui": "tdd" 6 | } -------------------------------------------------------------------------------- /protocol/.npmignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | dist/ 3 | lib/**/test/ 4 | lib/**/*.map 5 | lib/**/*.tsbuildInfo 6 | src/ 7 | test/ 8 | .eslintrc* 9 | .eslintignore 10 | .mocharc* 11 | .gitignore 12 | gulpfile.js 13 | tsd.json 14 | tsconfig*.json 15 | metaModel.json -------------------------------------------------------------------------------- /protocol/License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) Microsoft Corporation 2 | 3 | All rights reserved. 4 | 5 | MIT License 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | -------------------------------------------------------------------------------- /protocol/README.md: -------------------------------------------------------------------------------- 1 | # VSCode Language Server - Protocol Module 2 | 3 | [![NPM Version](https://img.shields.io/npm/v/vscode-languageserver-protocol.svg)](https://npmjs.org/package/vscode-languageserver-protocol) 4 | [![NPM Downloads](https://img.shields.io/npm/dm/vscode-languageserver-protocol.svg)](https://npmjs.org/package/vscode-languageserver-protocol) 5 | [![Build Status](https://dev.azure.com/vscode/vscode-languageserver-node/_apis/build/status%2Fvscode-languageserver-node?branchName=main)](https://dev.azure.com/vscode/vscode-languageserver-node/_build/latest?definitionId=52&branchName=main) 6 | 7 | This npm module is a tool independent implementation of the language server protocol and can be used in any type of node application. Please note that the protocol is versioned using the LSP specification version number. Since the protocol depends on the `vscode-jsonrpc` version a a breaking change on that dependencies might not be reflected in a major version change of this module. Changing the major version number in these cases was more confusing this it would result in a version mismatch between the protocol and the LSP specification. 8 | 9 | See [here](https://github.com/Microsoft/language-server-protocol) for a detailed documentation on the language server protocol. 10 | 11 | ## History 12 | 13 | For the history please see the [main repository](https://github.com/Microsoft/vscode-languageserver-node/blob/master/README.md) 14 | 15 | ## License 16 | [MIT](https://github.com/Microsoft/vscode-languageserver-node/blob/master/License.txt) 17 | -------------------------------------------------------------------------------- /protocol/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-languageserver-protocol", 3 | "version": "3.17.6-next.14", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "vscode-languageserver-protocol", 9 | "version": "3.17.6-next.14", 10 | "license": "MIT", 11 | "dependencies": { 12 | "vscode-jsonrpc": "9.0.0-next.9", 13 | "vscode-languageserver-types": "3.17.6-next.6" 14 | } 15 | }, 16 | "node_modules/vscode-jsonrpc": { 17 | "version": "9.0.0-next.9", 18 | "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-9.0.0-next.9.tgz", 19 | "integrity": "sha512-IM/RHL7ZklEUh1N2Rh4OjRL6D9MyIXq3v+zIkPLXq74hM1eW7WRLP0/cjzNu/baRFC00sFxJm95RBKsT8dXzRQ==", 20 | "license": "MIT", 21 | "engines": { 22 | "node": ">=14.0.0" 23 | } 24 | }, 25 | "node_modules/vscode-languageserver-types": { 26 | "version": "3.17.6-next.6", 27 | "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.6-next.6.tgz", 28 | "integrity": "sha512-aiJY5/yW+xzw7KPNlwi3gQtddq/3EIn5z8X8nCgJfaiAij2R1APKePngv+MUdLdYJBVTLu+Qa0ODsT+pHgYguQ==", 29 | "license": "MIT" 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /protocol/src/browser/main.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import { MessageReader, MessageWriter, Logger, ConnectionStrategy, ConnectionOptions, ProtocolConnection } from '../common/api'; 7 | import { createMessageConnection } from 'vscode-jsonrpc/browser'; 8 | 9 | export * from 'vscode-jsonrpc/browser'; 10 | export * from '../common/api'; 11 | 12 | export function createProtocolConnection(reader: MessageReader, writer: MessageWriter, logger?: Logger, options?: ConnectionStrategy | ConnectionOptions): ProtocolConnection { 13 | return createMessageConnection(reader, writer, logger, options); 14 | } -------------------------------------------------------------------------------- /protocol/src/browser/test/test.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import * as assert from 'assert'; 7 | 8 | import { CompletionRequest, CompletionParams, CompletionItem } from '../../common/api'; 9 | import { BrowserMessageReader, BrowserMessageWriter, createProtocolConnection } from '../main'; 10 | 11 | suite('Browser Protocol Tests', () => { 12 | const worker = new Worker('/protocol/dist/worker.js'); 13 | const reader = new BrowserMessageReader(worker); 14 | const writer = new BrowserMessageWriter(worker); 15 | const connection = createProtocolConnection(reader, writer); 16 | connection.listen(); 17 | test('Test Code Completion Request', async () => { 18 | const params: CompletionParams = { 19 | textDocument: { uri: 'file:///folder/a.ts' }, 20 | position: { line: 1, character: 1} 21 | }; 22 | const result = (await connection.sendRequest(CompletionRequest.type, params)) as CompletionItem[]; 23 | assert.strictEqual(result!.length, 0); 24 | }); 25 | }); -------------------------------------------------------------------------------- /protocol/src/browser/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "node16", 7 | "moduleResolution": "node16", 8 | "rootDir": ".", 9 | "lib": [ 10 | "es2023", 11 | "webworker" 12 | ], 13 | "strict": true, 14 | "noImplicitAny": true, 15 | "noImplicitReturns": true, 16 | "noImplicitThis": true, 17 | "declaration": true, 18 | "stripInternal": true, 19 | "sourceMap": true, 20 | "declarationMap": true, 21 | "noUnusedLocals": true, 22 | "noUnusedParameters": true, 23 | "target": "es2022", 24 | "outDir": "../../../lib/browser/test", 25 | "tsBuildInfoFile": "../../../lib/browser/test/compile.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "references": [ 32 | { 33 | "path": "../tsconfig.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /protocol/src/browser/test/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "node16", 7 | "moduleResolution": "node16", 8 | "rootDir": ".", 9 | "lib": [ 10 | "es2023", 11 | "webworker" 12 | ], 13 | "strict": true, 14 | "noImplicitAny": true, 15 | "noImplicitReturns": true, 16 | "noImplicitThis": true, 17 | "declaration": true, 18 | "stripInternal": true, 19 | "sourceMap": false, 20 | "declarationMap": false, 21 | "noUnusedLocals": true, 22 | "noUnusedParameters": true, 23 | "target": "es2022", 24 | "outDir": "../../../lib/browser/test", 25 | "tsBuildInfoFile": "../../../lib/browser/test/publish.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "references": [ 32 | { 33 | "path": "../tsconfig.publish.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /protocol/src/browser/test/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "node16", 7 | "moduleResolution": "node16", 8 | "rootDir": ".", 9 | "lib": [ 10 | "es2023", 11 | "webworker" 12 | ], 13 | "strict": true, 14 | "noImplicitAny": true, 15 | "noImplicitReturns": true, 16 | "noImplicitThis": true, 17 | "declaration": true, 18 | "stripInternal": true, 19 | "sourceMap": true, 20 | "declarationMap": true, 21 | "noUnusedLocals": false, 22 | "noUnusedParameters": false, 23 | "assumeChangesOnlyAffectDirectDependencies": true, 24 | "target": "es2022", 25 | "outDir": "../../../lib/browser/test", 26 | "tsBuildInfoFile": "../../../lib/browser/test/watch.tsbuildInfo", 27 | "incremental": true 28 | }, 29 | "include": [ 30 | "." 31 | ], 32 | "references": [ 33 | { 34 | "path": "../tsconfig.watch.json" 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /protocol/src/browser/test/webpack.config.js: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | *--------------------------------------------------------------------------------------------*/ 5 | //@ts-check 6 | /** @typedef {import('webpack').Configuration} WebpackConfig **/ 7 | 8 | 'use strict'; 9 | 10 | const NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); 11 | const webpack = require('webpack'); 12 | 13 | module.exports = [{ 14 | context: __dirname, 15 | mode: 'none', 16 | target: 'webworker', 17 | plugins: [ 18 | new NodePolyfillPlugin(), 19 | new webpack.DefinePlugin({ 20 | 'process.env.NODE_DEBUG': JSON.stringify(''), 21 | }) 22 | ], 23 | resolve: { 24 | mainFields: ['module', 'main'], 25 | extensions: ['.js'] 26 | }, 27 | entry: { 28 | extension: '../../../lib/browser/test/test.js', 29 | }, 30 | devtool: 'source-map', 31 | output: { 32 | filename: 'tests.js' 33 | } 34 | }, { 35 | context: __dirname, 36 | mode: 'none', 37 | target: 'webworker', 38 | plugins: [ 39 | new NodePolyfillPlugin() 40 | ], 41 | resolve: { 42 | mainFields: ['module', 'main'], 43 | extensions: ['.js'] 44 | }, 45 | entry: { 46 | extension: '../../../lib/browser/test/worker.js', 47 | }, 48 | devtool: 'source-map', 49 | output: { 50 | filename: 'worker.js' 51 | } 52 | 53 | }]; -------------------------------------------------------------------------------- /protocol/src/browser/test/worker.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import { createProtocolConnection, BrowserMessageReader, BrowserMessageWriter } from '../main'; 7 | import { CompletionRequest } from '../../common/api'; 8 | 9 | const reader: BrowserMessageReader = new BrowserMessageReader(self); 10 | const writer: BrowserMessageWriter = new BrowserMessageWriter(self); 11 | 12 | const connection = createProtocolConnection(reader, writer); 13 | 14 | connection.onRequest(CompletionRequest.type, (_params) => { 15 | return []; 16 | }); 17 | 18 | connection.listen(); -------------------------------------------------------------------------------- /protocol/src/browser/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "lib": [ 8 | "es2023", 9 | "webworker" 10 | ], 11 | "strict": true, 12 | "noImplicitAny": true, 13 | "noImplicitReturns": true, 14 | "noImplicitThis": true, 15 | "declaration": true, 16 | "stripInternal": true, 17 | "sourceMap": true, 18 | "declarationMap": true, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "target": "es2022", 22 | "outDir": "../../lib/browser", 23 | "tsBuildInfoFile": "../../lib/browser/compile.tsbuildInfo", 24 | "incremental": true, 25 | "composite": true 26 | }, 27 | "include": [ 28 | "." 29 | ], 30 | "exclude": [ 31 | "test" 32 | ], 33 | "references": [ 34 | { 35 | "path": "../common/tsconfig.json" 36 | } 37 | ] 38 | } -------------------------------------------------------------------------------- /protocol/src/browser/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "lib": [ 8 | "es2023", 9 | "webworker" 10 | ], 11 | "strict": true, 12 | "noImplicitAny": true, 13 | "noImplicitReturns": true, 14 | "noImplicitThis": true, 15 | "declaration": true, 16 | "stripInternal": true, 17 | "sourceMap": false, 18 | "declarationMap": false, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "target": "es2022", 22 | "outDir": "../../lib/browser", 23 | "tsBuildInfoFile": "../../lib/browser/publish.tsbuildInfo", 24 | "incremental": true, 25 | "composite": true 26 | }, 27 | "include": [ 28 | "." 29 | ], 30 | "exclude": [ 31 | "test" 32 | ], 33 | "references": [ 34 | { 35 | "path": "../common/tsconfig.publish.json" 36 | } 37 | ] 38 | } -------------------------------------------------------------------------------- /protocol/src/browser/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "lib": [ 8 | "es2023", 9 | "webworker" 10 | ], 11 | "strict": true, 12 | "noImplicitAny": true, 13 | "noImplicitReturns": true, 14 | "noImplicitThis": true, 15 | "declaration": true, 16 | "stripInternal": true, 17 | "sourceMap": true, 18 | "declarationMap": true, 19 | "noUnusedLocals": false, 20 | "noUnusedParameters": false, 21 | "assumeChangesOnlyAffectDirectDependencies": true, 22 | "target": "es2022", 23 | "outDir": "../../lib/browser", 24 | "tsBuildInfoFile": "../../lib/browser/watch.tsbuildInfo", 25 | "incremental": true, 26 | "composite": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "exclude": [ 32 | "test" 33 | ], 34 | "references": [ 35 | { 36 | "path": "../common/tsconfig.watch.json" 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /protocol/src/common/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": true, 14 | "declarationMap": true, 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | "target": "es2022", 18 | "lib": [ 19 | "es2023" 20 | ], 21 | "outDir": "../../lib/common", 22 | "tsBuildInfoFile": "../../lib/common/compile.tsbuildInfo", 23 | "incremental": true, 24 | "composite": true 25 | }, 26 | "include": [ 27 | "." 28 | ] 29 | } -------------------------------------------------------------------------------- /protocol/src/common/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": false, 14 | "declarationMap": false, 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | "target": "es2022", 18 | "lib": [ 19 | "es2023" 20 | ], 21 | "outDir": "../../lib/common", 22 | "tsBuildInfoFile": "../../lib/common/publish.tsbuildInfo", 23 | "incremental": true, 24 | "composite": true 25 | }, 26 | "include": [ 27 | "." 28 | ] 29 | } -------------------------------------------------------------------------------- /protocol/src/common/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": true, 14 | "declarationMap": true, 15 | "noUnusedLocals": false, 16 | "noUnusedParameters": false, 17 | "assumeChangesOnlyAffectDirectDependencies": true, 18 | "target": "es2022", 19 | "lib": [ 20 | "es2023" 21 | ], 22 | "outDir": "../../lib/common", 23 | "tsBuildInfoFile": "../../lib/common/watch.tsbuildInfo", 24 | "incremental": true, 25 | "composite": true 26 | }, 27 | "include": [ 28 | "." 29 | ] 30 | } -------------------------------------------------------------------------------- /protocol/src/node/main.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import { MessageReader, MessageWriter, Logger, ConnectionStrategy, ConnectionOptions, ProtocolConnection } from '../common/api'; 7 | import { createMessageConnection } from 'vscode-jsonrpc/node'; 8 | 9 | export * from 'vscode-jsonrpc/node'; 10 | export * from '../common/api'; 11 | 12 | export function createProtocolConnection(input: MessageReader, output: MessageWriter, logger?: Logger, options?: ConnectionStrategy | ConnectionOptions): ProtocolConnection; 13 | export function createProtocolConnection(input: NodeJS.ReadableStream, output: NodeJS.WritableStream, logger?: Logger, options?: ConnectionStrategy | ConnectionOptions): ProtocolConnection; 14 | export function createProtocolConnection(input: MessageReader | NodeJS.ReadableStream, output: MessageWriter | NodeJS.WritableStream, logger?: Logger, options?: ConnectionStrategy | ConnectionOptions): ProtocolConnection { 15 | return createMessageConnection(input as any, output as any, logger, options); 16 | } -------------------------------------------------------------------------------- /protocol/src/node/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "node", 5 | "mocha" 6 | ], 7 | "module": "node16", 8 | "moduleResolution": "node16", 9 | "rootDir": ".", 10 | "strict": true, 11 | "noImplicitAny": true, 12 | "noImplicitReturns": true, 13 | "noImplicitThis": true, 14 | "declaration": true, 15 | "stripInternal": true, 16 | "sourceMap": true, 17 | "declarationMap": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "target": "es2022", 21 | "lib": [ 22 | "es2023" 23 | ], 24 | "outDir": "../../../lib/node/test", 25 | "tsBuildInfoFile": "../../../lib/node/test/compile.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "references": [ 32 | { 33 | "path": "../tsconfig.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /protocol/src/node/test/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "node", 5 | "mocha" 6 | ], 7 | "module": "node16", 8 | "moduleResolution": "node16", 9 | "rootDir": ".", 10 | "strict": true, 11 | "noImplicitAny": true, 12 | "noImplicitReturns": true, 13 | "noImplicitThis": true, 14 | "declaration": true, 15 | "stripInternal": true, 16 | "sourceMap": false, 17 | "declarationMap": false, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "target": "es2022", 21 | "lib": [ 22 | "es2023" 23 | ], 24 | "outDir": "../../../lib/node/test", 25 | "tsBuildInfoFile": "../../../lib/node/test/publish.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "references": [ 32 | { 33 | "path": "../tsconfig.publish.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /protocol/src/node/test/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "node", 5 | "mocha" 6 | ], 7 | "module": "node16", 8 | "moduleResolution": "node16", 9 | "rootDir": ".", 10 | "strict": true, 11 | "noImplicitAny": true, 12 | "noImplicitReturns": true, 13 | "noImplicitThis": true, 14 | "declaration": true, 15 | "stripInternal": true, 16 | "sourceMap": true, 17 | "declarationMap": true, 18 | "noUnusedLocals": false, 19 | "noUnusedParameters": false, 20 | "assumeChangesOnlyAffectDirectDependencies": true, 21 | "target": "es2022", 22 | "lib": [ 23 | "es2023" 24 | ], 25 | "outDir": "../../../lib/node/test", 26 | "tsBuildInfoFile": "../../../lib/node/test/watch.tsbuildInfo", 27 | "incremental": true 28 | }, 29 | "include": [ 30 | "." 31 | ], 32 | "references": [ 33 | { 34 | "path": "../tsconfig.watch.json" 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /protocol/src/node/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [ 7 | "node" 8 | ], 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es2022", 20 | "lib": [ 21 | "es2023" 22 | ], 23 | "outDir": "../../lib/node", 24 | "tsBuildInfoFile": "../../lib/node/compile.tsbuildInfo", 25 | "incremental": true, 26 | "composite": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "exclude": [ 32 | "test" 33 | ], 34 | "references": [ 35 | { 36 | "path": "../common/tsconfig.json" 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /protocol/src/node/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [ 7 | "node" 8 | ], 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": false, 16 | "declarationMap": false, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es2022", 20 | "lib": [ 21 | "es2023" 22 | ], 23 | "outDir": "../../lib/node", 24 | "tsBuildInfoFile": "../../lib/node/publish.tsbuildInfo", 25 | "incremental": true, 26 | "composite": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "exclude": [ 32 | "test" 33 | ], 34 | "references": [ 35 | { 36 | "path": "../common/tsconfig.publish.json" 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /protocol/src/node/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [ 7 | "node" 8 | ], 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": false, 18 | "noUnusedParameters": false, 19 | "assumeChangesOnlyAffectDirectDependencies": true, 20 | "target": "es2022", 21 | "lib": [ 22 | "es2023" 23 | ], 24 | "outDir": "../../lib/node", 25 | "tsBuildInfoFile": "../../lib/node/watch.tsbuildInfo", 26 | "incremental": true, 27 | "composite": true 28 | }, 29 | "include": [ 30 | "." 31 | ], 32 | "exclude": [ 33 | "test" 34 | ], 35 | "references": [ 36 | { 37 | "path": "../common/tsconfig.watch.json" 38 | } 39 | ] 40 | } -------------------------------------------------------------------------------- /protocol/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./../types/tsconfig.json" 10 | }, 11 | { 12 | "path": "./../jsonrpc/tsconfig.json" 13 | }, 14 | { 15 | "path": "./src/common/tsconfig.json" 16 | }, 17 | { 18 | "path": "./src/browser/tsconfig.json" 19 | }, 20 | { 21 | "path": "./src/browser/test/tsconfig.json" 22 | }, 23 | { 24 | "path": "./src/node/tsconfig.json" 25 | }, 26 | { 27 | "path": "./src/node/test/tsconfig.json" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /protocol/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./src/common/tsconfig.publish.json" 10 | }, 11 | { 12 | "path": "./src/browser/tsconfig.publish.json" 13 | }, 14 | { 15 | "path": "./src/browser/test/tsconfig.publish.json" 16 | }, 17 | { 18 | "path": "./src/node/tsconfig.publish.json" 19 | }, 20 | { 21 | "path": "./src/node/test/tsconfig.publish.json" 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /protocol/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./../types/tsconfig.watch.json" 10 | }, 11 | { 12 | "path": "./../jsonrpc/tsconfig.watch.json" 13 | }, 14 | { 15 | "path": "./src/common/tsconfig.watch.json" 16 | }, 17 | { 18 | "path": "./src/browser/tsconfig.watch.json" 19 | }, 20 | { 21 | "path": "./src/browser/test/tsconfig.watch.json" 22 | }, 23 | { 24 | "path": "./src/node/tsconfig.watch.json" 25 | }, 26 | { 27 | "path": "./src/node/test/tsconfig.watch.json" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /server/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib -------------------------------------------------------------------------------- /server/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../.eslintrc.base.json", 3 | "parserOptions": { 4 | "project": ["src/browser/tsconfig.json", "src/common/tsconfig.json", "src/node/tsconfig.json", "src/node/test/tsconfig.json"] 5 | }, 6 | "rules": { 7 | } 8 | } -------------------------------------------------------------------------------- /server/.gitignore: -------------------------------------------------------------------------------- 1 | !bin/ -------------------------------------------------------------------------------- /server/.mocharc.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec": "lib/node/test", 3 | "extension": ["js"], 4 | "recursive": true, 5 | "ui": "tdd" 6 | } -------------------------------------------------------------------------------- /server/.npmignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | lib/**/test/ 3 | lib/**/*.map 4 | lib/**/*.tsbuildInfo 5 | src/ 6 | test/ 7 | .eslintrc* 8 | .eslintignore 9 | .mocharc* 10 | .gitignore 11 | gulpfile.js 12 | tsd.json 13 | tsconfig*.json -------------------------------------------------------------------------------- /server/License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) Microsoft Corporation 2 | 3 | All rights reserved. 4 | 5 | MIT License 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | -------------------------------------------------------------------------------- /server/README.md: -------------------------------------------------------------------------------- 1 | # VSCode Language Server 2 | 3 | [![NPM Version](https://img.shields.io/npm/v/vscode-languageserver.svg)](https://npmjs.org/package/vscode-languageserver) 4 | [![NPM Downloads](https://img.shields.io/npm/dm/vscode-languageserver.svg)](https://npmjs.org/package/vscode-languageserver) 5 | [![Build Status](https://dev.azure.com/vscode/vscode-languageserver-node/_apis/build/status%2Fvscode-languageserver-node?branchName=main)](https://dev.azure.com/vscode/vscode-languageserver-node/_build/latest?definitionId=52&branchName=main) 6 | 7 | Npm module to implement a VSCode language server using [Node.js](https://nodejs.org/) as a runtime. 8 | 9 | Click [here](https://code.visualstudio.com/docs/extensions/example-language-server) for a detailed document on how to use this npm module 10 | to implement language servers for [VSCode](https://code.visualstudio.com/). 11 | 12 | ## History 13 | 14 | For the history please see the [main repository](https://github.com/Microsoft/vscode-languageserver-node/blob/master/README.md) 15 | 16 | ## License 17 | [MIT](https://github.com/Microsoft/vscode-languageserver-node/blob/master/License.txt) -------------------------------------------------------------------------------- /server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-languageserver", 3 | "description": "Language server implementation for node", 4 | "version": "10.0.0-next.14", 5 | "author": "Microsoft Corporation", 6 | "license": "MIT", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/Microsoft/vscode-languageserver-node.git", 10 | "directory": "server" 11 | }, 12 | "bugs": { 13 | "url": "https://github.com/Microsoft/vscode-languageserver-node/issues" 14 | }, 15 | "exports": { 16 | ".": { 17 | "types": "./lib/common/api.d.ts", 18 | "default": "./lib/common/api.js" 19 | }, 20 | "./node": { 21 | "types": "./lib/node/main.d.ts", 22 | "node": "./lib/node/main.js" 23 | }, 24 | "./browser": { 25 | "types": "./lib/browser/main.d.ts", 26 | "browser": "./lib/browser/main.js" 27 | } 28 | }, 29 | "bin": { 30 | "installServerIntoExtension": "./bin/installServerIntoExtension" 31 | }, 32 | "devDependencies": { 33 | "vscode-languageserver-textdocument": "1.0.12" 34 | }, 35 | "dependencies": { 36 | "vscode-languageserver-protocol": "3.17.6-next.14" 37 | }, 38 | "scripts": { 39 | "prepublishOnly": "echo \"⛔ Can only publish from a secure pipeline ⛔\" && node ../build/npm/fail", 40 | "prepack": "npm run all:publish", 41 | "compile": "tsc -b ./tsconfig.json", 42 | "watch": "tsc -b ./tsconfig.watch.json -w", 43 | "clean": "rimraf lib", 44 | "lint": "eslint --ext ts src", 45 | "test": "node ../node_modules/mocha/bin/_mocha", 46 | "all": "npm run clean && npm run compile && npm run lint && npm test", 47 | "compile:publish": "tsc -b ./tsconfig.publish.json", 48 | "all:publish": "git clean -xfd . && npm install && npm run compile:publish && npm run lint && npm test", 49 | "preversion": "npm test" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /server/src/browser/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "lib": [ 8 | "es2023", 9 | "webworker" 10 | ], 11 | "strict": true, 12 | "noImplicitAny": true, 13 | "noImplicitReturns": true, 14 | "noImplicitThis": true, 15 | "declaration": true, 16 | "stripInternal": true, 17 | "sourceMap": true, 18 | "declarationMap": true, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "target": "es2022", 22 | "outDir": "../../lib/browser", 23 | "tsBuildInfoFile": "../../lib/browser/compile.tsbuildInfo", 24 | "incremental": true 25 | }, 26 | "include": [ 27 | "." 28 | ], 29 | "references": [ 30 | { 31 | "path": "../common/tsconfig.json" 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /server/src/browser/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "lib": [ 8 | "es2023", 9 | "webworker" 10 | ], 11 | "strict": true, 12 | "noImplicitAny": true, 13 | "noImplicitReturns": true, 14 | "noImplicitThis": true, 15 | "declaration": true, 16 | "stripInternal": true, 17 | "sourceMap": false, 18 | "declarationMap": false, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "target": "es2022", 22 | "outDir": "../../lib/browser", 23 | "tsBuildInfoFile": "../../lib/browser/publish.tsbuildInfo", 24 | "incremental": true 25 | }, 26 | "include": [ 27 | "." 28 | ], 29 | "references": [ 30 | { 31 | "path": "../common/tsconfig.publish.json" 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /server/src/browser/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "lib": [ 8 | "es2023", 9 | "webworker" 10 | ], 11 | "strict": true, 12 | "noImplicitAny": true, 13 | "noImplicitReturns": true, 14 | "noImplicitThis": true, 15 | "declaration": true, 16 | "stripInternal": true, 17 | "sourceMap": true, 18 | "declarationMap": true, 19 | "noUnusedLocals": false, 20 | "noUnusedParameters": false, 21 | "assumeChangesOnlyAffectDirectDependencies": true, 22 | "target": "es2022", 23 | "outDir": "../../lib/browser", 24 | "tsBuildInfoFile": "../../lib/browser/watch.tsbuildInfo", 25 | "incremental": true 26 | }, 27 | "include": [ 28 | "." 29 | ], 30 | "references": [ 31 | { 32 | "path": "../common/tsconfig.watch.json" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /server/src/common/api.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import { _, Features, _Connection, _LanguagesImpl } from './server'; 7 | import { SemanticTokensBuilder } from './semanticTokens'; 8 | import type { WorkDoneProgressReporter, WorkDoneProgressServerReporter, ResultProgressReporter } from './progress'; 9 | 10 | import * as ic from './inlineCompletion.proposed'; 11 | import * as tdc from './textDocumentContent'; 12 | 13 | export * from 'vscode-languageserver-protocol'; 14 | export { WorkDoneProgressReporter, WorkDoneProgressServerReporter, ResultProgressReporter }; 15 | export { SemanticTokensBuilder }; 16 | import { TextDocuments, TextDocumentsConfiguration, TextDocumentChangeEvent, TextDocumentWillSaveEvent } from './textDocuments'; 17 | export { TextDocuments, TextDocumentsConfiguration, TextDocumentChangeEvent, TextDocumentWillSaveEvent }; 18 | import { NotebookDocuments } from './notebook'; 19 | export { NotebookDocuments }; 20 | export * from './server'; 21 | 22 | export namespace ProposedFeatures { 23 | export const all: Features<_, _, _, _, _, tdc.TextDocumentContentFeatureShape, ic.InlineCompletionFeatureShape, _> = { 24 | __brand: 'features', 25 | workspace: tdc.TextDocumentContentFeature, 26 | languages: ic.InlineCompletionFeature 27 | }; 28 | 29 | export type Connection = _Connection<_, _, _, _, _, tdc.TextDocumentContentFeatureShape, ic.InlineCompletionFeatureShape, _>; 30 | } -------------------------------------------------------------------------------- /server/src/common/linkedEditingRange.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import { LinkedEditingRangeParams, LinkedEditingRanges, LinkedEditingRangeRequest, Disposable } from 'vscode-languageserver-protocol'; 7 | 8 | import type { Feature, _Languages, ServerRequestHandler } from './server'; 9 | 10 | /** 11 | * Shape of the linked editing feature 12 | * 13 | * @since 3.16.0 14 | */ 15 | export interface LinkedEditingRangeFeatureShape { 16 | /** 17 | * Installs a handler for the linked editing range request. 18 | * 19 | * @param handler The corresponding handler. 20 | */ 21 | onLinkedEditingRange(handler: ServerRequestHandler): Disposable; 22 | } 23 | 24 | export const LinkedEditingRangeFeature: Feature<_Languages, LinkedEditingRangeFeatureShape> = (Base) => { 25 | return class extends Base { 26 | public onLinkedEditingRange(handler: ServerRequestHandler): Disposable { 27 | return this.connection.onRequest(LinkedEditingRangeRequest.type, (params, cancel) => { 28 | return handler(params, cancel, this.attachWorkDoneProgress(params), undefined); 29 | }); 30 | } 31 | }; 32 | }; -------------------------------------------------------------------------------- /server/src/common/moniker.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 'use strict'; 6 | 7 | import { MonikerParams, Moniker, MonikerRequest, Disposable } from 'vscode-languageserver-protocol'; 8 | 9 | import type { Feature, _Languages, ServerRequestHandler } from './server'; 10 | 11 | /** 12 | * Shape of the moniker feature 13 | * 14 | * @since 3.16.0 15 | */ 16 | export interface MonikerFeatureShape { 17 | moniker: { 18 | on(handler: ServerRequestHandler): Disposable; 19 | }; 20 | } 21 | 22 | export const MonikerFeature : Feature<_Languages, MonikerFeatureShape> = (Base) => { 23 | return class extends Base { 24 | public get moniker() { 25 | return { 26 | on: (handler: ServerRequestHandler): Disposable => { 27 | const type = MonikerRequest.type; 28 | return this.connection.onRequest(type, (params, cancel) => { 29 | return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params)); 30 | }); 31 | }, 32 | }; 33 | } 34 | }; 35 | }; -------------------------------------------------------------------------------- /server/src/common/showDocument.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import { ShowDocumentParams, ShowDocumentRequest, ShowDocumentResult } from 'vscode-languageserver-protocol'; 7 | import type { Feature, _RemoteWindow } from './server'; 8 | 9 | export interface ShowDocumentFeatureShape { 10 | showDocument(params: ShowDocumentParams): Promise; 11 | } 12 | 13 | export const ShowDocumentFeature: Feature<_RemoteWindow, ShowDocumentFeatureShape> = (Base) => { 14 | return class extends Base { 15 | 16 | showDocument(params: ShowDocumentParams): Promise { 17 | return this.connection.sendRequest(ShowDocumentRequest.type, params); 18 | } 19 | }; 20 | }; -------------------------------------------------------------------------------- /server/src/common/textDocumentContent.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import { TextDocumentContentRefreshRequest, TextDocumentContentRequest, type Disposable, type DocumentUri, type RequestHandler, type TextDocumentContentParams, type TextDocumentContentResult } from 'vscode-languageserver-protocol'; 7 | 8 | import type { Feature, _RemoteWorkspace } from './server'; 9 | 10 | /** 11 | * Shape of the text document content feature 12 | * 13 | * @since 3.18.0 14 | * @proposed 15 | */ 16 | export interface TextDocumentContentFeatureShape { 17 | textDocumentContent: { 18 | refresh(uri: DocumentUri): Promise; 19 | on(handler: RequestHandler): Disposable; 20 | }; 21 | } 22 | 23 | export const TextDocumentContentFeature: Feature<_RemoteWorkspace, TextDocumentContentFeatureShape> = (Base) => { 24 | return class extends Base { 25 | public get textDocumentContent() { 26 | return { 27 | refresh: (uri: DocumentUri): Promise => { 28 | return this.connection.sendRequest(TextDocumentContentRefreshRequest.type, { uri }); 29 | }, 30 | on: (handler: RequestHandler): Disposable => { 31 | return this.connection.onRequest(TextDocumentContentRequest.type, (params, cancel) => { 32 | return handler(params, cancel); 33 | }); 34 | } 35 | }; 36 | } 37 | }; 38 | }; -------------------------------------------------------------------------------- /server/src/common/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": true, 14 | "declarationMap": true, 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | "target": "es2022", 18 | "lib": [ 19 | "es2023" 20 | ], 21 | "outDir": "../../lib/common", 22 | "tsBuildInfoFile": "../../lib/common/compile.tsbuildInfo", 23 | "incremental": true, 24 | "composite": true 25 | }, 26 | "include": [ 27 | "." 28 | ] 29 | } -------------------------------------------------------------------------------- /server/src/common/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": false, 14 | "declarationMap": false, 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | "target": "es2022", 18 | "lib": [ 19 | "es2023" 20 | ], 21 | "outDir": "../../lib/common", 22 | "tsBuildInfoFile": "../../lib/common/publish.tsbuildInfo", 23 | "incremental": true, 24 | "composite": true 25 | }, 26 | "include": [ 27 | "." 28 | ] 29 | } -------------------------------------------------------------------------------- /server/src/common/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": true, 14 | "declarationMap": true, 15 | "noUnusedLocals": false, 16 | "noUnusedParameters": false, 17 | "assumeChangesOnlyAffectDirectDependencies": true, 18 | "target": "es2022", 19 | "lib": [ 20 | "es2023" 21 | ], 22 | "outDir": "../../lib/common", 23 | "tsBuildInfoFile": "../../lib/common/watch.tsbuildInfo", 24 | "incremental": true, 25 | "composite": true 26 | }, 27 | "include": [ 28 | "." 29 | ] 30 | } -------------------------------------------------------------------------------- /server/src/common/utils/is.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | export function boolean(value: any): value is boolean { 7 | return value === true || value === false; 8 | } 9 | 10 | export function string(value: any): value is string { 11 | return typeof value === 'string' || value instanceof String; 12 | } 13 | 14 | export function number(value: any): value is number { 15 | return typeof value === 'number' || value instanceof Number; 16 | } 17 | 18 | export function error(value: any): value is Error { 19 | return value instanceof Error; 20 | } 21 | 22 | export function func(value: any): value is Function { 23 | return typeof value === 'function'; 24 | } 25 | 26 | export function array(value: any): value is T[] { 27 | return Array.isArray(value); 28 | } 29 | 30 | export function stringArray(value: any): value is string[] { 31 | return array(value) && (value).every(elem => string(elem)); 32 | } 33 | 34 | export function typedArray(value: any, check: (value: any) => boolean): value is T[] { 35 | return Array.isArray(value) && (value).every(check); 36 | } 37 | 38 | export function thenable(value: any): value is Thenable { 39 | return value && func(value.then); 40 | } -------------------------------------------------------------------------------- /server/src/node/resolve.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | interface Message { 7 | command: string; 8 | success?: boolean; 9 | args?: any; 10 | result?: any; 11 | } 12 | 13 | process.on('message', (message: Message) => { 14 | if (message.command === 'exit') { 15 | process.exit(0); 16 | } else if (message.command === 'resolve') { 17 | try { 18 | const result = (require).resolve(message.args); 19 | process.send!({ command: 'resolve', success: true, result: result }); 20 | } catch (err) { 21 | process.send!({ command: 'resolve', success: false }); 22 | } 23 | } 24 | }); -------------------------------------------------------------------------------- /server/src/node/test/sematicTokens.test.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import * as assert from 'assert'; 7 | 8 | import { SemanticTokensDiff } from '../../common/semanticTokens'; 9 | 10 | suite('Semantic token tests', () => { 11 | test('Issue 758', () => { 12 | const originalSequence: number[] = [ 13 | 0, 0, 5, 4, 0, 14 | 0, 6, 4, 5, 0, 15 | 0, 4, 1, 5, 0, 16 | 0, 1, 5, 5, 0, 17 | 1, 0, 1, 8, 0, 18 | 2, 0, 3, 7, 0, 19 | 0, 4, 4, 7, 0, 20 | 1, 0, 11, 4, 0, 21 | 0, 12, 1, 11, 0, 22 | 0, 1, 2, 8, 0, 23 | 1, 0, 1, 8, 0, 24 | 1, 4, 1, 60, 0, 25 | 0, 2, 1, 51, 0, 26 | 1, 0, 1, 8, 0, 27 | 2, 0, 1, 8, 0 28 | ]; 29 | const modifiedSequence: number[] = [ 30 | 0, 0, 5, 4, 0, 31 | 0, 6, 4, 5, 0, 32 | 0, 4, 1, 5, 0, 33 | 0, 1, 5, 5, 0, 34 | 1, 0, 1, 8, 0, 35 | 1, 0, 11, 4, 0, 36 | 0, 12, 1, 11, 0, 37 | 0, 1, 2, 8, 0, 38 | 1, 0, 1, 8, 0, 39 | 1, 4, 1, 60, 0, 40 | 0, 2, 1, 51, 0, 41 | 1, 0, 1, 8, 0, 42 | 2, 0, 1, 8, 0 43 | ]; 44 | const edits = (new SemanticTokensDiff(originalSequence, modifiedSequence)).computeDiff(); 45 | assert.deepEqual(edits.length, 1); 46 | const edit = edits[0]; 47 | assert.deepEqual(edit.start, 25); 48 | assert.deepEqual(edit.deleteCount, 10); 49 | assert.ok(edit.data === undefined || edit.data.length === 0); 50 | }); 51 | }); -------------------------------------------------------------------------------- /server/src/node/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "node", 5 | "mocha" 6 | ], 7 | "module": "node16", 8 | "moduleResolution": "node16", 9 | "rootDir": ".", 10 | "strict": true, 11 | "noImplicitAny": true, 12 | "noImplicitReturns": true, 13 | "noImplicitThis": true, 14 | "declaration": true, 15 | "stripInternal": true, 16 | "sourceMap": true, 17 | "declarationMap": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "target": "es2022", 21 | "lib": [ 22 | "es2023" 23 | ], 24 | "outDir": "../../../lib/node/test", 25 | "tsBuildInfoFile": "../../../lib/node/test/compile.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "references": [ 32 | { 33 | "path": "../tsconfig.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /server/src/node/test/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "node", 5 | "mocha" 6 | ], 7 | "module": "node16", 8 | "moduleResolution": "node16", 9 | "rootDir": ".", 10 | "strict": true, 11 | "noImplicitAny": true, 12 | "noImplicitReturns": true, 13 | "noImplicitThis": true, 14 | "declaration": true, 15 | "stripInternal": true, 16 | "sourceMap": false, 17 | "declarationMap": false, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "target": "es2022", 21 | "lib": [ 22 | "es2023" 23 | ], 24 | "outDir": "../../../lib/node/test", 25 | "tsBuildInfoFile": "../../../lib/node/test/publish.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "references": [ 32 | { 33 | "path": "../tsconfig.publish.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /server/src/node/test/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "node", 5 | "mocha" 6 | ], 7 | "module": "node16", 8 | "moduleResolution": "node16", 9 | "rootDir": ".", 10 | "strict": true, 11 | "noImplicitAny": true, 12 | "noImplicitReturns": true, 13 | "noImplicitThis": true, 14 | "declaration": true, 15 | "stripInternal": true, 16 | "sourceMap": true, 17 | "declarationMap": true, 18 | "noUnusedLocals": false, 19 | "noUnusedParameters": false, 20 | "assumeChangesOnlyAffectDirectDependencies": true, 21 | "target": "es2022", 22 | "lib": [ 23 | "es2023" 24 | ], 25 | "outDir": "../../../lib/node/test", 26 | "tsBuildInfoFile": "../../../lib/node/test/watch.tsbuildInfo", 27 | "incremental": true 28 | }, 29 | "include": [ 30 | "." 31 | ], 32 | "references": [ 33 | { 34 | "path": "../tsconfig.watch.json" 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /server/src/node/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [ 7 | "node" 8 | ], 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es2022", 20 | "lib": [ 21 | "es2023" 22 | ], 23 | "outDir": "../../lib/node", 24 | "tsBuildInfoFile": "../../lib/node/compile.tsbuildInfo", 25 | "incremental": true, 26 | "composite": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "exclude": [ 32 | "test" 33 | ], 34 | "references": [ 35 | { 36 | "path": "../common/tsconfig.json" 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /server/src/node/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [ 7 | "node" 8 | ], 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": false, 16 | "declarationMap": false, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es2022", 20 | "lib": [ 21 | "es2023" 22 | ], 23 | "outDir": "../../lib/node", 24 | "tsBuildInfoFile": "../../lib/node/publish.tsbuildInfo", 25 | "incremental": true, 26 | "composite": true 27 | }, 28 | "include": [ 29 | "." 30 | ], 31 | "exclude": [ 32 | "test" 33 | ], 34 | "references": [ 35 | { 36 | "path": "../common/tsconfig.publish.json" 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /server/src/node/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": ".", 6 | "types": [ 7 | "node" 8 | ], 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": false, 18 | "noUnusedParameters": false, 19 | "assumeChangesOnlyAffectDirectDependencies": true, 20 | "target": "es2022", 21 | "lib": [ 22 | "es2023" 23 | ], 24 | "outDir": "../../lib/node", 25 | "tsBuildInfoFile": "../../lib/node/watch.tsbuildInfo", 26 | "incremental": true, 27 | "composite": true 28 | }, 29 | "include": [ 30 | "." 31 | ], 32 | "exclude": [ 33 | "test" 34 | ], 35 | "references": [ 36 | { 37 | "path": "../common/tsconfig.watch.json" 38 | } 39 | ] 40 | } -------------------------------------------------------------------------------- /server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./../protocol/tsconfig.json" 10 | }, 11 | { 12 | "path": "./src/common/tsconfig.json" 13 | }, 14 | { 15 | "path": "./src/browser/tsconfig.json" 16 | }, 17 | { 18 | "path": "./src/node/tsconfig.json" 19 | }, 20 | { 21 | "path": "./src/node/test/tsconfig.json" 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /server/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./src/common/tsconfig.publish.json" 10 | }, 11 | { 12 | "path": "./src/browser/tsconfig.publish.json" 13 | }, 14 | { 15 | "path": "./src/node/tsconfig.publish.json" 16 | }, 17 | { 18 | "path": "./src/node/test/tsconfig.publish.json" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /server/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./../protocol/tsconfig.watch.json" 10 | }, 11 | { 12 | "path": "./src/common/tsconfig.watch.json" 13 | }, 14 | { 15 | "path": "./src/browser/tsconfig.watch.json" 16 | }, 17 | { 18 | "path": "./src/node/tsconfig.watch.json" 19 | }, 20 | { 21 | "path": "./src/node/test/tsconfig.watch.json" 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /server/typings/thenable.d.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | interface Thenable extends PromiseLike { } -------------------------------------------------------------------------------- /testbed/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../.eslintrc.base.json", 3 | "parserOptions": { 4 | "project": ["./tsconfig.json", "./client/tsconfig.json", "./server/tsconfig.json"] 5 | }, 6 | "rules": { 7 | "no-console": "off" 8 | } 9 | } -------------------------------------------------------------------------------- /testbed/client/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "testbed-client", 3 | "version": "0.1.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "testbed-client", 9 | "version": "0.1.0", 10 | "devDependencies": {}, 11 | "engines": { 12 | "vscode": "^1.40.0" 13 | } 14 | }, 15 | "../../jsonrpc": { 16 | "name": "vscode-jsonrpc", 17 | "version": "8.2.0-next.2", 18 | "extraneous": true, 19 | "license": "MIT", 20 | "devDependencies": { 21 | "@types/msgpack-lite": "^0.1.7", 22 | "msgpack-lite": "^0.1.26" 23 | }, 24 | "engines": { 25 | "node": ">=14.0.0" 26 | } 27 | }, 28 | "../../protocol": { 29 | "name": "vscode-languageserver-protocol", 30 | "version": "3.17.4-next.3", 31 | "extraneous": true, 32 | "license": "MIT", 33 | "dependencies": { 34 | "vscode-jsonrpc": "8.2.0-next.2", 35 | "vscode-languageserver-types": "3.17.4-next.2" 36 | } 37 | }, 38 | "../../types": { 39 | "name": "vscode-languageserver-types", 40 | "version": "3.17.4-next.2", 41 | "extraneous": true, 42 | "license": "MIT" 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /testbed/client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "testbed-client", 3 | "description": "Testbed client", 4 | "version": "0.1.0", 5 | "private": true, 6 | "publisher": "vscode", 7 | "engines": { 8 | "vscode": "^1.40.0" 9 | }, 10 | "scripts": { 11 | "watch": "tsc -watch -b ./tsconfig.json", 12 | "compile": "tsc -b ./tsconfig.json" 13 | }, 14 | "devDependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /testbed/client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "Node16", 4 | "target": "ES2022", 5 | "outDir": "out", 6 | "rootDir": "src", 7 | "lib": ["ES2023"], 8 | "sourceMap": true, 9 | "incremental": true, 10 | "tsBuildInfoFile":"./out/tsconfig.tsbuildInfo", 11 | }, 12 | "include": ["src"], 13 | "exclude": ["node_modules"] 14 | } 15 | -------------------------------------------------------------------------------- /testbed/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "testbed", 3 | "version": "0.1.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "testbed", 9 | "version": "0.1.0", 10 | "hasInstallScript": true, 11 | "engines": { 12 | "vscode": "^1.33.0" 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /testbed/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "testbed", 3 | "description": "testbed", 4 | "version": "0.1.0", 5 | "publisher": "vscode", 6 | "engines": { 7 | "vscode": "^1.33.0" 8 | }, 9 | "main": "./client/out/extension.js", 10 | "activationEvents": [ 11 | "*" 12 | ], 13 | "enabledApiProposals": [ 14 | ], 15 | "contributes": { 16 | "commands": [ 17 | { 18 | "command": "testbed.openFile", 19 | "title": "Open Test File" 20 | }, 21 | { 22 | "command": "testbed.fileWithContent", 23 | "title": "Open file with dynamic content" 24 | }, 25 | { 26 | "command": "testbed.refreshContent", 27 | "title": "Refresh dynamic content" 28 | } 29 | ], 30 | "configuration": { 31 | "type": "object", 32 | "title": "TestBed configuration", 33 | "properties": { 34 | "testbed.enable": { 35 | "type": "boolean", 36 | "default": true, 37 | "description": "Control whether eslint is enabled for JavaScript files or not." 38 | }, 39 | "testbed.options": { 40 | "type": "object", 41 | "default": {}, 42 | "description": "The eslint options object to provide args to the eslint command." 43 | } 44 | } 45 | } 46 | }, 47 | "scripts": { 48 | "postinstall": "cd client && npm install && cd ../server && npm install && cd ..", 49 | "compile": "tsc -b", 50 | "clean": "tsc -b --clean", 51 | "watch": "tsc -b -w" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /testbed/server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "testbed-server", 3 | "version": "0.1.0", 4 | "description": "TestBed Server", 5 | "private": true, 6 | "engines": { 7 | "node": "*" 8 | }, 9 | "dependencies": { 10 | "vscode-uri": "^3.0.8" 11 | }, 12 | "scripts": { 13 | "compile": "tsc -b ./tsconfig.json", 14 | "watch": "tsc --watch -b ./tsconfig.json" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /testbed/server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2022", 4 | "module": "Node16", 5 | "moduleResolution": "Node16", 6 | "sourceMap": true, 7 | "outDir": "out", 8 | "rootDir": "src", 9 | "lib": ["ES2023"], 10 | "incremental": true, 11 | "tsBuildInfoFile":"./out/tsconfig.tsbuildInfo", 12 | }, 13 | "include": ["src"], 14 | "exclude": ["node_modules"] 15 | } 16 | -------------------------------------------------------------------------------- /testbed/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es2017", 5 | "outDir": "out", 6 | "rootDir": "src", 7 | "lib": [ "es2017" ], 8 | "sourceMap": true 9 | }, 10 | "include": [ 11 | "src" 12 | ], 13 | "exclude": [ 14 | "node_modules", 15 | ".vscode-test" 16 | ], 17 | "references": [ 18 | { "path": "./client" }, 19 | { "path": "./server" } 20 | ] 21 | } -------------------------------------------------------------------------------- /testbed/workspace/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "testbed.trace.server": "verbose", 3 | "editor.formatOnSave": true, 4 | "editor.defaultFormatter": "vscode.testbed" 5 | } -------------------------------------------------------------------------------- /testbed/workspace/bug.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": { 7 | "vscode": { 8 | "languageId": "bat" 9 | } 10 | }, 11 | "outputs": [], 12 | "source": [ 13 | "REM Cell 1" 14 | ] 15 | }, 16 | { 17 | "cell_type": "code", 18 | "execution_count": null, 19 | "metadata": { 20 | "vscode": { 21 | "languageId": "bat" 22 | } 23 | }, 24 | "outputs": [], 25 | "source": [] 26 | }, 27 | { 28 | "cell_type": "code", 29 | "execution_count": null, 30 | "metadata": { 31 | "vscode": { 32 | "languageId": "bat" 33 | } 34 | }, 35 | "outputs": [], 36 | "source": [ 37 | "REM Cell 2" 38 | ] 39 | } 40 | ], 41 | "metadata": { 42 | "language_info": { 43 | "name": "python" 44 | } 45 | }, 46 | "nbformat": 4, 47 | "nbformat_minor": 2 48 | } 49 | -------------------------------------------------------------------------------- /testbed/workspace/python.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 2, 6 | "metadata": {}, 7 | "outputs": [ 8 | { 9 | "name": "stdout", 10 | "output_type": "stream", 11 | "text": [ 12 | "Hello World\n" 13 | ] 14 | } 15 | ], 16 | "source": [ 17 | "print('Hello World')" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": 3, 23 | "metadata": {}, 24 | "outputs": [ 25 | { 26 | "name": "stdout", 27 | "output_type": "stream", 28 | "text": [ 29 | "Hello World 2\n" 30 | ] 31 | } 32 | ], 33 | "source": [ 34 | "print('Hello World 2')" 35 | ] 36 | } 37 | ], 38 | "metadata": { 39 | "interpreter": { 40 | "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" 41 | }, 42 | "kernelspec": { 43 | "display_name": "Python 3.8.10 64-bit", 44 | "language": "python", 45 | "name": "python3" 46 | }, 47 | "language_info": { 48 | "codemirror_mode": { 49 | "name": "ipython", 50 | "version": 3 51 | }, 52 | "file_extension": ".py", 53 | "mimetype": "text/x-python", 54 | "name": "python", 55 | "nbconvert_exporter": "python", 56 | "pygments_lexer": "ipython3", 57 | "version": "3.8.10" 58 | }, 59 | "orig_nbformat": 4 60 | }, 61 | "nbformat": 4, 62 | "nbformat_minor": 2 63 | } 64 | -------------------------------------------------------------------------------- /testbed/workspace/test.bat: -------------------------------------------------------------------------------- 1 | REM @ECHO OFF 2 | cd c:\source 3 | REM This is the location of the files that you want to sort 4 | FOR %%f IN (*.doc *.txt) DO XCOPY c:\source\"%%f" c:\text /m /y 5 | REM This moves any files with a .doc or 6 | REM .txt extension from . c:\source to c:\textkkk 7 | REM %%f is a variable 8 | FOR %%f IN (*.jpg *.png *.bmp) DO XCOPY C:\source\"%%f" c:\images /m /y 9 | REM This moves any files with a .jpg, .png, 10 | REM or .bmp extension from c:\source to c:\images;; -------------------------------------------------------------------------------- /testbed/workspace/test.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": null, 13 | "metadata": {}, 14 | "outputs": [], 15 | "source": [ 16 | "console.log()" 17 | ] 18 | }, 19 | { 20 | "cell_type": "markdown", 21 | "metadata": {}, 22 | "source": [] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": null, 27 | "metadata": {}, 28 | "outputs": [], 29 | "source": [ 30 | "REM @ECHO OFF\n", 31 | "cd c:\\source\n", 32 | "REM This is the location of the files that you want to sort\n", 33 | "FOR %%f IN (*.doc *.txt) DO XCOPY c:\\source\\\"%%f\" c:\\text /m /y\n", 34 | "REM This moves any files with a .doc or\n", 35 | "REM .txt extension from . c:\\source to c:\\textkkk\n", 36 | "REM %%f is a variable\n", 37 | "FOR %%f IN (*.jpg *.png *.bmp) DO XCOPY C:\\source\\\"%%f\" c:\\images /m /y\n", 38 | "REM This moves any files with a .jpg, .png,\n", 39 | "REM or .bmp extension from c:\\source to c:\\images;; " 40 | ] 41 | }, 42 | { 43 | "cell_type": "code", 44 | "execution_count": null, 45 | "metadata": {}, 46 | "outputs": [], 47 | "source": [ 48 | "console.log('Hello World')" 49 | ] 50 | } 51 | ], 52 | "metadata": { 53 | "language_info": { 54 | "name": "bat" 55 | }, 56 | "orig_nbformat": 4 57 | }, 58 | "nbformat": 4, 59 | "nbformat_minor": 2 60 | } 61 | -------------------------------------------------------------------------------- /testbed/workspace/test.txt: -------------------------------------------------------------------------------- 1 | REM @ECHO OFF 2 | cd c:\source 3 | REM This is the location of the files that you want to sort 4 | FOR %%f IN (*.doc *.txt) DO XCOPY c:\source\"%%f" c:\text /m /y 5 | REM This moves any files with a .doc or 6 | REM .txt extension from . c:\source to c:\textkkk 7 | REM %%f is a variable 8 | FOR %%f IN (*.jpg *.png *.bmp) DO XCOPY C:\source\"%%f" c:\images /m /y 9 | REM This moves any files with a .jpg, .png, 10 | REM or .bmp extension from c:\source to c:\images;; -------------------------------------------------------------------------------- /testbed/workspace/test2.bat: -------------------------------------------------------------------------------- 1 | REM @ECHO OFF 2 | cd c:\source 3 | REM This is the location of the files that you want to sort 4 | FOR %%f IN (*.doc *.txt) DO XCOPY c:\source\"%%f" c:\text /m /y 5 | REM This moves any files with a .doc or 6 | REM .txt extension from . c:\source to c:\textkkk 7 | REM %%f is a variable 8 | FOR %%f IN (*.jpg *.png *.bmp) DO XCOPY C:\source\"%%f" c:\images /m /y 9 | REM This moves any files with a .jpg, .png, 10 | REM or .bmp extension from c:\source to c:\images;; -------------------------------------------------------------------------------- /testbed/workspace/test3.bat: -------------------------------------------------------------------------------- 1 | REM @ECHO OFF 2 | cd c:\source 3 | REM This is the location of the files that you want to sort 4 | FOR %%f IN (*.doc *.txt) DO XCOPY c:\source\"%%f" c:\text /m /y 5 | REM This moves any files with a .doc or 6 | REM .txt extension from . c:\source to c:\textkkk 7 | REM %%f is a variable 8 | FOR %%f IN (*.jpg *.png *.bmp) DO XCOPY C:\source\"%%f" c:\images /m /y 9 | REM This moves any files with a .jpg, .png, 10 | REM or .bmp extension from c:\source to c:\images;; -------------------------------------------------------------------------------- /testbed/workspace/test4.bat: -------------------------------------------------------------------------------- 1 | REM @ECHO OFF 2 | cd c:\source 3 | REM This is the location of the files that you want to sort 4 | FOR %%f IN (*.doc *.txt) DO XCOPY c:\source\"%%f" c:\text /m /y 5 | REM This moves any files with a .doc or 6 | REM .txt extension from . c:\source to c:\textkkk 7 | REM %%f is a variable 8 | FOR %%f IN (*.jpg *.png *.bmp) DO XCOPY C:\source\"%%f" c:\images /m /y 9 | REM This moves any files with a .jpg, .png, 10 | REM or .bmp extension from c:\source to c:\images;; -------------------------------------------------------------------------------- /textDocument/.eslintignore: -------------------------------------------------------------------------------- 1 | lib -------------------------------------------------------------------------------- /textDocument/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../.eslintrc.base.json", 3 | "parserOptions": { 4 | "project": ["src/tsconfig.json", "src/test/tsconfig.json"] 5 | }, 6 | "rules": { 7 | "no-console": "error", 8 | "@typescript-eslint/no-floating-promises": "error" 9 | } 10 | } -------------------------------------------------------------------------------- /textDocument/.mocharc.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec": "lib/umd/test", 3 | "extension": ["js"], 4 | "recursive": true, 5 | "ui": "tdd" 6 | } -------------------------------------------------------------------------------- /textDocument/.npmignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | lib/**/test/ 3 | lib/**/*.map 4 | lib/**/*.tsbuildInfo 5 | src/ 6 | test/ 7 | .eslintrc* 8 | .eslintignore 9 | .mocharc* 10 | .gitignore 11 | gulpfile.js 12 | tsd.json 13 | tsconfig*.json -------------------------------------------------------------------------------- /textDocument/License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) Microsoft Corporation 2 | 3 | All rights reserved. 4 | 5 | MIT License 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | -------------------------------------------------------------------------------- /textDocument/README.md: -------------------------------------------------------------------------------- 1 | # Text Document implementation for a LSP Node server 2 | 3 | [![NPM Version](https://img.shields.io/npm/v/vscode-languageserver-textdocument.svg)](https://npmjs.org/package/vscode-languageserver-textdocument) 4 | [![NPM Downloads](https://img.shields.io/npm/dm/vscode-languageserver-textdocument.svg)](https://npmjs.org/package/vscode-languageserver-textdocument) 5 | 6 | Npm module containing a simple text document implementation for [Node.js](https://nodejs.org/) language server 7 | 8 | Click [here](https://code.visualstudio.com/docs/extensions/example-language-server) for a detailed document on how 9 | to implement language servers for [VSCode](https://code.visualstudio.com/). 10 | 11 | ## History 12 | 13 | ### 1.04 14 | 15 | - Introduced ESLint rule for member delimiter style. 16 | 17 | ### 1.03 18 | 19 | - Moved to ES2020 target and lib 20 | 21 | ### 1.0.2 22 | 23 | - JSDoc updates 24 | 25 | ### 1.0.0 26 | 27 | Initial version. 28 | 29 | ## License 30 | [MIT](https://github.com/Microsoft/vscode-languageserver-node/blob/master/License.txt) 31 | -------------------------------------------------------------------------------- /textDocument/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-languageserver-textdocument", 3 | "version": "1.0.12", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "vscode-languageserver-textdocument", 9 | "version": "1.0.12", 10 | "license": "MIT" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /textDocument/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-languageserver-textdocument", 3 | "description": "A simple text document implementation for Node LSP servers", 4 | "version": "1.0.12", 5 | "author": "Microsoft Corporation", 6 | "license": "MIT", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/Microsoft/vscode-languageserver-node.git", 10 | "directory": "textDocument" 11 | }, 12 | "bugs": { 13 | "url": "https://github.com/Microsoft/vscode-languageserver-node/issues" 14 | }, 15 | "main": "./lib/umd/main.js", 16 | "typings": "./lib/umd/main", 17 | "exports": { 18 | ".": { 19 | "browser": "./lib/esm/main.js", 20 | "module": "./lib/esm/main.js", 21 | "import": "./lib/esm/main.js", 22 | "default": "./lib/umd/main.js" 23 | } 24 | }, 25 | "scripts": { 26 | "prepublishOnly": "echo \"⛔ Can only publish from a secure pipeline ⛔\" && node ../build/npm/fail", 27 | "prepack": "npm run all:publish", 28 | "compile": "tsc -b ./tsconfig.json", 29 | "clean": "rimraf lib", 30 | "watch": "tsc -b ./tsconfig.watch.json -w", 31 | "lint": "eslint --ext ts src", 32 | "test": "node ../node_modules/mocha/bin/_mocha", 33 | "all": "npm run clean && npm run compile && npm run lint && npm run test", 34 | "compile:esm": "tsc -b ./tsconfig.esm.publish.json && node ../build/bin/fix-esm", 35 | "compile:umd": "tsc -b ./tsconfig.umd.publish.json", 36 | "all:publish": "git clean -xfd . && npm install && npm run compile:esm && npm run compile:umd && npm run lint && npm run test", 37 | "preversion": "npm test" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /textDocument/src/test/tsconfig.esm.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "es6", 7 | "moduleResolution": "node", 8 | "rootDir": ".", 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": false, 16 | "target": "es6", 17 | "lib": [ 18 | "es2015" 19 | ], 20 | "outDir": "../../lib/esm/test", 21 | "tsBuildInfoFile": "../../lib/esm/test/publish.tsbuildInfo", 22 | "incremental": true 23 | }, 24 | "include": [ 25 | "." 26 | ], 27 | "references": [ 28 | { 29 | "path": "../tsconfig.esm.publish.json" 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /textDocument/src/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "umd", 7 | "moduleResolution": "node", 8 | "rootDir": ".", 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es5", 20 | "lib": [ 21 | "es2015" 22 | ], 23 | "outDir": "../../lib/umd/test", 24 | "tsBuildInfoFile": "../../lib/umd/test/compile.tsbuildInfo", 25 | "incremental": true 26 | }, 27 | "include": [ 28 | "." 29 | ], 30 | "references": [ 31 | { 32 | "path": "../tsconfig.json" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /textDocument/src/test/tsconfig.umd.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "umd", 7 | "moduleResolution": "node", 8 | "rootDir": ".", 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": false, 16 | "declarationMap": false, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es5", 20 | "lib": [ 21 | "es2015" 22 | ], 23 | "outDir": "../../lib/umd/test", 24 | "tsBuildInfoFile": "../../lib/umd/test/publish.tsbuildInfo", 25 | "incremental": true 26 | }, 27 | "include": [ 28 | "." 29 | ], 30 | "references": [ 31 | { 32 | "path": "../tsconfig.umd.publish.json" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /textDocument/src/test/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "umd", 7 | "moduleResolution": "node", 8 | "rootDir": ".", 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es5", 20 | "lib": [ 21 | "es2015" 22 | ], 23 | "outDir": "../../lib/umd/test", 24 | "tsBuildInfoFile": "../../lib/umd/test/watch.tsbuildInfo", 25 | "incremental": true 26 | }, 27 | "include": [ 28 | "." 29 | ], 30 | "references": [ 31 | { 32 | "path": "../tsconfig.watch.json" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /textDocument/src/tsconfig.esm.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "es6", 4 | "moduleResolution": "node", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": false, 14 | "target": "es6", 15 | "lib": [ 16 | "es2015" 17 | ], 18 | "outDir": "../lib/esm", 19 | "tsBuildInfoFile": "../lib/esm/publish.tsbuildInfo", 20 | "incremental": true, 21 | "composite": true 22 | }, 23 | "include": [ 24 | "." 25 | ], 26 | "exclude": [ 27 | "test" 28 | ] 29 | } -------------------------------------------------------------------------------- /textDocument/src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "umd", 4 | "moduleResolution": "node", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": true, 14 | "declarationMap": true, 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | "target": "es5", 18 | "lib": [ 19 | "es2015" 20 | ], 21 | "outDir": "../lib/umd", 22 | "tsBuildInfoFile": "../lib/umd/compile.tsbuildInfo", 23 | "incremental": true, 24 | "composite": true 25 | }, 26 | "include": [ 27 | "." 28 | ], 29 | "exclude": [ 30 | "test" 31 | ] 32 | } -------------------------------------------------------------------------------- /textDocument/src/tsconfig.umd.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "umd", 4 | "moduleResolution": "node", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": false, 14 | "declarationMap": false, 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | "target": "es5", 18 | "lib": [ 19 | "es2015" 20 | ], 21 | "outDir": "../lib/umd", 22 | "tsBuildInfoFile": "../lib/umd/publish.tsbuildInfo", 23 | "incremental": true, 24 | "composite": true 25 | }, 26 | "include": [ 27 | "." 28 | ], 29 | "exclude": [ 30 | "test" 31 | ] 32 | } -------------------------------------------------------------------------------- /textDocument/src/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "umd", 4 | "moduleResolution": "node", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": true, 14 | "declarationMap": true, 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | "target": "es5", 18 | "lib": [ 19 | "es2015" 20 | ], 21 | "outDir": "../lib/umd", 22 | "tsBuildInfoFile": "../lib/umd/watch.tsbuildInfo", 23 | "incremental": true, 24 | "composite": true 25 | }, 26 | "include": [ 27 | "." 28 | ], 29 | "exclude": [ 30 | "test" 31 | ] 32 | } -------------------------------------------------------------------------------- /textDocument/thirdpartynotices.txt: -------------------------------------------------------------------------------- 1 | NOTICES AND INFORMATION 2 | Do Not Translate or Localize 3 | 4 | This software incorporates material from third parties. 5 | Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, 6 | or you may send a check or money order for US $5.00, including the product name, 7 | the open source component name, platform, and version number, to: 8 | 9 | Source Code Compliance Team 10 | Microsoft Corporation 11 | One Microsoft Way 12 | Redmond, WA 98052 13 | USA 14 | 15 | Notwithstanding any other terms, you may reverse engineer this software to the extent 16 | required to debug changes to any libraries licensed under the GNU Lesser General Public License. -------------------------------------------------------------------------------- /textDocument/tsconfig.esm.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "files": [], 4 | "references": [ 5 | { "path": "./src/tsconfig.esm.json" }, 6 | ] 7 | } -------------------------------------------------------------------------------- /textDocument/tsconfig.esm.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./src/tsconfig.esm.publish.json" 10 | }, 11 | { 12 | "path": "./src/test/tsconfig.esm.publish.json" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /textDocument/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./src/tsconfig.json" 10 | }, 11 | { 12 | "path": "./src/test/tsconfig.json" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /textDocument/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./tsconfig.esm.publish.json" 10 | }, 11 | { 12 | "path": "./tsconfig.umd.publish.json" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /textDocument/tsconfig.umd.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./src/tsconfig.umd.publish.json" 10 | }, 11 | { 12 | "path": "./src/test/tsconfig.umd.publish.json" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /textDocument/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./src/tsconfig.watch.json" 10 | }, 11 | { 12 | "path": "./src/test/tsconfig.watch.json" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /tools/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../.eslintrc.base.json", 3 | "parserOptions": { 4 | "project": ["./tsconfig.json"] 5 | }, 6 | "rules": { 7 | "@typescript-eslint/no-floating-promises": "error" 8 | } 9 | } -------------------------------------------------------------------------------- /tools/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-languageserver-tools", 3 | "version": "0.1.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "vscode-languageserver-tools", 9 | "version": "0.1.0", 10 | "license": "MIT" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tools/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-languageserver-tools", 3 | "description": "Tooling for the language server protocol", 4 | "version": "0.1.0", 5 | "author": "Microsoft Corporation", 6 | "license": "MIT", 7 | "private": true, 8 | "repository": { 9 | "type": "git", 10 | "url": "https://github.com/Microsoft/vscode-languageserver-node.git", 11 | "directory": "tools" 12 | }, 13 | "bugs": { 14 | "url": "https://github.com/Microsoft/vscode-languageserver-node/issues" 15 | }, 16 | "scripts": { 17 | "compile": "tsc -b ./tsconfig.json", 18 | "watch": "tsc -b ./tsconfig-watch.json -w", 19 | "clean": "rimraf lib && rimraf dist", 20 | "lint": "eslint --ext ts src" 21 | } 22 | } -------------------------------------------------------------------------------- /tools/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": "./src", 6 | "types": [ 7 | "node" 8 | ], 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es2022", 20 | "lib": [ 21 | "es2023" 22 | ], 23 | "outDir": "./lib", 24 | "tsBuildInfoFile": "lib/compile.tsbuildInfo", 25 | "incremental": true 26 | }, 27 | "include": [ 28 | "." 29 | ] 30 | } -------------------------------------------------------------------------------- /tools/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": "./src", 6 | "types": [ 7 | "node" 8 | ], 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": false, 18 | "noUnusedParameters": false, 19 | "assumeChangesOnlyAffectDirectDependencies": true, 20 | "target": "es2022", 21 | "lib": [ 22 | "es2023" 23 | ], 24 | "outDir": "./lib", 25 | "tsBuildInfoFile": "lib/watch.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ] 31 | } -------------------------------------------------------------------------------- /tsconfig-gen/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../.eslintrc.base.json", 3 | "parserOptions": { 4 | "project": ["./tsconfig.json"] 5 | }, 6 | "rules": { 7 | "@typescript-eslint/no-floating-promises": "error" 8 | } 9 | } -------------------------------------------------------------------------------- /tsconfig-gen/.npmignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | lib/*.map 3 | lib/*.tsbuildInfo 4 | src/ 5 | test/ 6 | .eslintrc* 7 | .eslintignore 8 | .mocharc* 9 | .gitignore 10 | gulpfile.js 11 | tsconfig*.json -------------------------------------------------------------------------------- /tsconfig-gen/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /tsconfig-gen/README.md: -------------------------------------------------------------------------------- 1 | # TS-Config generator 2 | 3 | Maintaining a consistent set of tsconfig files in a mono repository can be quite challenging even with the use of the extends clause. The tsconfig generator allows you to generate the configurations form a higher level configuration file which supports the following concepts: 4 | 5 | - extending from multiple base configurations 6 | - projects and it dependencies to generate proper references 7 | - source folders inside a project to generate different compiler configuration per source folder (e.g. common, browser, node) 8 | - compiler settings to generate different compiler configuration to compile, watch or publish the project. 9 | 10 | Run `tsconfig-gen --help` to get on overview about the available options. 11 | 12 | ## History 13 | 14 | - 0.1.0: Initial version 15 | 16 | ## License 17 | [MIT](https://github.com/Microsoft/tsconfig-gen/blob/main/License.txt) -------------------------------------------------------------------------------- /tsconfig-gen/ThirdPartyNotices.txt: -------------------------------------------------------------------------------- 1 | Intentionally left empty. It's content will be auto generated in 2 | the release pipeline. -------------------------------------------------------------------------------- /tsconfig-gen/bin/tsconfig-gen: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('../lib/main.js').main(); -------------------------------------------------------------------------------- /tsconfig-gen/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vscode/tsconfig-gen", 3 | "description": "Tool to generate tsconfig files from a higher level description", 4 | "version": "0.1.0", 5 | "author": "Microsoft Corporation", 6 | "license": "MIT", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/Microsoft/vscode-languageserver-node.git", 10 | "directory": "tsconfig-gen" 11 | }, 12 | "bugs": { 13 | "url": "https://github.com/Microsoft/vscode-languageserver-node/issues" 14 | }, 15 | "exports": { 16 | ".": { 17 | "default": "./lib/main.js", 18 | "types": "./lib/main.d.ts" 19 | } 20 | }, 21 | "bin": { 22 | "tsconfig-gen": "./bin/tsconfig-gen" 23 | }, 24 | "dependencies": { 25 | "yargs": "^17.7.2" 26 | }, 27 | "devDependencies": { 28 | "@types/yargs": "^17.0.33" 29 | }, 30 | "scripts": { 31 | "prepublishOnly": "echo \"⛔ Can only publish from a secure pipeline ⛔\" && node ../build/npm/fail", 32 | "prepack": "git clean -xfd . && npm install && npm run all", 33 | "compile": "tsc -b ./tsconfig.json", 34 | "clean": "rimraf lib", 35 | "watch": "tsc -b ./tsconfig.watch.json -w", 36 | "lint": "eslint --ext ts src", 37 | "all": "npm run compile && npm run lint", 38 | "compile:publish": "tsc -b ./tsconfig.publish.json", 39 | "all:publish": "git clean -xfd . && npm install && npm run compile:publish && npm run lint" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tsconfig-gen/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": "./src", 6 | "types": [ 7 | "node" 8 | ], 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es2022", 20 | "lib": [ 21 | "es2023" 22 | ], 23 | "outDir": "./lib", 24 | "tsBuildInfoFile": "lib/compile.tsbuildInfo", 25 | "incremental": true 26 | }, 27 | "include": [ 28 | "." 29 | ] 30 | } -------------------------------------------------------------------------------- /tsconfig-gen/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": "./src", 6 | "types": [ 7 | "node" 8 | ], 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": false, 16 | "declarationMap": false, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es2022", 20 | "lib": [ 21 | "es2023" 22 | ], 23 | "outDir": "./lib", 24 | "tsBuildInfoFile": "lib/publish.tsbuildInfo", 25 | "incremental": true 26 | }, 27 | "include": [ 28 | "." 29 | ] 30 | } -------------------------------------------------------------------------------- /tsconfig-gen/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "node16", 4 | "moduleResolution": "node16", 5 | "rootDir": "./src", 6 | "types": [ 7 | "node" 8 | ], 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": false, 18 | "noUnusedParameters": false, 19 | "assumeChangesOnlyAffectDirectDependencies": true, 20 | "target": "es2022", 21 | "lib": [ 22 | "es2023" 23 | ], 24 | "outDir": "./lib", 25 | "tsBuildInfoFile": "lib/watch.tsbuildInfo", 26 | "incremental": true 27 | }, 28 | "include": [ 29 | "." 30 | ] 31 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./textDocument/tsconfig.json" 10 | }, 11 | { 12 | "path": "./types/tsconfig.json" 13 | }, 14 | { 15 | "path": "./jsonrpc/tsconfig.json" 16 | }, 17 | { 18 | "path": "./protocol/tsconfig.json" 19 | }, 20 | { 21 | "path": "./client/tsconfig.json" 22 | }, 23 | { 24 | "path": "./server/tsconfig.json" 25 | }, 26 | { 27 | "path": "./client-node-tests/tsconfig.json" 28 | }, 29 | { 30 | "path": "./tools/tsconfig.json" 31 | }, 32 | { 33 | "path": "./tsconfig-gen/tsconfig.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./textDocument/tsconfig.watch.json" 10 | }, 11 | { 12 | "path": "./types/tsconfig.watch.json" 13 | }, 14 | { 15 | "path": "./jsonrpc/tsconfig.watch.json" 16 | }, 17 | { 18 | "path": "./protocol/tsconfig.watch.json" 19 | }, 20 | { 21 | "path": "./client/tsconfig.watch.json" 22 | }, 23 | { 24 | "path": "./server/tsconfig.watch.json" 25 | }, 26 | { 27 | "path": "./client-node-tests/tsconfig.watch.json" 28 | }, 29 | { 30 | "path": "./tools/tsconfig.watch.json" 31 | }, 32 | { 33 | "path": "./tsconfig-gen/tsconfig.watch.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /types/.eslintignore: -------------------------------------------------------------------------------- 1 | lib -------------------------------------------------------------------------------- /types/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../.eslintrc.base.json", 3 | "parserOptions": { 4 | "project": ["src/tsconfig.json", "src/test/tsconfig.json"] 5 | }, 6 | "rules": { 7 | "no-console": "error", 8 | "@typescript-eslint/no-floating-promises": "error" 9 | } 10 | } -------------------------------------------------------------------------------- /types/.mocharc.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec": "lib/umd/test", 3 | "extension": ["js"], 4 | "recursive": true, 5 | "ui": "tdd" 6 | } -------------------------------------------------------------------------------- /types/.npmignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | lib/**/test/ 3 | lib/**/*.map 4 | lib/**/*.tsbuildInfo 5 | src/ 6 | test/ 7 | .eslintrc* 8 | .eslintignore 9 | .mocharc* 10 | .gitignore 11 | gulpfile.js 12 | tsd.json 13 | tsconfig*.json -------------------------------------------------------------------------------- /types/License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) Microsoft Corporation 2 | 3 | All rights reserved. 4 | 5 | MIT License 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | -------------------------------------------------------------------------------- /types/README.md: -------------------------------------------------------------------------------- 1 | # VSCode Language Server Types 2 | 3 | [![NPM Version](https://img.shields.io/npm/v/vscode-languageserver-types.svg)](https://npmjs.org/package/vscode-languageserver-types) 4 | [![NPM Downloads](https://img.shields.io/npm/dm/vscode-languageserver-types.svg)](https://npmjs.org/package/vscode-languageserver-types) 5 | [![Build Status](https://dev.azure.com/vscode/vscode-languageserver-node/_apis/build/status%2Fvscode-languageserver-node?branchName=main)](https://dev.azure.com/vscode/vscode-languageserver-node/_build/latest?definitionId=52&branchName=main) 6 | 7 | Npm module containing the types used by the VSCode language client and [Node.js](https://nodejs.org/) language server 8 | 9 | Click [here](https://code.visualstudio.com/docs/extensions/example-language-server) for a detailed document on how 10 | to implement language servers for [VSCode](https://code.visualstudio.com/). 11 | 12 | ## History 13 | 14 | For the history please see the [main repository](https://github.com/Microsoft/vscode-languageserver-node/blob/master/README.md) 15 | 16 | ## License 17 | [MIT](https://github.com/Microsoft/vscode-languageserver-node/blob/master/License.txt) 18 | -------------------------------------------------------------------------------- /types/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-languageserver-types", 3 | "version": "3.17.6-next.6", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "vscode-languageserver-types", 9 | "version": "3.17.6-next.6", 10 | "license": "MIT" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /types/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-languageserver-types", 3 | "description": "Types used by the Language server for node", 4 | "version": "3.17.6-next.6", 5 | "author": "Microsoft Corporation", 6 | "license": "MIT", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/Microsoft/vscode-languageserver-node.git", 10 | "directory": "types" 11 | }, 12 | "bugs": { 13 | "url": "https://github.com/Microsoft/vscode-languageserver-node/issues" 14 | }, 15 | "main": "./lib/umd/main.js", 16 | "typings": "./lib/umd/main", 17 | "exports": { 18 | ".": { 19 | "browser": "./lib/esm/main.js", 20 | "module": "./lib/esm/main.js", 21 | "import": "./lib/esm/main.js", 22 | "default": "./lib/umd/main.js" 23 | } 24 | }, 25 | "scripts": { 26 | "prepublishOnly": "echo \"⛔ Can only publish from a secure pipeline ⛔\" && node ../build/npm/fail", 27 | "prepack": "npm run all:publish", 28 | "compile": "tsc -b ./tsconfig.json", 29 | "clean": "rimraf lib", 30 | "watch": "tsc -b ./tsconfig.watch.json -w", 31 | "lint": "eslint --ext ts src", 32 | "test": "mocha", 33 | "all": "npm run clean && npm run compile && npm run lint && npm run test", 34 | "compile:esm": "tsc -b ./tsconfig.esm.publish.json && node ../build/bin/fix-esm", 35 | "compile:umd": "tsc -b ./tsconfig.umd.publish.json", 36 | "all:publish": "git clean -xfd . && npm install && npm run compile:esm && npm run compile:umd && npm run lint && npm run test", 37 | "preversion": "npm test" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /types/src/test/tsconfig.esm.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "es6", 7 | "moduleResolution": "node", 8 | "rootDir": ".", 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": false, 16 | "target": "es6", 17 | "lib": [ 18 | "es2015" 19 | ], 20 | "outDir": "../../lib/esm/test", 21 | "tsBuildInfoFile": "../../lib/esm/test/publish.tsbuildInfo", 22 | "incremental": true 23 | }, 24 | "include": [ 25 | "." 26 | ], 27 | "references": [ 28 | { 29 | "path": "../tsconfig.esm.publish.json" 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /types/src/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "umd", 7 | "moduleResolution": "node", 8 | "rootDir": ".", 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es5", 20 | "lib": [ 21 | "es2015" 22 | ], 23 | "outDir": "../../lib/umd/test", 24 | "tsBuildInfoFile": "../../lib/umd/test/compile.tsbuildInfo", 25 | "incremental": true 26 | }, 27 | "include": [ 28 | "." 29 | ], 30 | "references": [ 31 | { 32 | "path": "../tsconfig.json" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /types/src/test/tsconfig.umd.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "umd", 7 | "moduleResolution": "node", 8 | "rootDir": ".", 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": false, 16 | "declarationMap": false, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es5", 20 | "lib": [ 21 | "es2015" 22 | ], 23 | "outDir": "../../lib/umd/test", 24 | "tsBuildInfoFile": "../../lib/umd/test/publish.tsbuildInfo", 25 | "incremental": true 26 | }, 27 | "include": [ 28 | "." 29 | ], 30 | "references": [ 31 | { 32 | "path": "../tsconfig.umd.publish.json" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /types/src/test/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": [ 4 | "mocha" 5 | ], 6 | "module": "umd", 7 | "moduleResolution": "node", 8 | "rootDir": ".", 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noImplicitThis": true, 13 | "declaration": true, 14 | "stripInternal": true, 15 | "sourceMap": true, 16 | "declarationMap": true, 17 | "noUnusedLocals": true, 18 | "noUnusedParameters": true, 19 | "target": "es5", 20 | "lib": [ 21 | "es2015" 22 | ], 23 | "outDir": "../../lib/umd/test", 24 | "tsBuildInfoFile": "../../lib/umd/test/watch.tsbuildInfo", 25 | "incremental": true 26 | }, 27 | "include": [ 28 | "." 29 | ], 30 | "references": [ 31 | { 32 | "path": "../tsconfig.watch.json" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /types/src/tsconfig.esm.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "es6", 4 | "moduleResolution": "node", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": false, 14 | "target": "es6", 15 | "lib": [ 16 | "es2015" 17 | ], 18 | "outDir": "../lib/esm", 19 | "tsBuildInfoFile": "../lib/esm/publish.tsbuildInfo", 20 | "incremental": true, 21 | "composite": true 22 | }, 23 | "include": [ 24 | "." 25 | ], 26 | "exclude": [ 27 | "test" 28 | ] 29 | } -------------------------------------------------------------------------------- /types/src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "umd", 4 | "moduleResolution": "node", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": true, 14 | "declarationMap": true, 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | "target": "es5", 18 | "lib": [ 19 | "es2015" 20 | ], 21 | "outDir": "../lib/umd", 22 | "tsBuildInfoFile": "../lib/umd/compile.tsbuildInfo", 23 | "incremental": true, 24 | "composite": true 25 | }, 26 | "include": [ 27 | "." 28 | ], 29 | "exclude": [ 30 | "test" 31 | ] 32 | } -------------------------------------------------------------------------------- /types/src/tsconfig.umd.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "umd", 4 | "moduleResolution": "node", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": false, 14 | "declarationMap": false, 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | "target": "es5", 18 | "lib": [ 19 | "es2015" 20 | ], 21 | "outDir": "../lib/umd", 22 | "tsBuildInfoFile": "../lib/umd/publish.tsbuildInfo", 23 | "incremental": true, 24 | "composite": true 25 | }, 26 | "include": [ 27 | "." 28 | ], 29 | "exclude": [ 30 | "test" 31 | ] 32 | } -------------------------------------------------------------------------------- /types/src/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "umd", 4 | "moduleResolution": "node", 5 | "rootDir": ".", 6 | "types": [], 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "noImplicitReturns": true, 10 | "noImplicitThis": true, 11 | "declaration": true, 12 | "stripInternal": true, 13 | "sourceMap": true, 14 | "declarationMap": true, 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | "target": "es5", 18 | "lib": [ 19 | "es2015" 20 | ], 21 | "outDir": "../lib/umd", 22 | "tsBuildInfoFile": "../lib/umd/watch.tsbuildInfo", 23 | "incremental": true, 24 | "composite": true 25 | }, 26 | "include": [ 27 | "." 28 | ], 29 | "exclude": [ 30 | "test" 31 | ] 32 | } -------------------------------------------------------------------------------- /types/thirdpartynotices.txt: -------------------------------------------------------------------------------- 1 | NOTICES AND INFORMATION 2 | Do Not Translate or Localize 3 | 4 | This software incorporates material from third parties. 5 | Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, 6 | or you may send a check or money order for US $5.00, including the product name, 7 | the open source component name, platform, and version number, to: 8 | 9 | Source Code Compliance Team 10 | Microsoft Corporation 11 | One Microsoft Way 12 | Redmond, WA 98052 13 | USA 14 | 15 | Notwithstanding any other terms, you may reverse engineer this software to the extent 16 | required to debug changes to any libraries licensed under the GNU Lesser General Public License. -------------------------------------------------------------------------------- /types/tsconfig.esm.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./src/tsconfig.esm.publish.json" 10 | }, 11 | { 12 | "path": "./src/test/tsconfig.esm.publish.json" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./src/tsconfig.json" 10 | }, 11 | { 12 | "path": "./src/test/tsconfig.json" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /types/tsconfig.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./tsconfig.esm.publish.json" 10 | }, 11 | { 12 | "path": "./tsconfig.umd.publish.json" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /types/tsconfig.umd.publish.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./src/tsconfig.umd.publish.json" 10 | }, 11 | { 12 | "path": "./src/test/tsconfig.umd.publish.json" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /types/tsconfig.watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "composite": true 5 | }, 6 | "files": [], 7 | "references": [ 8 | { 9 | "path": "./src/tsconfig.watch.json" 10 | }, 11 | { 12 | "path": "./src/test/tsconfig.watch.json" 13 | } 14 | ] 15 | } --------------------------------------------------------------------------------