From 95abb1c979213530c803ceee5373cfc651273ab5 Mon Sep 17 00:00:00 2001 From: Pierre Dahmani Date: Thu, 21 Dec 2023 00:49:27 +0100 Subject: [PATCH 01/26] add example for testing typescript code with vscode-js-debug --- support/test/node/typescript/.gitignore | 2 ++ support/test/node/typescript/.vimspector.json | 20 +++++++++++++ support/test/node/typescript/README.md | 28 +++++++++++++++++++ support/test/node/typescript/package.json | 18 ++++++++++++ support/test/node/typescript/src/index.ts | 6 ++++ support/test/node/typescript/tsconfig.json | 12 ++++++++ support/test/node/typescript/yarn.lock | 18 ++++++++++++ 7 files changed, 104 insertions(+) create mode 100644 support/test/node/typescript/.gitignore create mode 100644 support/test/node/typescript/.vimspector.json create mode 100644 support/test/node/typescript/README.md create mode 100644 support/test/node/typescript/package.json create mode 100644 support/test/node/typescript/src/index.ts create mode 100644 support/test/node/typescript/tsconfig.json create mode 100644 support/test/node/typescript/yarn.lock diff --git a/support/test/node/typescript/.gitignore b/support/test/node/typescript/.gitignore new file mode 100644 index 000000000..de4d1f007 --- /dev/null +++ b/support/test/node/typescript/.gitignore @@ -0,0 +1,2 @@ +dist +node_modules diff --git a/support/test/node/typescript/.vimspector.json b/support/test/node/typescript/.vimspector.json new file mode 100644 index 000000000..a4442e617 --- /dev/null +++ b/support/test/node/typescript/.vimspector.json @@ -0,0 +1,20 @@ +{ + "configurations": { + "run - js-debug": { + "adapter": "js-debug", + "configuration": { + "request": "attach", + "outDir": "${workspaceRoot}/dist/**.js", + "program": "${workspaceRoot}/index.ts", + "cwd": "${workspaceRoot}", + "stopOnEntry": false + }, + "breakpoints": { + "exception": { + "all": "", + "uncaught": "" + } + } + } + } +} diff --git a/support/test/node/typescript/README.md b/support/test/node/typescript/README.md new file mode 100644 index 000000000..5d24bc24d --- /dev/null +++ b/support/test/node/typescript/README.md @@ -0,0 +1,28 @@ +# Howto + +Typescript is a great language (looking past dependency hells of the js +ecosystem and the immense pain of setting up projects). This example shows you +how to use vimspector with +[vscode-js-debug](https://github.com/microsoft/vscode-js-debug). I only could +make this combination work by using 'attach' as launch. This is the reason why +this guide will explain how to use it with 'attach'. For all available options +see [here](https://github.com/microsoft/vscode-js-debug/blob/main/OPTIONS.md#node-attach). + +## Prerequisites + +- Ensure you are using nodejs version 18 or 20 (was tested with these and these are + LTS (dezember 2023). +- Ensure you have vscode-js-debug installed, check installation guides for + nodejs of the vimspector repo on how to do so. +- Install dependencies `yarn` (can install yarn if you don't have it yet, `npm i -g yarn`) + +## Debugging + +- Build the project `yarn build` +- Start the node process with inspect-brk option in a separate terminal `node --inspect-brk ./dist/index.js` +- Open the typescript file with vim `vim ./src/index.ts` +- Set breakpoints at line 2 and 3 (standard key mapping F9) +- Run debugging (standard key mapping F5) +- Press F5 once again (you should see console log output) +- Press F5 once again (you should see another console log output) +- Done🎉 diff --git a/support/test/node/typescript/package.json b/support/test/node/typescript/package.json new file mode 100644 index 000000000..531d6547d --- /dev/null +++ b/support/test/node/typescript/package.json @@ -0,0 +1,18 @@ +{ + "name": "vimspector-typescript", + "author": "Pierre Dahmani ", + "version": "1.0.0", + "main": "index.js", + "license": "Apache-2.0", + "scripts": { + "build": "tsc", + "start": "node ./dist/index.js", + "debug-brk": "node --inspect-brk ./dist/index.js" + }, + "dependencies": {}, + "devDependencies": { + "@tsconfig/node18": "2.0.0", + "typescript": "5.3.3", + "@types/node": "18.16.8" + } +} diff --git a/support/test/node/typescript/src/index.ts b/support/test/node/typescript/src/index.ts new file mode 100644 index 000000000..a81912358 --- /dev/null +++ b/support/test/node/typescript/src/index.ts @@ -0,0 +1,6 @@ +const main = () => { + console.log(new Date().toISOString() + " Debugging typescript with vimspector🎉") + console.log(new Date().toISOString() + " Done!") +} + +main() diff --git a/support/test/node/typescript/tsconfig.json b/support/test/node/typescript/tsconfig.json new file mode 100644 index 000000000..fb55ba4c5 --- /dev/null +++ b/support/test/node/typescript/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "@tsconfig/node18/tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "dist", + "sourceMap": true, + "baseUrl": "." + }, + "include": ["src", "test"], + "exclude": ["dist", "bundle", "node_modules"] +} + diff --git a/support/test/node/typescript/yarn.lock b/support/test/node/typescript/yarn.lock new file mode 100644 index 000000000..9ed2b2f03 --- /dev/null +++ b/support/test/node/typescript/yarn.lock @@ -0,0 +1,18 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@tsconfig/node18@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@tsconfig/node18/-/node18-2.0.0.tgz#58b52430d00913dc26c4459fbc7f05396e47886a" + integrity sha512-uI/B0ShkiEwTk036pncXucVlj4y11EW6mycQvCEzC1PkR2TBvdQZ5Wf96dp+XXWAc70FEDfvwTqanoaDpP6rPw== + +"@types/node@18.16.8": + version "18.16.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.8.tgz#fcd9bd0a793aba2701caff4aeae7c988d4da6ce5" + integrity sha512-p0iAXcfWCOTCBbsExHIDFCfwsqFwBTgETJveKMT+Ci3LY9YqQCI91F5S+TB20+aRCXpcWfvx5Qr5EccnwCm2NA== + +typescript@5.3.3: + version "5.3.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" + integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== From 5d4a94dff1bd7b54dc098737db33a5aefdb67749 Mon Sep 17 00:00:00 2001 From: Pierre Dahmani Date: Thu, 21 Dec 2023 00:55:58 +0100 Subject: [PATCH 02/26] fix typo --- support/test/node/typescript/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/test/node/typescript/README.md b/support/test/node/typescript/README.md index 5d24bc24d..5cf4bbde1 100644 --- a/support/test/node/typescript/README.md +++ b/support/test/node/typescript/README.md @@ -11,7 +11,7 @@ see [here](https://github.com/microsoft/vscode-js-debug/blob/main/OPTIONS.md#nod ## Prerequisites - Ensure you are using nodejs version 18 or 20 (was tested with these and these are - LTS (dezember 2023). + LTS (december 2023). - Ensure you have vscode-js-debug installed, check installation guides for nodejs of the vimspector repo on how to do so. - Install dependencies `yarn` (can install yarn if you don't have it yet, `npm i -g yarn`) From 55afdc057eb6c35d7ec858ff8bad9bece12b215e Mon Sep 17 00:00:00 2001 From: Pierre Dahmani Date: Fri, 22 Dec 2023 00:02:24 +0100 Subject: [PATCH 03/26] use npm instead of yarn to reduce number of tools needed. - launch instead of attach and fix the required program path. - update readme, drop unnecessary language comment - add 'example' to name in packagejson --- support/test/node/typescript/.vimspector.json | 9 +++-- support/test/node/typescript/README.md | 23 +++++------ .../test/node/typescript/package-lock.json | 40 +++++++++++++++++++ support/test/node/typescript/package.json | 8 ++-- support/test/node/typescript/yarn.lock | 18 --------- 5 files changed, 57 insertions(+), 41 deletions(-) create mode 100644 support/test/node/typescript/package-lock.json delete mode 100644 support/test/node/typescript/yarn.lock diff --git a/support/test/node/typescript/.vimspector.json b/support/test/node/typescript/.vimspector.json index a4442e617..3cd2e67e1 100644 --- a/support/test/node/typescript/.vimspector.json +++ b/support/test/node/typescript/.vimspector.json @@ -2,12 +2,13 @@ "configurations": { "run - js-debug": { "adapter": "js-debug", + "filetypes": [ "javascript", "typescript" ], "configuration": { - "request": "attach", - "outDir": "${workspaceRoot}/dist/**.js", - "program": "${workspaceRoot}/index.ts", + "request": "launch", + "program": "${workspaceRoot}/src/index.ts", "cwd": "${workspaceRoot}", - "stopOnEntry": false + "stopOnEntry": false, + "type": "pwa-node" }, "breakpoints": { "exception": { diff --git a/support/test/node/typescript/README.md b/support/test/node/typescript/README.md index 5cf4bbde1..b1b98853c 100644 --- a/support/test/node/typescript/README.md +++ b/support/test/node/typescript/README.md @@ -1,28 +1,23 @@ # Howto -Typescript is a great language (looking past dependency hells of the js -ecosystem and the immense pain of setting up projects). This example shows you -how to use vimspector with -[vscode-js-debug](https://github.com/microsoft/vscode-js-debug). I only could -make this combination work by using 'attach' as launch. This is the reason why -this guide will explain how to use it with 'attach'. For all available options -see [here](https://github.com/microsoft/vscode-js-debug/blob/main/OPTIONS.md#node-attach). +This example shows you how to use vimspector with +[vscode-js-debug](https://github.com/microsoft/vscode-js-debug). For all +available options see +[here](https://github.com/microsoft/vscode-js-debug/blob/main/OPTIONS.md#node-attach). ## Prerequisites -- Ensure you are using nodejs version 18 or 20 (was tested with these and these are - LTS (december 2023). +- Have nodejs installed (was tested with 18 and 20 but should work with any). - Ensure you have vscode-js-debug installed, check installation guides for nodejs of the vimspector repo on how to do so. -- Install dependencies `yarn` (can install yarn if you don't have it yet, `npm i -g yarn`) +- Install dependencies `npm i`. ## Debugging -- Build the project `yarn build` -- Start the node process with inspect-brk option in a separate terminal `node --inspect-brk ./dist/index.js` +- Build the project `npm run build` - Open the typescript file with vim `vim ./src/index.ts` -- Set breakpoints at line 2 and 3 (standard key mapping F9) -- Run debugging (standard key mapping F5) +- Set breakpoints at line 2 and 3 (standard key mapping is F9) +- Run debugging (standard key mapping is F5) - Press F5 once again (you should see console log output) - Press F5 once again (you should see another console log output) - Done🎉 diff --git a/support/test/node/typescript/package-lock.json b/support/test/node/typescript/package-lock.json new file mode 100644 index 000000000..260f1e802 --- /dev/null +++ b/support/test/node/typescript/package-lock.json @@ -0,0 +1,40 @@ +{ + "name": "vimspector-typescript", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "vimspector-typescript", + "version": "1.0.0", + "license": "Apache-2.0", + "devDependencies": { + "@tsconfig/node18": "2.0.0", + "@types/node": "18.16.8", + "typescript": "5.3.3" + } + }, + "node_modules/@tsconfig/node18": { + "version": "2.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "18.16.8", + "dev": true, + "license": "MIT" + }, + "node_modules/typescript": { + "version": "5.3.3", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + } + } +} diff --git a/support/test/node/typescript/package.json b/support/test/node/typescript/package.json index 531d6547d..a94cb2502 100644 --- a/support/test/node/typescript/package.json +++ b/support/test/node/typescript/package.json @@ -1,13 +1,11 @@ { - "name": "vimspector-typescript", + "name": "vimspector-typescript-test", "author": "Pierre Dahmani ", "version": "1.0.0", - "main": "index.js", + "main": "dist/index.js", "license": "Apache-2.0", "scripts": { - "build": "tsc", - "start": "node ./dist/index.js", - "debug-brk": "node --inspect-brk ./dist/index.js" + "build": "tsc" }, "dependencies": {}, "devDependencies": { diff --git a/support/test/node/typescript/yarn.lock b/support/test/node/typescript/yarn.lock deleted file mode 100644 index 9ed2b2f03..000000000 --- a/support/test/node/typescript/yarn.lock +++ /dev/null @@ -1,18 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@tsconfig/node18@2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@tsconfig/node18/-/node18-2.0.0.tgz#58b52430d00913dc26c4459fbc7f05396e47886a" - integrity sha512-uI/B0ShkiEwTk036pncXucVlj4y11EW6mycQvCEzC1PkR2TBvdQZ5Wf96dp+XXWAc70FEDfvwTqanoaDpP6rPw== - -"@types/node@18.16.8": - version "18.16.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.8.tgz#fcd9bd0a793aba2701caff4aeae7c988d4da6ce5" - integrity sha512-p0iAXcfWCOTCBbsExHIDFCfwsqFwBTgETJveKMT+Ci3LY9YqQCI91F5S+TB20+aRCXpcWfvx5Qr5EccnwCm2NA== - -typescript@5.3.3: - version "5.3.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" - integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== From 1e6b46472067e2272b14c94b923ac36c2f833966 Mon Sep 17 00:00:00 2001 From: Pierre Dahmani Date: Fri, 22 Dec 2023 00:12:24 +0100 Subject: [PATCH 04/26] update readme --- support/test/node/typescript/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/test/node/typescript/README.md b/support/test/node/typescript/README.md index b1b98853c..3d666d987 100644 --- a/support/test/node/typescript/README.md +++ b/support/test/node/typescript/README.md @@ -7,7 +7,7 @@ available options see ## Prerequisites -- Have nodejs installed (was tested with 18 and 20 but should work with any). +- Have nodejs installed (was tested with 18 and 20). - Ensure you have vscode-js-debug installed, check installation guides for nodejs of the vimspector repo on how to do so. - Install dependencies `npm i`. From 5c46be191f3e08aaa8cae36e74fd9840780f7bfe Mon Sep 17 00:00:00 2001 From: Pierre Dahmani Date: Fri, 22 Dec 2023 00:17:35 +0100 Subject: [PATCH 05/26] reference node-launch --- support/test/node/typescript/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/test/node/typescript/README.md b/support/test/node/typescript/README.md index 3d666d987..ecb18eba6 100644 --- a/support/test/node/typescript/README.md +++ b/support/test/node/typescript/README.md @@ -3,7 +3,7 @@ This example shows you how to use vimspector with [vscode-js-debug](https://github.com/microsoft/vscode-js-debug). For all available options see -[here](https://github.com/microsoft/vscode-js-debug/blob/main/OPTIONS.md#node-attach). +[here](https://github.com/microsoft/vscode-js-debug/blob/main/OPTIONS.md#node-launch). ## Prerequisites From 9d4fb49ca7026b8e23f278f04f29642727d926e2 Mon Sep 17 00:00:00 2001 From: Pierre Dahmani Date: Fri, 22 Dec 2023 00:30:36 +0100 Subject: [PATCH 06/26] update readme for nodejs js and ts usage, based on suggestion. --- README.md | 50 +++++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index d43430ac5..f86b7cc1b 100644 --- a/README.md +++ b/README.md @@ -243,7 +243,7 @@ pre-packaged. To use a release tarball: ### Method 3: Using a plugin manager 1. [Check the dependencies](#dependencies) -1. See the plugin manager's docs and install the plugin +1. See the plugin manager's docs and install the plugin For Vundle, use: ```vim @@ -588,7 +588,7 @@ Vimspector is not: aproach. This means that it can only provide essential/basic debugging features for a given language. This makes it convenient for everyday usage, but not ideal for power users or those with very precise or specific - requirements. See [motivation](#motivation) for more info. + requirements. See [motivation](#motivation) for more info. ## Status @@ -662,7 +662,7 @@ Copyright © 2018 Ben Jackson ## Sponsorship If you like Vimspector so much that you're wiling to part with your hard-earned -cash, please consider donating to one of the following charities, which are +cash, please consider donating to one of the following charities, which are meaningful to the author of Vimspector (in order of preference): * [Hector's Greyhound Rescue](http://hectorsgreyhoundrescue.org) @@ -820,10 +820,10 @@ request, then you will be asked to enter a PID (process ID) to attach to. To make this easier, Vimspector supplies a little utility for listing PIDs. It's like a very very simple clone of `ps` but works on all the supported platforms. See [its README](support/vimspector_process_list/README.md) for instructions on -setting it up. +setting it up. In short: - + - If you used a tarball installation, you don't need to do anything. - Otherwise, run `go build` in the `support/vimspector_process_list` directory @@ -832,7 +832,7 @@ by the current user by default. Alternatively (preferably), you can use a special form of variable expansion called `${PickProcess(\"binaryName\")}`. The version of this call will list all -processes for the current user that match this binary name. +processes for the current user that match this binary name. For example: @@ -1150,7 +1150,7 @@ the [breakpoints window](#breakpoints-window). Currently, instruction breakpoints are automatically cleared when the debug session ends. The reason for this is that the addresses can't be guaranteed to -be valid for any other debug session. However, this may also change in future. +be valid for any other debug session. However, this may also change in future. ### Clear breakpoints @@ -1323,7 +1323,7 @@ let g:ycm_semantic_triggers = { * Dispplay disassembly around current PC * Step over/into/out by instruction (contextually, or using the WinBar) * `:VimspectorDisassemble`, `vimspector#ShowDisassembly()` or - `VimspectorDisassemble` + `VimspectorDisassemble` [![Demo](https://asciinema.org/a/esEncAxP45CJmo8Em1sQtxRYe.svg)](https://asciinema.org/a/esEncAxP45CJmo8Em1sQtxRYe) @@ -2144,30 +2144,38 @@ export XDEBUG_CONFIG="idekey=xdebug" php ``` -## JavaScript, TypeScript, etc. +## JavaScript and TypeScript * Node.js -Requires: +This uses [vscode-js-debug](https://github.com/microsoft/vscode-js-debug), the +debugger that is used in vscode as well. For additional configurations, check +the documentation [here](https://github.com/microsoft/vscode-js-debug/blob/main/OPTIONS.md). -* `install_gadget.py --force-enable-node` -* Options described here: - https://github.com/microsoft/vscode-js-debug/blob/main/OPTIONS.md -* Example: `support/test/node/simple`, `support/test/node/multiprocess` +To install vscode-js-debug, run `install_gadget.py --force-enable-node`. There +are multiple examples which you can check out. Find them under +`support/test/node/simple`, `support/test/node/multiprocess` and +`support/test/node/typescript`. A typical configuration for debugging typescript +looks like this: ```json { "configurations": { - "run": { + "run - js-debug": { "adapter": "js-debug", - "filetypes": [ "javascript", "typescript" ], // optional + "filetypes": [ "javascript", "typescript" ], "configuration": { "request": "launch", - "stopOnEntry": true, - "console": "integratedTerminal", - "program": "${workspaceRoot}/simple.js", + "program": "${workspaceRoot}/src/index.ts", "cwd": "${workspaceRoot}", - "type": "pwa-node" // this is the default, but see below + "stopOnEntry": false, + "type": "pwa-node" + }, + "breakpoints": { + "exception": { + "all": "", + "uncaught": "" + } } } } @@ -2663,7 +2671,7 @@ as it is a common requirement. In many cases you will want to rebuild your project before starting a new debugging session. Vimspector is not a task manager and implementing this functionality is out of the scope of this project. However, there are some strategies described in the -[community wiki](https://github.com/puremourning/vimspector/wiki/Pre-launch-building-strategies) +[community wiki](https://github.com/puremourning/vimspector/wiki/Pre-launch-building-strategies) to achieve similar functionality. From fc825a357cc363408cdbddafbca313a544973b89 Mon Sep 17 00:00:00 2001 From: Pierre Dahmani Date: Fri, 22 Dec 2023 00:35:53 +0100 Subject: [PATCH 07/26] update toc --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f86b7cc1b..c1a638280 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ For detailed explanation of the `.vimspector.json` format, see the * [PHP](#php) * [Debug web application](#debug-web-application) * [Debug cli application](#debug-cli-application) - * [JavaScript, TypeScript, etc.](#javascript-typescript-etc) + * [JavaScript and TypeScript](#javascript-and-typescript) * [Java](#java) * [Hot code replace](#hot-code-replace) * [Usage with YouCompleteMe](#usage-with-youcompleteme) From 4324773d0fbe3ce359930e9064e0e707fee97219 Mon Sep 17 00:00:00 2001 From: Pierre Dahmani Date: Sat, 13 Jan 2024 09:55:15 +0100 Subject: [PATCH 08/26] pr feedback. mention vimspectorinstall, mention optional part of config --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c1a638280..79d47196f 100644 --- a/README.md +++ b/README.md @@ -2152,13 +2152,15 @@ This uses [vscode-js-debug](https://github.com/microsoft/vscode-js-debug), the debugger that is used in vscode as well. For additional configurations, check the documentation [here](https://github.com/microsoft/vscode-js-debug/blob/main/OPTIONS.md). -To install vscode-js-debug, run `install_gadget.py --force-enable-node`. There -are multiple examples which you can check out. Find them under +To install vscode-js-debug, run `VimspectorInstall vscode-js-debug` from vim or +run the install script `install_gadget.py --force-enable-node`. There are +multiple examples which you can check out. Find them under `support/test/node/simple`, `support/test/node/multiprocess` and `support/test/node/typescript`. A typical configuration for debugging typescript looks like this: ```json + { "configurations": { "run - js-debug": { @@ -2171,15 +2173,18 @@ looks like this: "stopOnEntry": false, "type": "pwa-node" }, + // 'breakpoints' is an optional part. This is a way to configure exception + // breakpoints. You can leave this out or set as you prefer. "breakpoints": { "exception": { - "all": "", - "uncaught": "" + "all": "N", + "uncaught": "N" } } } } } + ``` `vscode-js-debug` supports a number of different "types" and can do some stuff From affe15eb38c2dabd850b19ca5a0edcfe401c9caa Mon Sep 17 00:00:00 2001 From: Pierre Dahmani Date: Sat, 13 Jan 2024 10:00:45 +0100 Subject: [PATCH 09/26] pr feedback. drop lockfile, use new debug config with optional comments --- support/test/node/typescript/.gitignore | 1 + support/test/node/typescript/.vimspector.json | 7 +++- .../test/node/typescript/package-lock.json | 40 ------------------- 3 files changed, 6 insertions(+), 42 deletions(-) delete mode 100644 support/test/node/typescript/package-lock.json diff --git a/support/test/node/typescript/.gitignore b/support/test/node/typescript/.gitignore index de4d1f007..91a3983f3 100644 --- a/support/test/node/typescript/.gitignore +++ b/support/test/node/typescript/.gitignore @@ -1,2 +1,3 @@ dist node_modules +package-lock.json diff --git a/support/test/node/typescript/.vimspector.json b/support/test/node/typescript/.vimspector.json index 3cd2e67e1..1b0a58174 100644 --- a/support/test/node/typescript/.vimspector.json +++ b/support/test/node/typescript/.vimspector.json @@ -10,12 +10,15 @@ "stopOnEntry": false, "type": "pwa-node" }, + // 'breakpoints' is an optional part. This is a way to configure exception + // breakpoints. You can leave this out or set as you prefer. "breakpoints": { "exception": { - "all": "", - "uncaught": "" + "all": "N", + "uncaught": "N" } } } } } + diff --git a/support/test/node/typescript/package-lock.json b/support/test/node/typescript/package-lock.json deleted file mode 100644 index 260f1e802..000000000 --- a/support/test/node/typescript/package-lock.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "vimspector-typescript", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "vimspector-typescript", - "version": "1.0.0", - "license": "Apache-2.0", - "devDependencies": { - "@tsconfig/node18": "2.0.0", - "@types/node": "18.16.8", - "typescript": "5.3.3" - } - }, - "node_modules/@tsconfig/node18": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/node": { - "version": "18.16.8", - "dev": true, - "license": "MIT" - }, - "node_modules/typescript": { - "version": "5.3.3", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - } - } -} From bc4ce49ab5a12e9c51a3737154b0af41a382bdb7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 20:55:22 +0000 Subject: [PATCH 10/26] Bump django from 4.2.10 to 4.2.11 in /support/test/python/django Bumps [django](https://github.com/django/django) from 4.2.10 to 4.2.11. - [Commits](https://github.com/django/django/compare/4.2.10...4.2.11) --- updated-dependencies: - dependency-name: django dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- support/test/python/django/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/test/python/django/requirements.txt b/support/test/python/django/requirements.txt index 6cca1b51e..209bacfb7 100644 --- a/support/test/python/django/requirements.txt +++ b/support/test/python/django/requirements.txt @@ -1 +1 @@ -Django==4.2.10 +Django==4.2.11 From f5a975295c4a8c362ae4d5b7549dacc99ecfca70 Mon Sep 17 00:00:00 2001 From: samisalreadytaken <46823719+samisalreadytaken@users.noreply.github.com> Date: Mon, 6 May 2024 12:03:09 +0300 Subject: [PATCH 11/26] Check capabilities before sending instruction breakpoints --- python3/vimspector/breakpoints.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python3/vimspector/breakpoints.py b/python3/vimspector/breakpoints.py index b94315245..2aab632eb 100644 --- a/python3/vimspector/breakpoints.py +++ b/python3/vimspector/breakpoints.py @@ -959,7 +959,8 @@ def response_handler( conn, msg, bp_idxs = [] ): failure_handler = response_received ) - if self._disassembly_manager: + if self._disassembly_manager and self._server_capabilities.get( + 'supportsInstructionBreakpoints' ): for connection in self._connections: breakpoints = [] bp_idxs = [] From 234a0fbcee07a308bd6ddd83e920a1a15717e5f9 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Mon, 6 May 2024 11:13:39 +0100 Subject: [PATCH 12/26] Update delve to 1.22 for compatibility with latest go --- python3/vimspector/gadgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3/vimspector/gadgets.py b/python3/vimspector/gadgets.py index 82b6882c7..42b5660d0 100644 --- a/python3/vimspector/gadgets.py +++ b/python3/vimspector/gadgets.py @@ -353,7 +353,7 @@ gadget ), 'all': { 'path': 'github.com/go-delve/delve/cmd/dlv', - 'version': '1.21.0', + 'version': '1.22.1', }, 'adapters': { "delve": { From 98fc4b2cc91e4cb67db9dc30aff15404da0a92a2 Mon Sep 17 00:00:00 2001 From: Ubaldo Tiberi Date: Sun, 5 May 2024 18:47:38 +0200 Subject: [PATCH 13/26] Upgraded debugpy to version 1.8.1 --- python3/vimspector/gadgets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python3/vimspector/gadgets.py b/python3/vimspector/gadgets.py index 42b5660d0..a64bfc584 100644 --- a/python3/vimspector/gadgets.py +++ b/python3/vimspector/gadgets.py @@ -112,10 +112,10 @@ 'url': 'https://github.com/microsoft/debugpy/archive/${file_name}' }, 'all': { - 'version': '1.7.0', - 'file_name': 'v1.7.0.zip', + 'version': '1.8.1', + 'file_name': 'v1.8.1.zip', 'checksum': - '' + 'dd1db7bb110bd78a63c869cbffb5a1799102129d9ac6f79b0490333d6f5f393c' }, 'do': lambda name, root, gadget: installer.InstallDebugpy( name, root, From a92c9a2c8cbe1700fdc025deafd42e90705d0237 Mon Sep 17 00:00:00 2001 From: Ubaldo Tiberi Date: Sun, 5 May 2024 18:55:07 +0200 Subject: [PATCH 14/26] Removed checksum --- python3/vimspector/gadgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3/vimspector/gadgets.py b/python3/vimspector/gadgets.py index a64bfc584..44d482183 100644 --- a/python3/vimspector/gadgets.py +++ b/python3/vimspector/gadgets.py @@ -115,7 +115,7 @@ 'version': '1.8.1', 'file_name': 'v1.8.1.zip', 'checksum': - 'dd1db7bb110bd78a63c869cbffb5a1799102129d9ac6f79b0490333d6f5f393c' + '' }, 'do': lambda name, root, gadget: installer.InstallDebugpy( name, root, From f32e1441cb0d2d5ae256e7db768ee016f97ea4bc Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Mon, 6 May 2024 12:23:04 +0100 Subject: [PATCH 15/26] Stop building release tarballs From issues, it seems nobody really uses them, and they have a cost in terms of CI time. --- .github/workflows/build.yaml | 66 ------------------------------------ README.md | 49 +++++--------------------- make_package | 42 ----------------------- 3 files changed, 8 insertions(+), 149 deletions(-) delete mode 100755 make_package diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 18812f293..3607bd7f7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -87,19 +87,8 @@ jobs: name: 'test-logs-${{ runner.os }}-${{ matrix.runtime }}' path: 'tests/logs/**/*' - - name: 'Package' - if: matrix.runtime == 'vim' - run: ./make_package linux ${{ github.run_id }} - # TODO: test the tarball - - name: "Upload package" - if: matrix.runtime == 'vim' - uses: actions/upload-artifact@v2 - with: - name: 'package-linux' - path: 'package/linux-${{ github.run_id }}.tar.gz' - # - name: Start SSH session if failed # uses: luchihoratiu/debug-via-ssh@main # if: failure() @@ -180,66 +169,11 @@ jobs: name: 'test-logs-${{ runner.os }}-${{ matrix.runtime }}' path: 'tests/logs/**/*' - - name: 'Package' - if: matrix.runtime == 'vim' - run: ./make_package macos ${{ github.run_id }} - # TODO: test the tarball - - name: "Upload package" - if: matrix.runtime == 'vim' - uses: actions/upload-artifact@v2 - with: - name: 'package-macos' - path: 'package/macos-${{ github.run_id }}.tar.gz' - # - name: Start SSH session if failed # uses: luchihoratiu/debug-via-ssh@main # if: failure() || cancelled() # with: # NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} # SSH_PASS: ${{ secrets.SSH_PASS }} - - PublishRelease: - runs-on: 'ubuntu-20.04' - needs: - - Linux - - MacOS - if: github.ref == 'refs/heads/master' - steps: - - name: 'Download artifacts' - id: download_artifacts - uses: actions/download-artifact@v2 - - - name: 'Create Release' - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.run_id }} - release_name: Build ${{ github.run_id }} - draft: false - prerelease: true - - - name: 'Upload Linux Package' - id: upload-release-asset-linux - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ steps.download_artifacts.outputs.download-path }}/package-linux/linux-${{ github.run_id }}.tar.gz - asset_name: vimspector-linux-${{ github.run_id }}.tar.gz - asset_content_type: application/gzip - - - name: 'Upload MacOS Package' - id: upload-release-asset-macos - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ steps.download_artifacts.outputs.download-path }}/package-macos/macos-${{ github.run_id }}.tar.gz - asset_name: vimspector-macos-${{ github.run_id }}.tar.gz - asset_content_type: application/gzip diff --git a/README.md b/README.md index 8a8b79721..b2443aa20 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,8 @@ For detailed explanation of the `.vimspector.json` format, see the * [Other languages](#other-languages) * [Installation](#installation) * [Quick Start](#quick-start) - * [Method 1: Using a release tarball and Vim packages](#method-1-using-a-release-tarball-and-vim-packages) - * [Method 2: Using a repo clone, Vim packages and select gadgets to be installed](#method-2-using-a-repo-clone-vim-packages-and-select-gadgets-to-be-installed) - * [Method 3: Using a plugin manager](#method-3-using-a-plugin-manager) + * [Method 1: Using a repo clone, Vim packages and select gadgets to be installed](#method-2-using-a-repo-clone-vim-packages-and-select-gadgets-to-be-installed) + * [Method 2: Using a plugin manager](#method-3-using-a-plugin-manager) * [Dependencies](#dependencies) * [Neovim limitations](#neovim-limitations) * [Windows differences](#windows-differences) @@ -201,37 +200,12 @@ To use Vimspector with a language that's not "built-in", see this ## Quick Start -There are 3 installation methods: +There are 2 installation methods: -* Using a release tarball and Vim packages * Using a repo clone and Vim packages * Using a plugin manager -### Method 1: Using a release tarball and Vim packages - -Release tarballs come with debug adapters for the default languages -pre-packaged. To use a release tarball: - -1. [Check the dependencies](#dependencies) -2. Untar the release tarball for your OS into `$HOME/.vim/pack`: - - ```bash - $ mkdir -p $HOME/.vim/pack - $ curl -L | tar -C $HOME/.vim/pack zxvf - - ``` - -3. Add `packadd! vimspector` to your `.vimrc` - -4. (optionally) Enable the default set of mappings: - - ```vim - let g:vimspector_enable_mappings = 'HUMAN' - ``` - -5. Configure your project's debug profiles (create `.vimspector.json`, or set - `g:vimspector_configurations`) - see the [reference guide][vimspector-ref] - -### Method 2: Using a repo clone, Vim packages and select gadgets to be installed +### Method 1: Using a repo clone, Vim packages and select gadgets to be installed 1. [Check the dependencies](#dependencies) 1. Install the plugin as a Vim package. See `:help packages`. @@ -240,7 +214,7 @@ pre-packaged. To use a release tarball: 3. Configure your project's debug profiles (create `.vimspector.json`, or set `g:vimspector_configurations`) - see the [reference guide][vimspector-ref] -### Method 3: Using a plugin manager +### Method 2: Using a plugin manager 1. [Check the dependencies](#dependencies) 1. See the plugin manager's docs and install the plugin @@ -315,10 +289,7 @@ which can be used to check everything is working. This is used by the regression tests in CI so should always work, and is a good way to check if the problem is your configuration rather than a bug. -## Cloning the plugin - -If you're not using a release tarball, you'll need to clone this repo to the -appropriate place. +## Installing the plugin 1. Clone the plugin @@ -363,8 +334,6 @@ In order for Vimspector to be useful, you need to have some adapters installed. There are a few ways to do this: -* If you downloaded a tarball, gadgets for main supported languages are already - installed for you. * Using `:VimspectorInstall ` (use TAB `wildmenu` to see the options, also accepts any `install_gadget.py` option) * Using `python3 install_gadget.py ` (use `--help` to see all options) @@ -828,10 +797,8 @@ like a very very simple clone of `ps` but works on all the supported platforms. See [its README](support/vimspector_process_list/README.md) for instructions on setting it up. -In short: - -- If you used a tarball installation, you don't need to do anything. -- Otherwise, run `go build` in the `support/vimspector_process_list` directory +Run `go build` in the `support/vimspector_process_list` directory to set it +up. If Vimspector is able to find this app, it will try to list all processes owned by the current user by default. diff --git a/make_package b/make_package deleted file mode 100755 index 97f2e308a..000000000 --- a/make_package +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -v - -OS=$1 -shift - -VERSION=$1 -shift - -ROOT=$(pwd) -PACK=${ROOT}/package/${OS} - -mkdir -p ${PACK} -pushd ${PACK} - mkdir -p vimspector/opt/vimspector - pushd vimspector/opt/vimspector - for d in autoload plugin python3 vendor doc support; do - if [[ -d ${ROOT}/$d ]]; then - cp -r ${ROOT}/$d . - fi - done - # test vimrc is required for the minimal vimrc - mkdir -p tests - pushd tests - cp ${ROOT}/tests/vimrc . - popd - mkdir -p gadgets - cp -r ${ROOT}/gadgets/${OS} gadgets/ - for f in install_gadget.py \ - CODE_OF_CONDUCT.md \ - CONTRIBUTING.md \ - LICENCE \ - README.md; do - cp ${ROOT}/${f} . - done - popd -popd - -cd ${ROOT}/package -tar zcvf ${OS}-${VERSION}.tar.gz -C ${OS} vimspector From 93d90f0f03ea4680b6e502b4c0bd2c469fe8cc4a Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Mon, 6 May 2024 15:24:23 +0100 Subject: [PATCH 16/26] Disable discussions Discussion are not being used as discussions, rather as less effective means of support. --- .github/ISSUE_TEMPLATE/config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 382075e4f..a46091bb8 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -3,9 +3,6 @@ contact_links: - name: Questions and support url: 'https://matrix.to/#/#vimspector_Lobby:gitter.im' about: Please ask and answer questions here. - - name: Discussions - url: https://github.com/puremourning/vimspector/discussions - about: Please post questions and useful hints here - name: Support for additional languages url: https://github.com/puremourning/vimspector/wiki/languages about: Please see here for information on support for additional languages From 8461a8bfcddeab4d74566c8a0c27c4a40a24ded9 Mon Sep 17 00:00:00 2001 From: puremourning Date: Mon, 6 May 2024 16:12:59 +0000 Subject: [PATCH 17/26] Update vim docs --- doc/vimspector.txt | 167 +++++++++++++++++++-------------------------- 1 file changed, 72 insertions(+), 95 deletions(-) diff --git a/doc/vimspector.txt b/doc/vimspector.txt index e145c5558..9d170061e 100644 --- a/doc/vimspector.txt +++ b/doc/vimspector.txt @@ -10,14 +10,13 @@ Contents ~ 3. Other languages |vimspector-other-languages| 3. Installation |vimspector-installation| 1. Quick Start |vimspector-quick-start| - 1. Method 1: Using a release tarball and Vim packages |vimspector-method-1-using-release-tarball-vim-packages| - 2. Method 2: Using a repo clone, Vim packages and select gadgets to be installed |vimspector-method-2-using-repo-clone-vim-packages-select-gadgets-to-be-installed| - 3. Method 3: Using a plugin manager |vimspector-method-3-using-plugin-manager| + 1. Method 1: Using a repo clone, Vim packages and select gadgets to be installed |vimspector-method-1-using-repo-clone-vim-packages-select-gadgets-to-be-installed| + 2. Method 2: Using a plugin manager |vimspector-method-2-using-plugin-manager| 2. Dependencies |vimspector-dependencies| 1. Neovim limitations |vimspector-neovim-limitations| 2. Windows differences |vimspector-windows-differences| 3. Trying it out |vimspector-trying-it-out| - 4. Cloning the plugin |vimspector-cloning-plugin| + 4. Installing the plugin |vimspector-installing-plugin| 5. Install some gadgets |vimspector-install-gadgets| 1. VimspectorInstall and VimspectorUpdate commands |vimspectorinstall-vimspectorupdate-commands| 2. install_gadget.py |vimspector-install_gadget.py| @@ -85,7 +84,7 @@ Contents ~ 8. PHP |vimspector-php| 1. Debug web application |vimspector-debug-web-application| 2. Debug cli application |vimspector-debug-cli-application| - 9. JavaScript, TypeScript, etc. |vimspector-javascript-typescript-etc.| + 9. JavaScript and TypeScript |vimspector-javascript-typescript| 10. Java |vimspector-java| 1. Hot code replace |vimspector-hot-code-replace| 2. Usage with YouCompleteMe |vimspector-usage-with-youcompleteme| @@ -127,10 +126,9 @@ Image: Build [3] Image: Matrix [5] Image: Gitter [7] - Installation - Quick Start - - Method 1: Using a release tarball and Vim packages - - Method 2: Using a repo clone, Vim packages and select gadgets to be + - Method 1: Using a repo clone, Vim packages and select gadgets to be installed - - Method 3: Using a plugin manager + - Method 2: Using a plugin manager - Dependencies - Neovim limitations - Windows differences @@ -213,7 +211,7 @@ Image: Build [3] Image: Matrix [5] Image: Gitter [7] - PHP - Debug web application - Debug cli application - - JavaScript, TypeScript, etc. + - JavaScript and TypeScript - Java - Hot code replace - Usage with YouCompleteMe @@ -355,37 +353,14 @@ Installation ~ *vimspector-quick-start* Quick Start ~ -There are 3 installation methods: +There are 2 installation methods: -- Using a release tarball and Vim packages - Using a repo clone and Vim packages - Using a plugin manager ------------------------------------------------------------------------------- - *vimspector-method-1-using-release-tarball-vim-packages* -Method 1: Using a release tarball and Vim packages ~ - -Release tarballs come with debug adapters for the default languages -pre-packaged. To use a release tarball: - -1. Check the dependencies -2. Untar the release tarball for your OS into '$HOME/.vim/pack': -> - $ mkdir -p $HOME/.vim/pack - $ curl -L | tar -C $HOME/.vim/pack zxvf - -< -1. Add 'packadd! vimspector' to your '.vimrc' - -2. (optionally) Enable the default set of mappings: -> - let g:vimspector_enable_mappings = 'HUMAN' -< -1. Configure your project's debug profiles (create '.vimspector.json', or - set 'g:vimspector_configurations') - see the reference guide [2] - -------------------------------------------------------------------------------- -*vimspector-method-2-using-repo-clone-vim-packages-select-gadgets-to-be-installed* -Method 2: Using a repo clone, Vim packages and select gadgets to be installed ~ +*vimspector-method-1-using-repo-clone-vim-packages-select-gadgets-to-be-installed* +Method 1: Using a repo clone, Vim packages and select gadgets to be installed ~ 1. Check the dependencies 2. Install the plugin as a Vim package. See ':help packages'. @@ -396,8 +371,8 @@ Method 2: Using a repo clone, Vim packages and select gadgets to be installed ~ set 'g:vimspector_configurations') - see the reference guide [2] ------------------------------------------------------------------------------- - *vimspector-method-3-using-plugin-manager* -Method 3: Using a plugin manager ~ + *vimspector-method-2-using-plugin-manager* +Method 2: Using a plugin manager ~ 1. Check the dependencies 2. See the plugin manager's docs and install the plugin For Vundle, use: @@ -477,11 +452,8 @@ regression tests in CI so should always work, and is a good way to check if the problem is your configuration rather than a bug. ------------------------------------------------------------------------------- - *vimspector-cloning-plugin* -Cloning the plugin ~ - -If you're not using a release tarball, you'll need to clone this repo to the -appropriate place. + *vimspector-installing-plugin* +Installing the plugin ~ 1. Clone the plugin @@ -520,9 +492,6 @@ In order for Vimspector to be useful, you need to have some adapters installed. There are a few ways to do this: -- If you downloaded a tarball, gadgets for main supported languages are - already installed for you. - - Using ':VimspectorInstall ' (use TAB 'wildmenu' to see the options, also accepts any 'install_gadget.py' option) @@ -1071,11 +1040,7 @@ To make this easier, Vimspector supplies a little utility for listing PIDs. It's like a very very simple clone of 'ps' but works on all the supported platforms. See its README [23] for instructions on setting it up. -In short: - -- If you used a tarball installation, you don't need to do anything. -- Otherwise, run 'go build' in the 'support/vimspector_process_list' - directory +Run 'go build' in the 'support/vimspector_process_list' directory to set it up. If Vimspector is able to find this app, it will try to list all processes owned by the current user by default. @@ -2495,30 +2460,40 @@ Debug cli application ~ php < ------------------------------------------------------------------------------- - *vimspector-javascript-typescript-etc.* -JavaScript, TypeScript, etc. ~ + *vimspector-javascript-typescript* +JavaScript and TypeScript ~ - Node.js -Requires: +This uses vscode-js-debug [54], the debugger that is used in vscode as well. +For additional configurations, check the documentation here [55]. -- 'install_gadget.py --force-enable-node' -- Options described here: - https://github.com/microsoft/vscode-js-debug/blob/main/OPTIONS.md -- Example: 'support/test/node/simple', 'support/test/node/multiprocess' +To install vscode-js-debug, run 'VimspectorInstall vscode-js-debug' from vim or +run the install script 'install_gadget.py --force-enable-node'. There are +multiple examples which you can check out. Find them under +'support/test/node/simple', 'support/test/node/multiprocess' and +'support/test/node/typescript'. A typical configuration for debugging +typescript looks like this: > { "configurations": { - "run": { + "run - js-debug": { "adapter": "js-debug", - "filetypes": [ "javascript", "typescript" ], // optional + "filetypes": [ "javascript", "typescript" ], "configuration": { "request": "launch", - "stopOnEntry": true, - "console": "integratedTerminal", - "program": "${workspaceRoot}/simple.js", + "program": "${workspaceRoot}/src/index.ts", "cwd": "${workspaceRoot}", - "type": "pwa-node" // this is the default, but see below + "stopOnEntry": false, + "type": "pwa-node" + }, + // 'breakpoints' is an optional part. This is a way to configure exception + // breakpoints. You can leave this out or set as you prefer. + "breakpoints": { + "exception": { + "all": "N", + "uncaught": "N" + } } } } @@ -2526,7 +2501,7 @@ Requires: < 'vscode-js-debug' supports a number of different "types" and can do some stuff that may or may not work. The 'type' field is sadly not documented, but the -valid values are defined here in the DebugType enum [54]. +valid values are defined here in the DebugType enum [56]. Vimspector has only been tested with 'pwa-node' type. @@ -2546,7 +2521,7 @@ Requires: - 'install_gadget.py --force-enable-node' - For installation, a Node.js environment that is < node 12. I believe this - is an incompatibility with gulp. Advice, use nvm [55] with 'nvm install + is an incompatibility with gulp. Advice, use nvm [57] with 'nvm install --lts 10; nvm use --lts 10; ./install_gadget.py --force-enable-node ...' - Options described here: @@ -2614,12 +2589,12 @@ It allows you to debug scripts running inside chrome from within Vim. *vimspector-java* Java ~ -Vimspector works well with the java debug server [56], which runs as a jdt.ls +Vimspector works well with the java debug server [58], which runs as a jdt.ls (Java Language Server) plugin, rather than a standalone debug adapter. Vimspector is not in the business of running language servers, only debug adapters, so this means that you need a compatible Language Server Protocol -editor plugin to use Java. I recommend YouCompleteMe [57], which has full +editor plugin to use Java. I recommend YouCompleteMe [59], which has full support for jdt.ls, and most importantly a trivial way to load the debug adapter and to use it with Vimspector. @@ -2627,7 +2602,7 @@ adapter and to use it with Vimspector. *vimspector-hot-code-replace* Hot code replace ~ -When using the java debug server [56], Vimspector supports the hot code replace +When using the java debug server [58], Vimspector supports the hot code replace custom feature. By default, when the underlying class files change, vimspector asks the user if they wish to reload these classes at runtime. @@ -2646,7 +2621,7 @@ This behaviour can be customised: *vimspector-usage-with-youcompleteme* Usage with YouCompleteMe ~ -- Set up YCM for java [57]. +- Set up YCM for java [59]. - Get Vimspector to download the java debug plugin: 'install_gadget.py --force-enable-java ' or ':VimspectorInstall @@ -2711,24 +2686,24 @@ If you see "Unable to get DAP port - is JDT.LS initialized?", try running ':YcmCompleter ExecuteCommand vscode.java.startDebugSession' and note the output. If you see an error like 'ResponseFailedException: Request failed: -32601: No delegateCommandHandler for vscode.java.startDebugSession', make sure -that: _Your YCM jdt.ls is actually working, see the YCM docs [58] for +that: _Your YCM jdt.ls is actually working, see the YCM docs [60] for troubleshooting_ The YCM jdt.ls has had time to initialize before you start the debugger * That 'g:ycm_java_jdtls_extension_path' is set in '.vimrc' or prior to YCM starting -For the launch arguments, see the vscode document [59]. +For the launch arguments, see the vscode document [61]. ------------------------------------------------------------------------------- *vimspector-other-lsp-clients* Other LSP clients ~ -See this issue [60] for more background. +See this issue [62] for more background. ------------------------------------------------------------------------------- *vimspector-lua* Lua ~ -Lua is supported through local-lua-debugger-vscode [61]. This debugger uses +Lua is supported through local-lua-debugger-vscode [63]. This debugger uses stdio to communicate with the running process, so calls to 'io.read' will cause problems. @@ -2786,7 +2761,7 @@ problems. Other servers ~ - Java - vscode-javac. This works, but is not as functional as Java Debug - Server. Take a look at this comment [62] for instructions. + Server. Take a look at this comment [64] for instructions. - See also the wiki [15] which has community-contributed plugin files for some languages. @@ -3043,7 +3018,7 @@ Pre-launch building strategies ~ In many cases you will want to rebuild your project before starting a new debugging session. Vimspector is not a task manager and implementing this functionality is out of the scope of this project. However, there are some -strategies described in the community wiki [63] to achieve similar +strategies described in the community wiki [65] to achieve similar functionality. ------------------------------------------------------------------------------- @@ -3199,7 +3174,7 @@ FAQ ~ additional language support 2. How do I stop it starting a new Terminal.app on macOS? See this comment - [64] + [66] 3. Can I specify answers to the annoying questions about exception breakpoints in my '.vimspector.json' ? Yes, see here [26]. @@ -3236,10 +3211,10 @@ FAQ ~ 4. Do I _have_ to put a '.vimspector.json' in the root of every project? No, you can use 'g:vimspector_adapters' and 'g:vimspector_configurations' or - put all of your adapter and debug configs in a single directory [65] if + put all of your adapter and debug configs in a single directory [67] if you want to, but note the caveat that '${workspaceRoot}' won't be calculated correctly in that case. The vimsepctor author uses this a lot - [66] + [68] 5. I'm confused about remote debugging configuration, can you explain it? eh... kind of. Reference: https://puremourning.github.io/vimspector/confi @@ -3247,7 +3222,7 @@ FAQ ~ ://github.com/puremourning/vimspector/issues/478#issuecomment-943515093 6. I'm trying to debug a Django (django?) project and it's not working. Can - you help? sure, check this link which has a working example [67]. Or + you help? sure, check this link which has a working example [69]. Or google it. 7. Can vimspector build my code before debugging it? Can I deploy it to a @@ -3255,7 +3230,7 @@ FAQ ~ debugger, not a task system or build automation system - there are other tools for that. There is however a hack you can use - you can use a 'shell' variable to execute a command and just discard the output. Other - options are discussed in this issue [68] + options are discussed in this issue [70] 8. It's annoying to manually type in the PID when attaching. Do you have a PID picker? There's no PID picker in vimspector at the moment, but you @@ -3373,20 +3348,22 @@ References ~ [51] https://github.com/go-delve/delve/tree/master/Documentation/installation [52] https://github.com/golang/vscode-go/blob/master/docs/debugging-legacy.md [53] https://github.com/golang/vscode-go/blob/master/docs/debugging-legacy.md#troubleshooting -[54] https://github.com/microsoft/vscode-js-debug/blob/main/src/common/contributionUtils.ts#L61 -[55] https://github.com/nvm-sh/nvm -[56] https://github.com/Microsoft/java-debug -[57] https://github.com/ycm-core/YouCompleteMe#java-semantic-completion -[58] https://github.com/ycm-core/YouCompleteMe#troubleshooting -[59] https://code.visualstudio.com/docs/java/java-debugging -[60] https://github.com/puremourning/vimspector/issues/3 -[61] https://github.com/tomblind/local-lua-debugger-vscode -[62] https://github.com/puremourning/vimspector/issues/3#issuecomment-576916076 -[63] https://github.com/puremourning/vimspector/wiki/Pre-launch-building-strategies -[64] https://github.com/puremourning/vimspector/issues/90#issuecomment-577857322 -[65] https://puremourning.github.io/vimspector/configuration.html#debug-configurations -[66] https://github.com/puremourning/.vim-mac/tree/master/vimspector-conf -[67] https://www.reddit.com/r/neovim/comments/mz4ari/how_to_set_up_vimspector_for_django_debugging/ -[68] https://github.com/puremourning/vimspector/issues/227 +[54] https://github.com/microsoft/vscode-js-debug +[55] https://github.com/microsoft/vscode-js-debug/blob/main/OPTIONS.md +[56] https://github.com/microsoft/vscode-js-debug/blob/main/src/common/contributionUtils.ts#L61 +[57] https://github.com/nvm-sh/nvm +[58] https://github.com/Microsoft/java-debug +[59] https://github.com/ycm-core/YouCompleteMe#java-semantic-completion +[60] https://github.com/ycm-core/YouCompleteMe#troubleshooting +[61] https://code.visualstudio.com/docs/java/java-debugging +[62] https://github.com/puremourning/vimspector/issues/3 +[63] https://github.com/tomblind/local-lua-debugger-vscode +[64] https://github.com/puremourning/vimspector/issues/3#issuecomment-576916076 +[65] https://github.com/puremourning/vimspector/wiki/Pre-launch-building-strategies +[66] https://github.com/puremourning/vimspector/issues/90#issuecomment-577857322 +[67] https://puremourning.github.io/vimspector/configuration.html#debug-configurations +[68] https://github.com/puremourning/.vim-mac/tree/master/vimspector-conf +[69] https://www.reddit.com/r/neovim/comments/mz4ari/how_to_set_up_vimspector_for_django_debugging/ +[70] https://github.com/puremourning/vimspector/issues/227 vim: ft=help From fd9c9bd84f9cc996be9dec34002822906adee8b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 May 2024 18:53:33 +0000 Subject: [PATCH 18/26] Bump rexml from 3.2.5 to 3.2.8 in /docs Bumps [rexml](https://github.com/ruby/rexml) from 3.2.5 to 3.2.8. - [Release notes](https://github.com/ruby/rexml/releases) - [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md) - [Commits](https://github.com/ruby/rexml/compare/v3.2.5...v3.2.8) --- updated-dependencies: - dependency-name: rexml dependency-type: indirect ... Signed-off-by: dependabot[bot] --- docs/Gemfile.lock | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 950b1ed1e..de0120c06 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -224,7 +224,8 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - rexml (3.2.5) + rexml (3.2.8) + strscan (>= 3.0.9) rouge (3.26.0) ruby2_keywords (0.0.5) rubyzip (2.3.2) @@ -239,6 +240,7 @@ GEM faraday (>= 0.17.3, < 3) simpleidn (0.2.1) unf (~> 0.1.4) + strscan (3.1.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) typhoeus (1.4.0) From caeb67aea5cd67f45f80f9844599d705be3e9d04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 May 2024 19:00:58 +0000 Subject: [PATCH 19/26] Bump nokogiri from 1.16.2 to 1.16.5 in /docs Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.16.2 to 1.16.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.16.2...v1.16.5) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] --- docs/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index de0120c06..228cf9084 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -205,13 +205,13 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.3.6) - mini_portile2 (2.8.5) + mini_portile2 (2.8.6) minima (2.5.1) jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) minitest (5.19.0) - nokogiri (1.16.2) + nokogiri (1.16.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) octokit (4.25.1) From 509ea68f9d498d868597b4042267ff67cf4df80e Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Sat, 8 Jun 2024 19:48:09 +0100 Subject: [PATCH 20/26] Fix thread state when stepping over There was a suspicious TODO in the code, which was the main reason this was broken: We were unconditionally "continuing" all threads when doing StepOver. This is obviously wrong, and it's correct for StepIn, StepOut etc. -> Wait for the step response and only continue the thread that you stepped within. Meanwhile I also noticed that the 'stopped' event handling was incorrect if we get a flood of stopped events for different threads. If we got 3 stopped events in quick succession, we'd end up dropping the middle one. This was because we only stored the latest-most pending request. Not sure why i thought that was a good idea, as the handler for the stoppped event includes the thread ID that was actully stopped. This particularly affects the java debugger which is afaict the only one that doesn't set allThreadsStopped=true. Fixes #865 --- python3/vimspector/debug_session.py | 19 ++++++++----------- python3/vimspector/stack_trace.py | 28 +++++++++++++++------------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/python3/vimspector/debug_session.py b/python3/vimspector/debug_session.py index f97e5282f..1df0f4611 100644 --- a/python3/vimspector/debug_session.py +++ b/python3/vimspector/debug_session.py @@ -794,27 +794,24 @@ def _DetectSessionFile( self, @CurrentSession() @IfConnected() def StepOver( self, **kwargs ): - if self._stackTraceView.GetCurrentThreadId() is None: + threadId = self._stackTraceView.GetCurrentThreadId() + if threadId is None: return + def handler( *_ ): + self._stackTraceView.OnContinued( self, { 'threadId': threadId } ) + self.ClearCurrentPC() + arguments = { - 'threadId': self._stackTraceView.GetCurrentThreadId(), + 'threadId': threadId, 'granularity': self._CurrentSteppingGranularity(), } arguments.update( kwargs ) - - if not self._server_capabilities.get( 'supportsSteppingGranularity' ): - arguments.pop( 'granularity' ) - - self._connection.DoRequest( None, { + self._connection.DoRequest( handler, { 'command': 'next', 'arguments': arguments, } ) - # TODO: WHy is this different from StepInto and StepOut - self._stackTraceView.OnContinued( self ) - self.ClearCurrentPC() - @CurrentSession() @IfConnected() def StepInto( self, **kwargs ): diff --git a/python3/vimspector/stack_trace.py b/python3/vimspector/stack_trace.py index f39aa157f..2bac73d64 100644 --- a/python3/vimspector/stack_trace.py +++ b/python3/vimspector/stack_trace.py @@ -31,7 +31,6 @@ class ThreadRequestState: NO = 0 REQUESTING = 1 - PENDING = 2 class Thread: @@ -94,7 +93,7 @@ class Session( object ): threads: typing.List[ Thread ] session: "DebugSession" requesting_threads = ThreadRequestState.NO - pending_thread_request = None + pending_thread_requests = [] sources: dict def __init__( self, session: "DebugSession" ): @@ -245,25 +244,23 @@ def LoadThreads( self, return if s.requesting_threads != ThreadRequestState.NO: - s.requesting_threads = ThreadRequestState.PENDING - s.pending_thread_request = ( infer_current_frame, - reason, - stopEvent ) + s.pending_thread_requests.append( + ( infer_current_frame, reason, stopEvent ) + ) return def consume_threads( message ): + s.requesting_threads = ThreadRequestState.NO + requesting = False - if s.requesting_threads == ThreadRequestState.PENDING: + if s.pending_thread_requests: # We may have hit a thread event, so try again. # Note that we do have to process this message though to ensure that our # thread states are all correct. - s.requesting_threads = ThreadRequestState.NO - self.LoadThreads( s.session, *s.pending_thread_request ) + next_request = s.pending_thread_requests.pop( 0 ) + self.LoadThreads( s.session, *next_request ) requesting = True - s.requesting_threads = ThreadRequestState.NO - s.pending_thread_request = None - if not ( message.get( 'body' ) or {} ).get( 'threads' ): # This is a protocol error. It is required to return at least one! # But about 100% of servers break the protocol. @@ -324,7 +321,12 @@ def consume_threads( message ): def failure_handler( reason, msg ): # Make sure we request them again if the request fails s.requesting_threads = ThreadRequestState.NO - s.pending_thread_request = None + if s.pending_thread_requests: + # We may have hit a thread event, so try again. + # Note that we do have to process this message though to ensure that our + # thread states are all correct. + next_request = s.pending_thread_requests.pop( 0 ) + self.LoadThreads( s.session, *next_request ) s.requesting_threads = ThreadRequestState.REQUESTING debug_session.Connection().DoRequest( consume_threads, { From 909f564cef123bcb48624cb88f17ed7c261c7ee8 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Sun, 9 Jun 2024 12:31:30 +0100 Subject: [PATCH 21/26] Fix racy tests now that we properly wait for thread events --- tests/disassembly.test.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/disassembly.test.vim b/tests/disassembly.test.vim index 3e1a0f47f..bb1d1891e 100644 --- a/tests/disassembly.test.vim +++ b/tests/disassembly.test.vim @@ -302,6 +302,7 @@ function! Test_Disassembly_StepInGranularity_API_Direct() " " Step over instruction call win_gotoid( g:vimspector_session_windows.code ) + call cursor(1,1) call vimspector#StepIOver() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, 3, 1 ) call WaitForAssert( {-> @@ -312,7 +313,6 @@ function! Test_Disassembly_StepInGranularity_API_Direct() " steps from code window are line steps call win_gotoid( winid ) call vimspector#StepSOver() - call cursor(1,1) call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:buf, s:dpc, 1 ) call WaitForAssert( {-> \ vimspector#test#signs#AssertPCIsAtLineInBuffer( s:fn, 4 ) @@ -338,6 +338,7 @@ function! Test_Disassembly_StepInGranularity_API_Direct_CodeLLDB() " " Step over instruction call win_gotoid( g:vimspector_session_windows.code ) + call cursor(1,1) call vimspector#StepIOver() call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:fn, 3, v:null ) call WaitForAssert( {-> @@ -348,7 +349,6 @@ function! Test_Disassembly_StepInGranularity_API_Direct_CodeLLDB() " steps from code window are line steps call win_gotoid( winid ) call vimspector#StepSOver() - call cursor(1,1) call vimspector#test#signs#AssertCursorIsAtLineInBuffer( s:buf, s:dpc, 1 ) call WaitForAssert( {-> \ vimspector#test#signs#AssertPCIsAtLineInBuffer( s:fn, 4 ) From 016cd935bbb22e8ee454af09bc3a50eda39258f3 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Sun, 9 Jun 2024 12:31:46 +0100 Subject: [PATCH 22/26] Fix filtering tests causing bash script errors --- run_tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_tests b/run_tests index 8768fb184..103b59f67 100755 --- a/run_tests +++ b/run_tests @@ -306,7 +306,7 @@ while true; do pushd ${TESTDIR} > /dev/null RUN="${RUN_TEST} --cmd \"${BASEDIR_CMD}\" \ --cmd 'au SwapExists * let v:swapchoice = \"e\"'\ - $tt $T" + '$tt' '$T'" if ${ASCIINEMA} rec -q --cols $SCREENCOLS --rows $SCREENROWS --overwrite --command "${RUN}" $t.cast >&3 && [ -f $t.res ]; then echo "%PASS: $t PASSED" From 9955480d79d6ad512be20aff286a1bfe7796e3a8 Mon Sep 17 00:00:00 2001 From: 0xAJ Date: Wed, 24 Jul 2024 13:55:26 -0500 Subject: [PATCH 23/26] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0be4809a3..2df4d3239 100644 --- a/README.md +++ b/README.md @@ -270,10 +270,10 @@ The following features are not implemented for Windows: If you just want to try out vimspector without changing your vim config, there are example projects for a number of languages in `support/test`, including: -* Python (`support/test/python/simple_python`) -* Go (`support/test/go/hello_world` and `support/test/go/name-starts-with-vowel`) -* Nodejs (`support/test/node/simple`) -* Chrome/Firefox (`support/test/web/`) +* Python ([support/test/python/simple_python](support/test/python/simple_python)) +* Go ([support/test/go/hello_world](support/test/go/hello_world) and [support/test/go/name-starts-with-vowel](support/test/go/name-starts-with-vowel)) +* Nodejs ([support/test/node/simple](support/test/node/simple)) +* Chrome/Firefox ([support/test/web](support/test/web)) * etc. To test one of these out, cd to the directory and run: From d9eb168be59e3a2a9aa6f9e1621b534c708f1af2 Mon Sep 17 00:00:00 2001 From: 0xAJ Date: Wed, 24 Jul 2024 13:59:25 -0500 Subject: [PATCH 24/26] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2df4d3239..cbc494e3d 100644 --- a/README.md +++ b/README.md @@ -270,7 +270,7 @@ The following features are not implemented for Windows: If you just want to try out vimspector without changing your vim config, there are example projects for a number of languages in `support/test`, including: -* Python ([support/test/python/simple_python](support/test/python/simple_python)) +* Python `([support/test/python/simple_python](support/test/python/simple_python))` * Go ([support/test/go/hello_world](support/test/go/hello_world) and [support/test/go/name-starts-with-vowel](support/test/go/name-starts-with-vowel)) * Nodejs ([support/test/node/simple](support/test/node/simple)) * Chrome/Firefox ([support/test/web](support/test/web)) From dcf9ee58c6ba63f2ca3affab7d94a015005e3c14 Mon Sep 17 00:00:00 2001 From: 0xAJ Date: Wed, 24 Jul 2024 14:00:14 -0500 Subject: [PATCH 25/26] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cbc494e3d..2df4d3239 100644 --- a/README.md +++ b/README.md @@ -270,7 +270,7 @@ The following features are not implemented for Windows: If you just want to try out vimspector without changing your vim config, there are example projects for a number of languages in `support/test`, including: -* Python `([support/test/python/simple_python](support/test/python/simple_python))` +* Python ([support/test/python/simple_python](support/test/python/simple_python)) * Go ([support/test/go/hello_world](support/test/go/hello_world) and [support/test/go/name-starts-with-vowel](support/test/go/name-starts-with-vowel)) * Nodejs ([support/test/node/simple](support/test/node/simple)) * Chrome/Firefox ([support/test/web](support/test/web)) From d37b10f8f6c38dfc63683ccc2e1a7c4aa1efb732 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" Date: Wed, 24 Jul 2024 19:56:00 +0000 Subject: [PATCH 26/26] Update vim docs --- doc/vimspector.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/vimspector.txt b/doc/vimspector.txt index 9d170061e..eb5b058ef 100644 --- a/doc/vimspector.txt +++ b/doc/vimspector.txt @@ -433,11 +433,10 @@ Trying it out ~ If you just want to try out vimspector without changing your vim config, there are example projects for a number of languages in 'support/test', including: -- Python ('support/test/python/simple_python') -- Go ('support/test/go/hello_world' and - 'support/test/go/name-starts-with-vowel') -- Nodejs ('support/test/node/simple') -- Chrome/Firefox ('support/test/web/') +- Python (support/test/python/simple_python) +- Go (support/test/go/hello_world and support/test/go/name-starts-with-vowel) +- Nodejs (support/test/node/simple) +- Chrome/Firefox (support/test/web) - etc. To test one of these out, cd to the directory and run: