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
|
|
@ -135,8 +135,8 @@ runtime dependencies). They are categorised by their level of support:
|
||||||
* `Legacy`: No longer supported, please migrate your config
|
* `Legacy`: No longer supported, please migrate your config
|
||||||
|
|
||||||
| Language | Status | Switch (for `install_gadget.py`) | Adapter (for `:VimspectorInstall`) | Dependencies |
|
| Language | Status | Switch (for `install_gadget.py`) | Adapter (for `:VimspectorInstall`) | Dependencies |
|
||||||
|--------------------|--------------|----------------------------------|------------------------------------|--------------------------------------------|
|
|--------------------|--------------|------------------------------------|------------------------------------|--------------------------------------------|
|
||||||
| C, C++, etc. | Tested | `--all` or `--enable-c` | vscode-cpptools | mono-core |
|
| 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 |
|
| Rust, C, C++, etc. | Supported | `--force-enable-rust` | CodeLLDB | Python 3 |
|
||||||
| Python | Tested | `--all` or `--enable-python` | debugpy | Python 2.7 or Python 3 |
|
| Python | Tested | `--all` or `--enable-python` | debugpy | Python 2.7 or Python 3 |
|
||||||
| Go | Tested | `--enable-go` | vscode-go | Go, [Delve][] |
|
| Go | Tested | `--enable-go` | vscode-go | Go, [Delve][] |
|
||||||
|
|
@ -148,6 +148,7 @@ runtime dependencies). They are categorised by their level of support:
|
||||||
| Java | Supported | `--force-enable-java ` | vscode-java-debug | Compatible LSP plugin (see [later](#java)) |
|
| 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# (dotnet core) | Experimental | `--force-enable-csharp` | netcoredbg | DotNet core |
|
||||||
| C# (mono) | Experimental | `--force-enable-csharp` | vscode-mono-debug | Mono |
|
| 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 |
|
| Python.legacy | Legacy | `--force-enable-python.legacy` | vscode-python | Node 10, Python 2.7 or Python 3 |
|
||||||
|
|
||||||
## Other languages
|
## Other languages
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,10 @@ parser.add_argument( '--sudo',
|
||||||
|
|
||||||
done_languages = set()
|
done_languages = set()
|
||||||
for name, gadget in gadgets.GADGETS.items():
|
for name, gadget in gadgets.GADGETS.items():
|
||||||
lang = gadget[ 'language' ]
|
langs = gadget[ 'language' ]
|
||||||
|
if not isinstance( langs, list ):
|
||||||
|
langs = [ langs ]
|
||||||
|
for lang in langs:
|
||||||
if lang in done_languages:
|
if lang in done_languages:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
@ -182,14 +185,24 @@ all_adapters = installer.ReadAdapters(
|
||||||
manifest = installer.Manifest()
|
manifest = installer.Manifest()
|
||||||
|
|
||||||
for name, gadget in gadgets.GADGETS.items():
|
for name, gadget in gadgets.GADGETS.items():
|
||||||
|
langs = gadget[ 'language' ]
|
||||||
|
if not isinstance( langs, list ):
|
||||||
|
langs = [ langs ]
|
||||||
|
skip = 0
|
||||||
|
for lang in langs:
|
||||||
if not gadget.get( 'enabled', True ):
|
if not gadget.get( 'enabled', True ):
|
||||||
if ( not args.force_all
|
if ( not args.force_all
|
||||||
and not getattr( args, 'force_enable_' + gadget[ 'language' ] ) ):
|
and not getattr( args, 'force_enable_' + lang ) ):
|
||||||
|
skip = skip + 1
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
if not args.all and not getattr( args, 'enable_' + gadget[ 'language' ] ):
|
if not args.all and not getattr( args, 'enable_' + lang ):
|
||||||
|
skip = skip + 1
|
||||||
continue
|
continue
|
||||||
if getattr( args, 'disable_' + gadget[ 'language' ] ):
|
if getattr( args, 'disable_' + lang ):
|
||||||
|
skip = skip + 1
|
||||||
|
continue
|
||||||
|
if skip == len( langs ):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not args.upgrade:
|
if not args.upgrade:
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import os
|
||||||
|
|
||||||
GADGETS = {
|
GADGETS = {
|
||||||
'vscode-cpptools': {
|
'vscode-cpptools': {
|
||||||
'language': 'c',
|
'language': [ 'c', 'cpp', 'rust' ],
|
||||||
'download': {
|
'download': {
|
||||||
'url': 'https://github.com/Microsoft/vscode-cpptools/releases/download/'
|
'url': 'https://github.com/Microsoft/vscode-cpptools/releases/download/'
|
||||||
'${version}/${file_name}',
|
'${version}/${file_name}',
|
||||||
|
|
@ -225,7 +225,7 @@ GADGETS = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'netcoredbg': {
|
'netcoredbg': {
|
||||||
'language': 'csharp',
|
'language': [ 'csharp', 'fsharp', 'vbnet' ],
|
||||||
'enabled': False,
|
'enabled': False,
|
||||||
'download': {
|
'download': {
|
||||||
'url': ( 'https://github.com/Samsung/netcoredbg/releases/download/'
|
'url': ( 'https://github.com/Samsung/netcoredbg/releases/download/'
|
||||||
|
|
|
||||||
|
|
@ -229,10 +229,14 @@ def GadgetListToInstallerArgs( *gadget_list ):
|
||||||
except KeyError:
|
except KeyError:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
lang = gadget[ "language" ]
|
||||||
|
if isinstance( lang, list ):
|
||||||
|
lang = lang[ 0 ]
|
||||||
|
|
||||||
if not gadget.get( 'enabled', True ):
|
if not gadget.get( 'enabled', True ):
|
||||||
installer_args.append( f'--force-enable-{ gadget[ "language" ] }' )
|
installer_args.append( f'--force-enable-{lang}' )
|
||||||
else:
|
else:
|
||||||
installer_args.append( f'--enable-{ gadget[ "language" ] }' )
|
installer_args.append( f'--enable-{lang}' )
|
||||||
|
|
||||||
return installer_args
|
return installer_args
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue