Simple tests for node debugger
This commit is contained in:
parent
968a443d09
commit
0b0388d075
5 changed files with 100 additions and 0 deletions
32
README.md
32
README.md
|
|
@ -87,6 +87,7 @@ on a best-efforts basis:
|
|||
- Java (see caveats)
|
||||
- C# (c-sharp) using dotnet core
|
||||
- Go (requires separate installation of [Delve][])
|
||||
- Node.js (requires node <12 for installation)
|
||||
|
||||
## Languages known not to work
|
||||
|
||||
|
|
@ -160,6 +161,7 @@ The debug adapters themselves have certain runtime dependencies:
|
|||
| C# (dotnet core) | Experimental | `--force-enable-csharp` | netcoredbg | DotNet core |
|
||||
| C# (mono) | Experimental | `--force-enable-csharp` | vscode-mono-debug | Mono |
|
||||
| Go | Experimental | `--enable-go` | vscode-go | Go, [Delve][] |
|
||||
| Node.js | Experimental | `--force-enable-node` | vscode-node-debug2 | 6 < Node < 12, Npm |
|
||||
|
||||
For other languages, you'll need some other way to install the gadget.
|
||||
|
||||
|
|
@ -605,6 +607,36 @@ Requires:
|
|||
}
|
||||
```
|
||||
|
||||
* Node.js
|
||||
|
||||
Requires:
|
||||
|
||||
* `install_gadget.py --force-enable-node`
|
||||
* For installation, a Node.js environemt that is < node 12. I believe this is an
|
||||
incompatibility with gulp. Advice, use [nvm][] with `nvm install --lts 10; nvm
|
||||
use --lts 10; ./install_gadget.py --force-enable-node ...`
|
||||
|
||||
* Options described here:
|
||||
https://code.visualstudio.com/docs/nodejs/nodejs-debugging
|
||||
|
||||
```json
|
||||
{
|
||||
"configurations": {
|
||||
"run": {
|
||||
"adapter": "vscode-node",
|
||||
"configuration": {
|
||||
"request": "launch",
|
||||
"protocol": "auto",
|
||||
"stopOnEntry": true,
|
||||
"console": "integratedTerminal",
|
||||
"program": "${workspaceRoot}/simple.js",
|
||||
"cwd": "${workspaceRoot}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Also the mock debugger, but that isn't actually useful.
|
||||
|
||||
## Partially supported
|
||||
|
|
|
|||
|
|
@ -206,6 +206,25 @@ GADGETS = {
|
|||
},
|
||||
},
|
||||
},
|
||||
'vscode-node-debug2': {
|
||||
'language': 'node',
|
||||
'enabled': False,
|
||||
'repo': {
|
||||
'url': 'https://github.com/microsoft/vscode-node-debug2',
|
||||
'ref': 'v1.39.1',
|
||||
},
|
||||
'do': lambda name, root: InstallNodeDebug( name, root ),
|
||||
'adapters': {
|
||||
'vscode-node': {
|
||||
'name': 'node2',
|
||||
'type': 'node2',
|
||||
'command': [
|
||||
'node',
|
||||
'${gadgetDir}/vscode-node-debug2/out/src/nodeDebug.js'
|
||||
]
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -279,6 +298,26 @@ def InstallTclProDebug( name, root ):
|
|||
MakeSymlink( gadget_dir, name, root )
|
||||
|
||||
|
||||
def InstallNodeDebug( name, root ):
|
||||
node_version = subprocess.check_output( [ 'node', '--version' ] ).strip()
|
||||
print( "Node.js version: {}".format( node_version ) )
|
||||
if map( int, node_version[ 1: ].split( '.' ) ) >= [ 12, 0, 0 ]:
|
||||
print( "Can't install vscode-debug-node2:" )
|
||||
print( "Sorry, you appear to be running node 12 or later. That's not "
|
||||
"compatible with the build system for this extension, and as far as "
|
||||
"we know, there isn't a pre-built independent package." )
|
||||
print( "My advice is to install nvm, then do:" )
|
||||
print( " $ nvm install --lts 10" )
|
||||
print( " $ nvm use --lts 10" )
|
||||
print( " $ ./install_gadget.py --enable-node ..." )
|
||||
raise RuntimeError( 'Invalid node environent for node debugger' )
|
||||
|
||||
with CurrentWorkingDir( root ):
|
||||
subprocess.check_call( [ 'npm', 'install' ] )
|
||||
subprocess.check_call( [ 'npm', 'run', 'build' ] )
|
||||
MakeSymlink( gadget_dir, name, root )
|
||||
|
||||
|
||||
def DownloadFileTo( url, destination, file_name = None, checksum = None ):
|
||||
if not file_name:
|
||||
file_name = url.split( '/' )[ -1 ]
|
||||
|
|
@ -396,6 +435,12 @@ def CloneRepoTo( url, ref, destination ):
|
|||
RemoveIfExists( destination )
|
||||
subprocess.check_call( [ 'git', 'clone', url, destination ] )
|
||||
subprocess.check_call( [ 'git', '-C', destination, 'checkout', ref ] )
|
||||
subprocess.check_call( [ 'git', 'submodule', 'sync', '--recursive' ] )
|
||||
subprocess.check_call( [ 'git',
|
||||
'submodule',
|
||||
'update',
|
||||
'--init',
|
||||
'--recursive' ] )
|
||||
|
||||
|
||||
OS = install.GetOS()
|
||||
|
|
|
|||
5
support/test/node/simple/.tern-project
Normal file
5
support/test/node/simple/.tern-project
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"plugins": {
|
||||
"node": {}
|
||||
}
|
||||
}
|
||||
15
support/test/node/simple/.vimspector.json
Normal file
15
support/test/node/simple/.vimspector.json
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"configurations": {
|
||||
"run": {
|
||||
"adapter": "vscode-node",
|
||||
"configuration": {
|
||||
"request": "launch",
|
||||
"protocol": "auto",
|
||||
"stopOnEntry": true,
|
||||
"console": "integratedTerminal",
|
||||
"program": "${workspaceRoot}/simple.js",
|
||||
"cwd": "${workspaceRoot}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3
support/test/node/simple/simple.js
Normal file
3
support/test/node/simple/simple.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
var msg = 'Hello, world!'
|
||||
|
||||
console.log( "OK stuff happened" )
|
||||
Loading…
Add table
Add a link
Reference in a new issue