Skip to content

Commit

Permalink
fix: don't warn on user defined vscode variables (#325)
Browse files Browse the repository at this point in the history
* fix: don't warn on user defined vscode variables (#324)

Added a whitelist for the VSCode task's variables which are unsupported by us.
Warn only if variable is in whitelist.

* refactor: use simple comparisons

---------

Co-authored-by: Steven Arcangeli <[email protected]>
  • Loading branch information
lnc3l0t and stevearc authored Jul 15, 2024
1 parent 2a540de commit 98ce1c8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lua/overseer/template/vscode/variables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ M.replace_vars = function(str, params, precalculated_vars)
if precalculated_vars and precalculated_vars[name] then
return precalculated_vars[name]
end
-- TODO does not support ${workspacefolder:VALUE}
-- TODO does not support ${config:VALUE}
-- TODO does not support ${command:VALUE}
if name == "userHome" then
return assert(vim.loop.os_homedir())
elseif name == "workspaceFolder" then
Expand Down Expand Up @@ -125,7 +122,12 @@ M.replace_vars = function(str, params, precalculated_vars)
else
fullname = string.format("${%s}", name)
end
log:warn("Unsupported VS Code variable: %s", fullname)
-- TODO does not support ${workspacefolder:VALUE}
-- TODO does not support ${config:VALUE}
-- TODO does not support ${command:VALUE}
if name == "workspacefolder" or name == "config" or name == "command" then
log:warn("Unsupported VS Code variable: %s", fullname)
end
return fullname
end
end)
Expand Down

0 comments on commit 98ce1c8

Please sign in to comment.