From adfce8d30e7e30512ffd0dc5eeca23b105725598 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Wed, 31 Jul 2019 17:53:50 +0100 Subject: [PATCH] First attempt to make vscode-go work --- install_gadget.py | 39 +++++++++++++++----- support/test/go/hello_world/.gitignore | 1 + support/test/go/hello_world/.vimspector.json | 14 +++++++ support/test/go/hello_world/hello-world.go | 6 +++ 4 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 support/test/go/hello_world/.gitignore create mode 100644 support/test/go/hello_world/.vimspector.json create mode 100644 support/test/go/hello_world/hello-world.go diff --git a/install_gadget.py b/install_gadget.py index 4660af4..d3af082 100755 --- a/install_gadget.py +++ b/install_gadget.py @@ -43,8 +43,8 @@ GADGETS = { 'vscode-cpptools': { 'language': 'c', 'download': { - 'url': ( 'https://github.com/Microsoft/vscode-cpptools/releases/download/' - '${version}/${file_name}' ), + 'url': 'https://github.com/Microsoft/vscode-cpptools/releases/download/' + '${version}/${file_name}', }, 'do': lambda name, root: InstallCppTools( name, root ), 'all': { @@ -80,8 +80,8 @@ GADGETS = { 'vscode-python': { 'language': 'python', 'download': { - 'url': ( 'https://github.com/Microsoft/vscode-python/releases/download/' - '${version}/${file_name}' ), + 'url': 'https://github.com/Microsoft/vscode-python/releases/download/' + '${version}/${file_name}', }, 'all': { 'version': '2019.5.17059', @@ -111,8 +111,8 @@ GADGETS = { 'language': 'csharp', 'enabled': False, 'download': { - 'url': ( 'https://github.com/Samsung/netcoredbg/releases/download/latest/' - '${file_name}' ), + 'url': 'https://github.com/Samsung/netcoredbg/releases/download/latest/' + '${file_name}', 'format': 'tar', }, 'all': { @@ -175,15 +175,36 @@ GADGETS = { 'vscode-bash-debug': { 'language': 'bash', 'download': { - 'url': ( 'https://github.com/rogalmic/vscode-bash-debug/releases/' - 'download/${version}/${file_name}' ), + 'url': 'https://github.com/rogalmic/vscode-bash-debug/releases/' + 'download/${version}/${file_name}', }, 'all': { 'file_name': 'bash-debug-0.3.5.vsix', 'version': 'v0.3.5', 'checksum': '', } - } + }, + 'vscode-go': { + 'language': 'go', + 'download': { + 'url': 'https://github.com/microsoft/vscode-go/releases/download/' + '${version}/${file_name}' + }, + 'all': { + 'version': '0.11.4', + 'file_name': 'Go-0.11.4.vsix', + 'checksum': '' + }, + 'adapters': { + 'vscode-go': { + 'name': 'delve', + 'command': [ + 'node', + '${gadgetDir}/vscode-go/out/src/debugAdapter/goDebug.js' + ], + }, + }, + }, } diff --git a/support/test/go/hello_world/.gitignore b/support/test/go/hello_world/.gitignore new file mode 100644 index 0000000..242c034 --- /dev/null +++ b/support/test/go/hello_world/.gitignore @@ -0,0 +1 @@ +hello_world diff --git a/support/test/go/hello_world/.vimspector.json b/support/test/go/hello_world/.vimspector.json new file mode 100644 index 0000000..7934b48 --- /dev/null +++ b/support/test/go/hello_world/.vimspector.json @@ -0,0 +1,14 @@ +{ + "configurations": { + "run": { + "adapter": "vscode-go", + "configuration": { + "request": "launch", + "program": "${workspaceRoot}/hello-world.go", + "mode": "debug", + "dlvToolPath": "$HOME/go/bin/dlv", + "trace": true + } + } + } +} diff --git a/support/test/go/hello_world/hello-world.go b/support/test/go/hello_world/hello-world.go new file mode 100644 index 0000000..673d1b2 --- /dev/null +++ b/support/test/go/hello_world/hello-world.go @@ -0,0 +1,6 @@ +package main +import "fmt" +func main() { + var v = "test" + fmt.Println("hello world: " + v) +}