diff --git a/dap-codelldb.el b/dap-codelldb.el index 7c0d07e3..1340f152 100644 --- a/dap-codelldb.el +++ b/dap-codelldb.el @@ -21,7 +21,7 @@ (require 'dap-mode) (require 'dap-utils) -(defcustom dap-codelldb-extension-version "1.7.4" +(defcustom dap-codelldb-extension-version "1.8.1" "The version of the codelldb vscode extension." :group 'dap-codelldb :type 'string) diff --git a/dap-cpptools.el b/dap-cpptools.el index b6ff5a05..baa2a94d 100644 --- a/dap-cpptools.el +++ b/dap-cpptools.el @@ -33,7 +33,7 @@ :type 'string) (defcustom dap-cpptools-extension-version - (let ((current-ver "1.11.5") + (let ((current-ver "1.13.8") (installed-ver (dap-utils-vscode-get-installed-extension-version dap-cpptools-debug-path))) (when (and installed-ver (version< installed-ver current-ver)) (warn "You have an old cpptools v%s. Please run `C-u 1 M-x dap-cpptools-setup' \ diff --git a/dap-gdb-lldb.el b/dap-gdb-lldb.el index 39337495..c29bfada 100644 --- a/dap-gdb-lldb.el +++ b/dap-gdb-lldb.el @@ -29,7 +29,7 @@ (require 'dap-mode) (require 'dap-utils) -(defcustom dap-gdb-lldb-extension-version "0.26.0" +(defcustom dap-gdb-lldb-extension-version "0.26.1" "The version of the gdb-lldb vscode extension." :group 'dap-gdb-lldb :type 'string) diff --git a/dap-utils.el b/dap-utils.el index fe5c23c1..08b907fc 100644 --- a/dap-utils.el +++ b/dap-utils.el @@ -102,14 +102,25 @@ PATH is the download destination dir." (f-join dap-utils-extension-path "openvsx" (concat publisher "." name))))) (dap-utils--get-extension url dest))) -(defun dap-utils-get-github-extension (owner repo version &optional path) +(defun dap-utils-get-github-extension (owner repo &optional version path) "Get extension from github named OWNER/REPO with VERSION. PATH is the download destination path." - (let* ((url (format dap-utils-github-extension-url owner repo version)) + (let* ((version (or version (dap-utils-get-github-extension-latest-version owner repo))) + (url (format dap-utils-github-extension-url owner repo version)) (dest (or path (f-join dap-utils-extension-path "github" (concat owner "." repo))))) (dap-utils--get-extension url dest))) +(defun dap-utils-get-github-extension-latest-version (owner repo) + (let ((latest + (with-temp-buffer + (url-insert-file-contents + (format + "https://api.github.com/repos/%s/%s/releases/latest" + owner repo)) + (json-parse-buffer :object-type 'plist)))) + (car (last (split-string (plist-get latest :html_url) "/"))))) + (defun dap-utils-vscode-get-installed-extension-version (path) "Check the version of the vscode extension installed in PATH. Returns nil if the extension is not installed."