Merge pull request #317 from yatli/master
multiple languages per adapter
This commit is contained in:
commit
1556e63ef0
4 changed files with 66 additions and 48 deletions
31
README.md
31
README.md
|
|
@ -134,21 +134,22 @@ runtime dependencies). They are categorised by their level of support:
|
|||
* `Experimental`: Working, but not frequently used and rarely tested
|
||||
* `Legacy`: No longer supported, please migrate your config
|
||||
|
||||
| Language | Status | Switch (for `install_gadget.py`) | Adapter (for `:VimspectorInstall`) | Dependencies |
|
||||
|--------------------|--------------|----------------------------------|------------------------------------|--------------------------------------------|
|
||||
| C, C++, etc. | Tested | `--all` or `--enable-c` | vscode-cpptools | mono-core |
|
||||
| Rust, C, C++, etc. | Supported | `--force-enable-rust` | CodeLLDB | Python 3 |
|
||||
| Python | Tested | `--all` or `--enable-python` | debugpy | Python 2.7 or Python 3 |
|
||||
| Go | Tested | `--enable-go` | vscode-go | Go, [Delve][] |
|
||||
| TCL | Supported | `--all` or `--enable-tcl` | tclpro | TCL 8.5 |
|
||||
| Bourne Shell | Supported | `--all` or `--enable-bash` | vscode-bash-debug | Bash v?? |
|
||||
| Lua | Supported | `--all` or `--enable-lua` | local-lua-debugger-vscode | Node >=12.13.0, Npm, Lua interpreter |
|
||||
| Node.js | Supported | `--force-enable-node` | vscode-node-debug2 | 6 < Node < 12, Npm |
|
||||
| Javascript | Supported | `--force-enable-chrome` | debugger-for-chrome | Chrome |
|
||||
| Java | Supported | `--force-enable-java ` | vscode-java-debug | Compatible LSP plugin (see [later](#java)) |
|
||||
| C# (dotnet core) | Experimental | `--force-enable-csharp` | netcoredbg | DotNet core |
|
||||
| C# (mono) | Experimental | `--force-enable-csharp` | vscode-mono-debug | Mono |
|
||||
| Python.legacy | Legacy | `--force-enable-python.legacy` | vscode-python | Node 10, Python 2.7 or Python 3 |
|
||||
| Language | Status | Switch (for `install_gadget.py`) | Adapter (for `:VimspectorInstall`) | Dependencies |
|
||||
|--------------------|--------------|------------------------------------|------------------------------------|--------------------------------------------|
|
||||
| C, C++, Rust etc. | Tested | `--all` or `--enable-c` (or cpp) | vscode-cpptools | mono-core |
|
||||
| Rust, C, C++, etc. | Supported | `--force-enable-rust` | CodeLLDB | Python 3 |
|
||||
| Python | Tested | `--all` or `--enable-python` | debugpy | Python 2.7 or Python 3 |
|
||||
| Go | Tested | `--enable-go` | vscode-go | Go, [Delve][] |
|
||||
| TCL | Supported | `--all` or `--enable-tcl` | tclpro | TCL 8.5 |
|
||||
| Bourne Shell | Supported | `--all` or `--enable-bash` | vscode-bash-debug | Bash v?? |
|
||||
| Lua | Supported | `--all` or `--enable-lua` | local-lua-debugger-vscode | Node >=12.13.0, Npm, Lua interpreter |
|
||||
| Node.js | Supported | `--force-enable-node` | vscode-node-debug2 | 6 < Node < 12, Npm |
|
||||
| Javascript | Supported | `--force-enable-chrome` | debugger-for-chrome | Chrome |
|
||||
| Java | Supported | `--force-enable-java ` | vscode-java-debug | Compatible LSP plugin (see [later](#java)) |
|
||||
| C# (dotnet core) | Experimental | `--force-enable-csharp` | netcoredbg | DotNet core |
|
||||
| C# (mono) | Experimental | `--force-enable-csharp` | vscode-mono-debug | Mono |
|
||||
| F#, VB, etc. | Experimental | `--force-enable-fsharp` (or vbnet) | netcoredbg | DotNet core |
|
||||
| Python.legacy | Legacy | `--force-enable-python.legacy` | vscode-python | Node 10, Python 2.7 or Python 3 |
|
||||
|
||||
## Other languages
|
||||
|
||||
|
|
|
|||
|
|
@ -114,32 +114,35 @@ parser.add_argument( '--sudo',
|
|||
|
||||
done_languages = set()
|
||||
for name, gadget in gadgets.GADGETS.items():
|
||||
lang = gadget[ 'language' ]
|
||||
if lang in done_languages:
|
||||
continue
|
||||
langs = gadget[ 'language' ]
|
||||
if not isinstance( langs, list ):
|
||||
langs = [ langs ]
|
||||
for lang in langs:
|
||||
if lang in done_languages:
|
||||
continue
|
||||
|
||||
done_languages.add( lang )
|
||||
if not gadget.get( 'enabled', True ):
|
||||
parser.add_argument(
|
||||
'--force-enable-' + lang,
|
||||
action = 'store_true',
|
||||
help = 'Install the unsupported {} debug adapter for {} support'.format(
|
||||
name,
|
||||
lang ) )
|
||||
continue
|
||||
|
||||
done_languages.add( lang )
|
||||
if not gadget.get( 'enabled', True ):
|
||||
parser.add_argument(
|
||||
'--force-enable-' + lang,
|
||||
'--enable-' + lang,
|
||||
action = 'store_true',
|
||||
help = 'Install the unsupported {} debug adapter for {} support'.format(
|
||||
help = 'Install the {} debug adapter for {} support'.format(
|
||||
name,
|
||||
lang ) )
|
||||
continue
|
||||
|
||||
parser.add_argument(
|
||||
'--enable-' + lang,
|
||||
action = 'store_true',
|
||||
help = 'Install the {} debug adapter for {} support'.format(
|
||||
name,
|
||||
lang ) )
|
||||
|
||||
parser.add_argument(
|
||||
'--disable-' + lang,
|
||||
action = 'store_true',
|
||||
help = "Don't install the {} debug adapter for {} support "
|
||||
'(when supplying --all)'.format( name, lang ) )
|
||||
parser.add_argument(
|
||||
'--disable-' + lang,
|
||||
action = 'store_true',
|
||||
help = "Don't install the {} debug adapter for {} support "
|
||||
'(when supplying --all)'.format( name, lang ) )
|
||||
|
||||
parser.add_argument(
|
||||
"--no-check-certificate",
|
||||
|
|
@ -182,15 +185,25 @@ all_adapters = installer.ReadAdapters(
|
|||
manifest = installer.Manifest()
|
||||
|
||||
for name, gadget in gadgets.GADGETS.items():
|
||||
if not gadget.get( 'enabled', True ):
|
||||
if ( not args.force_all
|
||||
and not getattr( args, 'force_enable_' + gadget[ 'language' ] ) ):
|
||||
continue
|
||||
else:
|
||||
if not args.all and not getattr( args, 'enable_' + gadget[ 'language' ] ):
|
||||
continue
|
||||
if getattr( args, 'disable_' + gadget[ 'language' ] ):
|
||||
continue
|
||||
langs = gadget[ 'language' ]
|
||||
if not isinstance( langs, list ):
|
||||
langs = [ langs ]
|
||||
skip = 0
|
||||
for lang in langs:
|
||||
if not gadget.get( 'enabled', True ):
|
||||
if ( not args.force_all
|
||||
and not getattr( args, 'force_enable_' + lang ) ):
|
||||
skip = skip + 1
|
||||
continue
|
||||
else:
|
||||
if not args.all and not getattr( args, 'enable_' + lang ):
|
||||
skip = skip + 1
|
||||
continue
|
||||
if getattr( args, 'disable_' + lang ):
|
||||
skip = skip + 1
|
||||
continue
|
||||
if skip == len( langs ):
|
||||
continue
|
||||
|
||||
if not args.upgrade:
|
||||
manifest.Clear( name )
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import os
|
|||
|
||||
GADGETS = {
|
||||
'vscode-cpptools': {
|
||||
'language': 'c',
|
||||
'language': [ 'c', 'cpp', 'rust' ],
|
||||
'download': {
|
||||
'url': 'https://github.com/Microsoft/vscode-cpptools/releases/download/'
|
||||
'${version}/${file_name}',
|
||||
|
|
@ -225,7 +225,7 @@ GADGETS = {
|
|||
},
|
||||
},
|
||||
'netcoredbg': {
|
||||
'language': 'csharp',
|
||||
'language': [ 'csharp', 'fsharp', 'vbnet' ],
|
||||
'enabled': False,
|
||||
'download': {
|
||||
'url': ( 'https://github.com/Samsung/netcoredbg/releases/download/'
|
||||
|
|
|
|||
|
|
@ -229,10 +229,14 @@ def GadgetListToInstallerArgs( *gadget_list ):
|
|||
except KeyError:
|
||||
continue
|
||||
|
||||
lang = gadget[ "language" ]
|
||||
if isinstance( lang, list ):
|
||||
lang = lang[ 0 ]
|
||||
|
||||
if not gadget.get( 'enabled', True ):
|
||||
installer_args.append( f'--force-enable-{ gadget[ "language" ] }' )
|
||||
installer_args.append( f'--force-enable-{lang}' )
|
||||
else:
|
||||
installer_args.append( f'--enable-{ gadget[ "language" ] }' )
|
||||
installer_args.append( f'--enable-{lang}' )
|
||||
|
||||
return installer_args
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue