Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace debuggerflavor with debugger (take #2) #1357

Merged
merged 1 commit into from
Oct 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion modules/vstudio/_preload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@

-- Initialize Specific API

p.api.addAllowed("debugger", "VisualStudioLocal")
p.api.addAllowed("debugger", "VisualStudioRemote")
p.api.addAllowed("debugger", "VisualStudioWebBrowser")
p.api.addAllowed("debugger", "VisualStudioWebService")

p.api.register {
name = "shaderoptions",
scope = "config",
Expand Down Expand Up @@ -131,7 +136,7 @@
tokens = true,
}

p.api.register {
p.api.register { -- DEPRECATED 2019-10-21
name = "debuggerflavor",
scope = "config",
kind = "string",
Expand All @@ -143,6 +148,12 @@
}
}

p.api.deprecateField("debuggerflavor", 'Use `debugger` instead.',
function(value)
debugger('VisualStudio' .. value)
end)


--
-- Decide when the full module should be loaded.
--
Expand Down
34 changes: 30 additions & 4 deletions modules/vstudio/tests/vc2010/test_debug_settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,47 @@ foo=bar</LocalDebuggerEnvironment>
end

--
-- Test Debugger Flavor
-- Test debugger flavors
--

function suite.debuggerFlavor_OnWindowsLocal()
debuggerflavor "Local"
function suite.debugger_OnWindowsDefault()
debugger "Default"
prepare()
test.capture [[

]]
end

function suite.debugger_OnWindowsUnavailable()
debugger "GDB"
prepare()
test.capture [[

]]
end

function suite.debugger_OnWindowsLocal()
debugger "VisualStudioLocal"
prepare()
test.capture [[
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
]]
end

function suite.debuggerFlavor_OnWindowsRemote()
debuggerflavor "Remote"
debugger "VisualStudioRemote"
prepare()
test.capture [[
<DebuggerFlavor>WindowsRemoteDebugger</DebuggerFlavor>
]]
end

function suite.debuggerFlavor_OnDebugDirAndDebugger()
debugdir "bin/debug"
debugger "VisualStudioRemote"
prepare()
test.capture [[
<LocalDebuggerWorkingDirectory>bin\debug</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsRemoteDebugger</DebuggerFlavor>
]]
end
10 changes: 5 additions & 5 deletions modules/vstudio/vs2010_vcxproj_user.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@

function m.debuggerFlavor(cfg)
local map = {
Local = "WindowsLocalDebugger",
Remote = "WindowsRemoteDebugger",
WebBrowser = "WebBrowserDebugger",
WebService = "WebServiceDebugger"
VisualStudioLocal = "WindowsLocalDebugger",
VisualStudioRemote = "WindowsRemoteDebugger",
VisualStudioWebBrowser = "WebBrowserDebugger",
VisualStudioWebService = "WebServiceDebugger"
}

local value = map[cfg.debuggerflavor]
local value = map[cfg.debugger]
if value then
p.w('<DebuggerFlavor>%s</DebuggerFlavor>', value)
elseif cfg.debugdir or cfg.debugcommand then
Expand Down